-
Notifications
You must be signed in to change notification settings - Fork 44
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
Spyglass issues with PeakRDL's CSR generated RTL #87
Comments
Can you also share which synthesis tool is reporting this issue, and which version? In-scope initial assignments to automatic variables are synthesizable in all modern tools I have used, so this is a bit surprising. |
I am using spyglass for linting and synthesis |
Thanks. I have had very poor results from Spyglass in the past, so I am not surprised that it is flagging a warning here. Spyglass's support for even basic SystemVerilog concepts is pretty limited and often very buggy. Design Compiler uses a different analysis back-end and is generally far better. I would recommend waiving the Spyglass warning messages you shared since they are not valid in this situation (And report the issue to Solvnet, since this is a bug in Spyglass). I have compiled similar RTL using Design Compiler, and have found no warnings or errors with this code. Since unfortunately Spyglass is still a very popular tool in the industry, I may still change how the assignments are made to avoid the limitation in Spyglass. Your initial question mentioned there are Error messages as well, but you only shared Warning messages. Are there additional errors you have not shared yet? |
@amykyta3 the errors are related to reserved namespace. `[5] ReserveName ERROR Error regblock/aps_csr.sv 117 10 Reserved name 'next' used [29] ReserveName ERROR Error regblock/mps_crtbcam_csr.sv 108 10 Reserved name 'next' used [24] ReserveName ERROR Error regblock/mps_field_offset_extractor_csr.sv 110 10 Reserved name 'next' used [1F] ReserveName ERROR Error regblock/mps_hdoffset_extractor_csr.sv 110 10 Reserved name 'next' used [34] ReserveName ERROR Error regblock/mps_hdr_buf0_crdts_csr.sv 104 10 Reserved name 'next' used` |
That is very strange. Is it possible that your organization is configuring Spyglass to flag additional reserved keywords beyond what is specified by the SystemVerilog LRM? According to the official language spec, Also, can you share which specific version of Spyglass you are using? |
SpyGlass Version : SpyGlass_vV-2023.12 |
I see what is happening now. Looking at the SolvNet docs, I see that the
It seems that your Spyglass lint policy is configured to flag SystemVerilog code that contains VHDL keywords. Since the generated SystemVerilog code is still inherently correct, I am marking this issue as invalid. Both issues reported are problems with the Spyglass tool. |
Ahan, |
The Simulation vs. Synthesis hazard around initialized variables in ASIC design is a valid concern. Synthesis tools (Including DC/FC) will ignore the initial value of the variable, but in simulation we will see this initial assignment. Is it worth restructuring the code to something like below? This will reduce the need to carry forward waivers. automatic logic [4:0] next_c; |
Regarding initial values, it really depends on the situation since not all initial assignments are created equal. I have seen some 3rd party ASIC IP use initial assignments to non-flop signals as a way to define constants (legacy style before localparams were widely supported). Nonetheless, I completely agree that a simple change would be to move the assignment to a new statement to avoid lint noise from Spyglass. Since Spyglass is still a very popular tool in the industry, I will make the change you suggested. |
I am attaching the list of sample errors list here
Generated CODE:
`
always_comb begin
automatic logic [4:0] next_c = field_storage.CSR_MAC_ADID[i0].csr_mac_adid.value;
automatic logic load_next_c = '0;
if(decoded_reg_strb.CSR_MAC_ADID[i0] && decoded_req_is_wr) begin // SW write
next_c = (field_storage.CSR_MAC_ADID[i0].csr_mac_adid.value & ~decoded_wr_biten[4:0]) | (decoded_wr_data[4:0] & decoded_wr_biten[4:0]);
load_next_c = '1;
end
field_combo.CSR_MAC_ADID[i0].csr_mac_adid.next = next_c;
field_combo.CSR_MAC_ADID[i0].csr_mac_adid.load_next = load_next_c;
end`
ERRORS:
`######### BuiltIn -> RuleGroup=Design Read
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ID Rule Alias Severity File Line Wt Message
======================================================================================
[53] SYNTH_89 SYNTH_89 SynthesisWarning /home/azeem/ares/output/gen/regs/regblock/mps_adid_sel_csr.sv 168 1000 Initial Assignment at Declaration for ( load_next_c ) is ignored by synthesis
[55] SYNTH_89 SYNTH_89 SynthesisWarning /home/azeem/ares/output/gen/regs/regblock/mps_adid_sel_csr.sv 189 1000 Initial Assignment at Declaration for ( load_next_c ) is ignored by synthesis`
The text was updated successfully, but these errors were encountered: