From c69b16e3b7db132273805d3a75ba9b33ec74eafd Mon Sep 17 00:00:00 2001 From: jackkoenig Date: Wed, 6 Apr 2016 16:16:07 -0700 Subject: Add small test for issue #105 --- .../resources/features/NestedSubAccessTester.fir | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/test/resources/features/NestedSubAccessTester.fir (limited to 'src/test/resources/features/NestedSubAccessTester.fir') 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) + + -- cgit v1.2.3