Skip to content

Commit 5ce1dc4

Browse files
committed
Add waveform file for combinational adder for monitor
1 parent 5500515 commit 5ce1dc4

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
575 Bytes
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// trace 0
2+
trace {
3+
add_combinational(100, 200, 300);
4+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// ARGS: --wave adders/add_combinational.fst --instances add_d0:Adder
2+
struct Adder {
3+
in a: u32,
4+
in b: u32,
5+
out s: u32,
6+
}
7+
8+
// prot add_combinational_illegal_observation_in_conditional<DUT: Adder>(in a: u32, in b: u32, out s: u32) {
9+
// DUT.a := X;
10+
// DUT.b := X;
11+
// DUT.a := a;
12+
13+
// if (DUT.s == 32'b0) { // this should be illegal
14+
// // pass
15+
// } else {
16+
// // pass
17+
// }
18+
// step();
19+
// }
20+
21+
// prot add_combinational_illegal_observation_in_assertion<DUT: Adder>(in a: u32, in b: u32, out s: u32) {
22+
// DUT.a := X;
23+
// DUT.b := X;
24+
// DUT.a := a;
25+
26+
// assert_eq(DUT.s, s); // this should be illegal
27+
// step();
28+
// }
29+
30+
prot add_combinational_legal_observation_illegal_assignment<DUT: Adder>(in a: u32, in b: u32, out s: u32) {
31+
if (DUT.s == 32'b0) {
32+
DUT.a := a; // this should be illegal
33+
} else {
34+
35+
}
36+
step();
37+
}
38+
39+
prot add_combinational<DUT: Adder>(in a: u32, in b: u32, out s: u32) {
40+
DUT.a := a;
41+
DUT.b := b;
42+
assert_eq(s, DUT.s);
43+
step();
44+
}

0 commit comments

Comments
 (0)