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

Issue with $clog2 of a parameter #256

Closed
flaviens opened this issue Oct 30, 2023 · 3 comments
Closed

Issue with $clog2 of a parameter #256

flaviens opened this issue Oct 30, 2023 · 3 comments

Comments

@flaviens
Copy link

flaviens commented Oct 30, 2023

Hi there!
I'm trying to pass the EL2 core through Yosys. sv2v works without error, but yosys is then complaining about $clog2 of a parameter. It seems that the parameter disappears during sv2v, but I'm not very confident about that. I tried a slightly older sv2v version (10-29) and the newest, without it making any difference.

Here is a pickle ready to be consumed by sv2v.
el2_pickle.zip

Generating RTLIL representation for module `$paramod$2bdb596ed0b0d0fd78c36713ac2804f44d511569\el2_lsu_dccm_mem'.
generated/sv2v_out.v:38018: ERROR: Failed to evaluate system function `\$clog2' with non-constant value.        

Could you please have a quick look?
I'm at your disposal, may you have any question.
Thank you very much!
Flavien

@zachjs
Copy link
Owner

zachjs commented Nov 2, 2023

I have an idea what's going on here, but I'll need some time. I intend to take a closer look this weekend.

@zachjs
Copy link
Owner

zachjs commented Nov 4, 2023

The $clog2 was actually unrelated. sv2v saw a pattern field name and thought it referred to a localparam defined further down due some extra indirection. This is closely related to #255. I've added logic to distinguish the typenames in struct patterns in a4639fa. Please let me know if it works for you. The converted output seems right to me, but I now believe you'll run into an unrelated Yosys limitation: YosysHQ/yosys#668.

This test case was very useful. Thank you very much for filing this issue!

@flaviens
Copy link
Author

flaviens commented Nov 5, 2023

Hi Zach, thank you so much for your reactivity! This indeed seems to resolve the problem! ❤️
As you mentioned, we run into YosysHQ/yosys#668, although for this specific purpose, it is easier to adapt the source code syntax.
Thanks!

@flaviens flaviens closed this as completed Nov 5, 2023
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