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

Possible wording fix for error message when an "If" is accidently directly under an FSM. #133

Closed
mithro opened this issue Jul 7, 2019 · 1 comment
Milestone

Comments

@mithro
Copy link

mithro commented Jul 7, 2019

If you do the following;

with m.FSM() as fsm:
  with m.If(~self.i):
    pass

You get the following error;
nmigen.hdl.dsl.SyntaxError: If is not permitted inside of FSM

I feel like this is slightly misleading because an If is permitted inside an FSM - --just not directly. The following is perfectly valid;

with m.FSM() as fsm:
  with m.State("START"):
    with m.If(~self.i):
      pass

I would suggest the error would be slightly better if it said something like;
nmigen.hdl.dsl.SyntaxError: If() is not permitted directly under an FSM.

It would also be nice if you mentioned what was permitted directly under an FSM -- maybe something like;
nmigen.hdl.dsl.SyntaxError: If() is not permitted directly under an FSM. Only State() is permitted.

@mithro
Copy link
Author

mithro commented Jul 7, 2019

Fix looks good to me! Thank you.

Sorry, something went wrong.

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

No branches or pull requests

2 participants