-
Notifications
You must be signed in to change notification settings - Fork 531
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
Preliminary unpacked support for localparam #501
base: master
Are you sure you want to change the base?
Conversation
Sorry for the slow response. I was hoping Steve would have time to look at it, as he's the authority on architectural matters. Could you explain why you have chosen to add IVL_VT_UARRAY. Currently unpacked arrays are handled as special cases of the base types, so this is a significant architectural change. |
Hello, thanks for the comment. No problem for the time, it's not an urgent issue at all. To be honest, I started implementing this at the same time as I learnt how iverilog was built internally. I remember having issue at first when trying to do it without the new UARRAY type, but it might as well be because of my low level of understanding of the code base. I can't rembember what it was. I will try again without the new type, now that I understand things better, at least to be able to explain why the UARRAY if I still need it, or to provide a new way without it (which would definitely be better, I agree). |
I don't want to discourage you from proposing architectural changes if they make it easier to add new features. Design decisions made before SystemVerilog existed may not be the best now. |
5a97ae7
to
d0564d6
Compare
I removed the new type. It turns out it was useless, and I find it much better this way. It implies a lot less modifications. I'm writing an associated test for that (I already have one, I'm only trying to add cases and check that it's really working). |
Unfortunately this crashes on a design accepted by Vivado. iverilog -g2009 -o lpa_tc lpa_tc.v |
What I see while debugging is:
being processed as:
Notice that expr_width is 1. Tracing the code a bit I see:
ending up in:
where the width is explicitly set to 1. The attached patch passes a quick |
Here's another test case which produces a slightly different crash:
debug shows:
|
Give me a week or so and I'll try to help. I have been swamped at work for most of the last year, but it looks like things may slow down a bit soon. |
That's fine.
The failure shows up as:
|
What I see while debugging is:
being processed as:
Notice that NCOEFF['sd0] has been replaced by the entire contents of NCOEFF, rather
when given NCOEFF['sd0] returns the array rather than the requested entry. The attached patch is a simplified version of what's present in:
and passes a quick smoke test, however I have no idea if it's correct or the best solution. |
9728397
to
0dc8596
Compare
Is this pull request still active? I used this in some projects so I am willing to put some time towards getting this feature into shape for inclusion into a future release if someone can guide me on what needs to happen. |
Hi, given the time that has passed since this PR was opened, I believe the original author will not complete it. Pinging @martinwhitaker and @caryr since both commented on this PR, maybe one of you has some time to guide jlwehle. |
As we definitely need this in our projects, I've started working on addition of unpacked array support initialization.
This is a first try at doing this for localparam only, to see how it goes. I've been focusing on "getting it to work", and thus a lot of things need to be added. At least, the vpi_draw and t-dll file must be updated to take the new uarray into accounts.
However, I would really like to contribute this to the project if you're interested, and thus I want to discuss how I did this before going further. So here is a draft pull request with a skeleton of how I have done it.
As this is my first meaningful modification of Icarus source code, I would really appreciate any feedback you can give, on the design choices or on the coding style, or on whole parts of the code I missed. I will do my best to answer them and to modify the code.
I have small tests I added manually to ivtest, I can push them on a separate PR if you want.