Skip to content

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

Open

Description

@qgzln

How to generate a case statement for state machine with chisel3

Activity

  1. schoeberl commented on Sep 17, 2019

    @schoeberl
    Member

    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

  2. qgzln commented on Sep 20, 2019

    @qgzln
    Author

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions