initial public commit

This commit is contained in:
Jacob Lifshay 2024-06-10 23:09:13 -07:00
commit 0b958e7852
Signed by: programmerjake
SSH key fingerprint: SHA256:B1iRVvUJkvd7upMIiMqn6OyxvD2SgJkAH3ZnUOj6z+c
56 changed files with 30235 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// See Notices.txt for copyright information
#[test]
fn ui() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/ui/*.rs");
}

View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// See Notices.txt for copyright information
#[allow(unused_imports)]
use fayalite::{hdl_module, int::UInt};
#[hdl_module]
pub fn my_module(a: i32, m: u32, (m, _): (i32, u32)) {
#[hdl]
let m: UInt<8> = m.input();
#[hdl]
let o: UInt<8> = m.output();
}
fn main() {}

View file

@ -0,0 +1,17 @@
error: name conflicts with implicit `m: &mut ModuleBuilder<_>`
--> tests/ui/module.rs:7:26
|
7 | pub fn my_module(a: i32, m: u32, (m, _): (i32, u32)) {
| ^
error: name conflicts with implicit `m: &mut ModuleBuilder<_>`
--> tests/ui/module.rs:7:35
|
7 | pub fn my_module(a: i32, m: u32, (m, _): (i32, u32)) {
| ^
error: name conflicts with implicit `m: &mut ModuleBuilder<_>`
--> tests/ui/module.rs:9:9
|
9 | let m: UInt<8> = m.input();
| ^

View file

@ -0,0 +1,10 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// See Notices.txt for copyright information
use fayalite::Value;
#[derive(Value)]
union U {
a: (),
}
fn main() {}

View file

@ -0,0 +1,7 @@
error: derive(Value) can only be used on structs or enums
--> tests/ui/value_derive.rs:5:10
|
5 | #[derive(Value)]
| ^^^^^
|
= note: this error originates in the derive macro `Value` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -0,0 +1,23 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// See Notices.txt for copyright information
use fayalite::{int::UInt, Value};
#[derive(Value, Clone, Hash, PartialEq, Eq, Debug)]
#[hdl(outline_generated)]
pub struct S<T> {
pub a: T,
b: UInt<3>,
}
#[derive(Value, Clone, Hash, PartialEq, Eq, Debug)]
#[hdl(outline_generated)]
pub enum E<T> {
A,
B {},
C(),
D(UInt<3>),
E { a: UInt<3> },
F(UInt<3>, UInt<3>),
G(T),
H(T, UInt<1>),
}