chisel-tutorial icon indicating copy to clipboard operation
chisel-tutorial copied to clipboard

why the code of VendingMachineSwitch.scala in the tutorial generate if-else statement instead of case statement

Open qgzln opened this issue 6 years ago • 2 comments
trafficstars

How to generate a case statement for state machine with chisel3

qgzln avatar Sep 16 '19 06:09 qgzln

You need to include chisel3.util._ and use a switch. See an example here: https://github.com/schoeberl/chisel-book/blob/master/src/main/scala/SimpleFsm.scala

schoeberl avatar Sep 17 '19 14:09 schoeberl

Thank you for your reply.It is my fault.I didn't make it clear, I mean there is no case in the generated Verilog statement, I usually use the case when writing the state machine with Verilog. So, chisel3 still can not generate Verilog code with case?

qgzln avatar Sep 20 '19 03:09 qgzln