diff options
| author | jackkoenig | 2016-04-06 16:16:07 -0700 |
|---|---|---|
| committer | jackkoenig | 2016-04-08 17:43:04 -0700 |
| commit | c69b16e3b7db132273805d3a75ba9b33ec74eafd (patch) | |
| tree | f8f7228e62a0cd2c9dbea535c3600deb84c4d889 /src/test/resources/features/NestedSubAccessTester.fir | |
| parent | 400b147c3b3b71e1d52432f351deacce920b2016 (diff) | |
Add small test for issue #105
Diffstat (limited to 'src/test/resources/features/NestedSubAccessTester.fir')
| -rw-r--r-- | src/test/resources/features/NestedSubAccessTester.fir | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/resources/features/NestedSubAccessTester.fir b/src/test/resources/features/NestedSubAccessTester.fir new file mode 100644 index 00000000..83a5ab9b --- /dev/null +++ b/src/test/resources/features/NestedSubAccessTester.fir @@ -0,0 +1,29 @@ +circuit NestedSubAccessTester : + module NestedSubAccess : + input foo : UInt<1>[4] + input index : UInt<2> + output out : UInt<4> + + wire vec : UInt<4>[2] + vec[0] <= UInt(3) + vec[1] <= UInt(4) + + out <= vec[foo[index]] + + module NestedSubAccessTester : + input clk : Clock + input reset : UInt<1> + + inst dut of NestedSubAccess + + dut.foo is invalid + dut.index <= UInt(2) + dut.foo[2] <= UInt(1) + + when neq(dut.out, UInt(4)) : + printf(clk, not(reset), "Assertion failed\nTest Failed!\n") + stop(clk, not(reset), 1) + else : + stop(clk, not(reset), 0) + + |
