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

Records with 0 fields generate invalid verilog #41

Open
nakengelhardt opened this issue Mar 17, 2016 · 4 comments
Open

Records with 0 fields generate invalid verilog #41

nakengelhardt opened this issue Mar 17, 2016 · 4 comments

Comments

@nakengelhardt
Copy link
Contributor

When defining a record with no fields, as in
_layout = []
and then using raw_bits(), it will generate invalid verilog, e.g.:
assign {} = x;

@jordens
Copy link
Member

jordens commented Mar 17, 2016

Should it silently drop logic related to the Record or should it error?

@nakengelhardt
Copy link
Contributor Author

Silently drop would be the preferred solution in my case, since I use it to build generic logic where the contents of the Record change with the application (and some simply don't need extra data).

@jordens
Copy link
Member

jordens commented Mar 17, 2016

Hmm. That might lead to tough questions if the Record (or its raw_bits()) is used in expressions. What's the boolean of a zero length signal? Can it be signed? How does it extend? If you drop a zero length signal from an expression and nothing is left, do you drop entire assignment? It might need to be an error.

jordens added a commit to jordens/migen that referenced this issue Jun 21, 2017
* this might be debatable
* may be relevant to m-labs#41
@whitequark
Copy link
Contributor

Triage: fixed in nMigen, where 0-bit signals are explicitly valid.

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

3 participants