diff options
| author | Adam Izraelevitz | 2016-02-24 20:36:47 -0800 |
|---|---|---|
| committer | jackkoenig | 2016-02-24 22:40:28 -0800 |
| commit | 5901c57caab635c0d5c1a7ac6502ea7872f44001 (patch) | |
| tree | 3aca2dcaa8b1fe90bc1ae0bfcfbda1d5f6d9c0fe /test | |
| parent | ae40fe404805dd62dfc04061b7091b1095aa8877 (diff) | |
Fixed printf bugs in scala and stanza versions. Required special casing prints in SplitExp, and emitting expressions instead of their toString counterparts
Diffstat (limited to 'test')
| -rw-r--r-- | test/passes/split-exp/print-args.fir | 14 | ||||
| -rw-r--r-- | test/passes/to-verilog/print-args.fir | 25 |
2 files changed, 39 insertions, 0 deletions
diff --git a/test/passes/split-exp/print-args.fir b/test/passes/split-exp/print-args.fir new file mode 100644 index 00000000..df21949d --- /dev/null +++ b/test/passes/split-exp/print-args.fir @@ -0,0 +1,14 @@ +; RUN: firrtl -i %s -o %s.v -X verilog -p c 2>&1 | tee %s.out | FileCheck %s + +; CHECK: Split Expressions +; CHECK: node GEN_0 = and(a, b) +; CHECK: printf(clk, UInt<1>("h1"), "%d\n", GEN_0) + +circuit Bug : + module Bug : + input clk : Clock + input a : UInt<1> + input b : UInt<1> + + printf(clk, UInt<1>(1), "%d\n", and(a, b)) + diff --git a/test/passes/to-verilog/print-args.fir b/test/passes/to-verilog/print-args.fir new file mode 100644 index 00000000..f0344366 --- /dev/null +++ b/test/passes/to-verilog/print-args.fir @@ -0,0 +1,25 @@ +; RUN: firrtl -i %s -o %s.v -X verilog ; cat %s.v | FileCheck %s + +;CHECK: module Bug( +;CHECK: input clk, +;CHECK: input a, +;CHECK: input b +;CHECK: ); +;CHECK: wire GEN_0; +;CHECK: assign GEN_0 = a & b; +;CHECK: always @(posedge clk) begin +;CHECK: `ifndef SYNTHESIS +;CHECK: if(1'h1) begin +;CHECK: $fwrite(32'h80000002,"%d\n",GEN_0); +;CHECK: end +;CHECK: `endif +;CHECK: end +;CHECK: endmodule + +circuit Bug : + module Bug : + input clk : Clock + input a : UInt<1> + input b : UInt<1> + + printf(clk, UInt<1>(1), "%d\n", and(a, b)) |
