-
Notifications
You must be signed in to change notification settings - Fork 228
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
hpmevent_cfg_t fails synthesis for hpm_num=0 #801
Comments
There is some redundancy in the HPM's ISA extension configuration:
The HDL codes does not check this at all points.
This would fix the issue. But I think it would be cleaner to add further if/else and if-generate statements to catch the corner case
I'll try to come up with a fix for this 😉 Thanks for finding this design flaw! |
No worries will run the fix through proto-synthesis Monday :) This is all part of "maturing" the core, finding all the little things :) @stnolting the issue this cause some odd behavior from synthesis. We learned a few things.
So for synthesis I, at least, would recommend to just keep the files in dependency order. I know FPGA tools can auto-reorder, and tools should do that in general. Buuut if something like this pops out, some tools (no one shamed here) really go off the rails. |
👍 🎉
This is really a problem... Simulators like GHDL and Questa Sim are quite good at detecting the right compile order by themselves. Synthesis is a little bit more complex. Quartus has absolutely no problems, Xilinx is sometimes a little bit picky and Lattice is... well... you really have to hold its hand all the time 😅 I have no idea how good/bad ASIC tools like Cadence can handle this. I like the cleaner concept of entity instantiation, but maybe we should go back to component instantiation to keep the setup burden low (for beginners)??? 🤔 |
I would keep using entity instantiation, its the way to go if I'm honest. When I coded VHDL for $$ from '99 to '07 we never used components and no tools had any issues with. The one caveat was we typically wrote our own dependency checker script, as make couldn't figure out vhdl dependency at the time. This is what the simulators basically do today, read in the files -> pre-compile -> determine dependency -> re-order in memory -> re-compile. I will withhold any comments on Lattice :) Suffice to say that FPGA tools, from all vendors, have... historically been... not amazing. E.g. to build with vhdl+verilog I'm using Synplify as Vivado just hangs. With ASIC tools I would let the implementer deal with it for now. In ASIC land we use .f files for reading in files both simulation and synthesis. Everyone basically writes up their own <please read in these files "list"> files, so having to manually reorder isn't an issue as right. Any ASIC person that wants to use the core would have to type up their own .f file anyways. We could help by just adding a set of .f files in the rtl directory that had the recommended compile order, which could then be used. The use of .f files allows ASIC teams to utilize IP based flows where design blocks, like the core, comes with a .f file that users read in with their readhdl commands. That .f file has the list of files and potentially pointer to other .f files. |
Yeah, let's keep it then ;)
Radiant comes with build-in Synplify Pro, which a quite amazing tool I have to say.
I really like this idea! We should definitely add this to the rtl folder. |
Describe the bug
The definition of the array results in a 3 to 2 index when hpm_num is set to 0 when hpm counters are disabled.
The fix is to not subtract 1, which should be the default case I believe.
Same issue is part of the generate for loop, except the generate statement is disabled in this particular corner case.
To Reproduce
Found during synthesis where VHDL elab fails
Expected behavior
NA
Screenshots
NA
Environment:
Hardware:
Additional context
NA
The text was updated successfully, but these errors were encountered: