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

casting to a vector of a given width not working properly #2618

Open
jeras opened this issue Oct 17, 2024 · 2 comments
Open

casting to a vector of a given width not working properly #2618

jeras opened this issue Oct 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jeras
Copy link

jeras commented Oct 17, 2024

Using the git version of synlig. The sources and scripts to reproduce the problem are in the linked folder.

https://github.com/jeras/synthesis-primitives/tree/main/bugreport/yosys/techmap_ha

Seems synlig is not performing the casting of a single bit or an integer to a 16 bit vector.
The issue can be seen in the generated proc.svg files.

In the single bit ena signal, the vector should be 16 bit, but is instead a single bit.

cnt <= cnt + WIDTH'(ena);

In the case of the integer 1, the vector should be 16 bit, but is instead 32 bit.

cnt <= cnt + WIDTH'(1);

Yosys built in SystemVerilog support is processing this correctly.

@tgorochowik
Copy link
Member

Thank you for the report!

@tgorochowik tgorochowik added the bug Something isn't working label Oct 18, 2024
@jeras
Copy link
Author

jeras commented Oct 22, 2024

I did not test this yet (or checked the Verilog standard), but if there was no casting to WIDTH in the RHS, than the signal ena and the decimal constant 1 should probably be cast to the LHS width (width of cnt).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants