diff options
| author | grebe | 2017-01-19 09:12:13 -0800 |
|---|---|---|
| committer | Adam Izraelevitz | 2017-01-19 09:12:13 -0800 |
| commit | b0623fe1856caeba11cda1ccaf68f094489169a7 (patch) | |
| tree | 38b1c247c9a3a51ca0a824eac1248933df2a2a69 /src/test | |
| parent | 8a1cdf15d131e086ddc9de6bfe8cd90ed7fb3eb7 (diff) | |
Verilog rem fix (#404)
* Add pass that fixes up widths with modulus operator for verilog
* Add basic test for Verilog emission of Rem
* Oops, left in some printlns.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/scala/firrtlTests/VerilogEmitterTests.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/VerilogEmitterTests.scala b/src/test/scala/firrtlTests/VerilogEmitterTests.scala index 39592269..41fd6e41 100644 --- a/src/test/scala/firrtlTests/VerilogEmitterTests.scala +++ b/src/test/scala/firrtlTests/VerilogEmitterTests.scala @@ -74,4 +74,25 @@ class DoPrimVerilog extends FirrtlFlatSpec { |""".stripMargin.split("\n") map normalized executeTest(input, check, compiler) } + "Rem" should "emit correctly" in { + val compiler = new VerilogCompiler + val input = + """circuit Test : + | module Test : + | input in : UInt<8> + | output out : UInt<1> + | out <= rem(in, UInt<1>("h1")) + |""".stripMargin + val check = + """module Test( + | input [7:0] in, + | output out + |); + | wire [7:0] _GEN_0; + | assign out = _GEN_0[0]; + | assign _GEN_0 = in % 8'h1; + |endmodule + |""".stripMargin.split("\n") map normalized + executeTest(input, check, compiler) + } } |
