forked from libre-chip/fayalite
initial public commit
This commit is contained in:
commit
0b958e7852
56 changed files with 30235 additions and 0 deletions
3065
crates/fayalite/tests/module.rs
Normal file
3065
crates/fayalite/tests/module.rs
Normal file
File diff suppressed because it is too large
Load diff
7
crates/fayalite/tests/ui.rs
Normal file
7
crates/fayalite/tests/ui.rs
Normal 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");
|
||||
}
|
14
crates/fayalite/tests/ui/module.rs
Normal file
14
crates/fayalite/tests/ui/module.rs
Normal 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() {}
|
17
crates/fayalite/tests/ui/module.stderr
Normal file
17
crates/fayalite/tests/ui/module.stderr
Normal 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();
|
||||
| ^
|
10
crates/fayalite/tests/ui/value_derive.rs
Normal file
10
crates/fayalite/tests/ui/value_derive.rs
Normal 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() {}
|
7
crates/fayalite/tests/ui/value_derive.stderr
Normal file
7
crates/fayalite/tests/ui/value_derive.stderr
Normal 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)
|
23
crates/fayalite/tests/value_derive.rs
Normal file
23
crates/fayalite/tests/value_derive.rs
Normal 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>),
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue