Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undeclared _FSM reg breaks sequence #29

Open
kevinmehall opened this issue Dec 31, 2016 · 2 comments
Open

Undeclared _FSM reg breaks sequence #29

kevinmehall opened this issue Dec 31, 2016 · 2 comments

Comments

@kevinmehall
Copy link

With the sequence.hdl example, the _FSM variable in the generated Verilog is never declared, so it defaults to a 1-bit wire. This results in it toggling between two states instead of going through the whole sequence. I added a reg [2:0] _FSM = 0; to the generated Verilog and it behaved as expected.

@tcr
Copy link
Owner

tcr commented Jan 1, 2017

Thanks for catching that @kevinmehall. I snuck some changes into a patch version bump that broke any sequence examples—so I just released 0.5.0 which should fix it.

A __FSM_1 (and 2, etc.) variable should be auto-generated for any fsm or sequence struct now, e.g.

reg [(3)-1:0] __FSM_1 = 0;
...
case (__FSM_1)
  0: begin
    rot <= 1;
    __FSM_1 <= 5;
  end

@tcr
Copy link
Owner

tcr commented Jan 1, 2017

And happy new year!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants