-
Notifications
You must be signed in to change notification settings - Fork 904
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
BUG:Issue in Yosys Synthesis: 'std::length_error' Leads to Termination #4160
Comments
Introduced in #3883. This is happening in Separately, we should probably add |
I think I figured it out, a possible 'fix' is here: But I have some thoughts before actually doing anything about it. input wire signed [(5'h12):(1'h0)] wire32;
wire signed [(5'h14):(1'h0)] wire35;
assign wire35 = {wire32};
assign wire66 = ((^$unsigned($signed((wire31 ? wire31 : wire33)))) ?
{($unsigned({wire32}) >> $signed((wire35 + (8'hb5))))} : wire31[(2'h2):(2'h2)]);
The reason I did not handle this case before is because I feel like something like this is likely unintended behavior of the RTL (ie faulty RTL).
@DeLoSoCode I would make sure the implemented function is actually what you intend it to do. The above code is currently equivalent to this: assign wire66 = ( ^($signed((wire31 ? wire31 : wire33)) ) ? '0 : wire31[2]; I assume this is generated but I would still go over the section generating the constant offset |
Thank you! For context, we've had a couple of these reports before and this is fuzzer-generated code, @DeLoSoCode is working on a paper on finding bugs in EDA tools (there's some description on their profile and repo). The generated code is a bit hard to work with but has been finding valid issues. I think this is probably unlikely enough to be intended that a warning is justified. Not sure if "always shifted out" is clear enough for people who don't have context, maybe something along the lines of "result of shift operation is always constant" along with some detail of operands and source line number of the shift operator? |
The wording definitely needs work and I like the idea of adding the file and line number. |
You can use (There's also |
Before this issue is closed, are there any plans to add DeLoSo as its own test run or should this be added to the shiftadd/shiftmul tests to avoid regressions? |
Not sure what you mean there. Do you mean if we should make a test out of the code posted with this issue? I think adding something minimal to |
I was refering to:
Maybe you want to use DeLoSo and run the generated-code directly as tests against yosys instead of adding each thing it may find separately. I definitely think it should be added as a test case and I am not against adding it to |
No, we don't actually know anything about the project aside from what it says on the github page (they've never replied to any enquiries/issue comments), so we have no idea how to run those tools or how mature they are. But in general I would expect running a fuzzer is not compatible with the CI environment, just in terms of execution time needed for useful coverage... |
@phsauter Ah, I wasn't aware DeLoSo is the name of the tool: https://github.com/DeLoSoCode/DeLoSo |
Version
yosys 0.35+56
On which OS did this happen?
Linux
Reproduction Steps
Hello,
While undergoing the synthesis procedure using Yosys, I encountered a complication when processing the design file (rtl.v). The execution of the read_verilog rtl.v command resulted in an error, as indicated in the provided screenshot. This issue arose during the optimization and synthesis phases of the design using Yosys tools. Specifically, the error pertained to a 'std::length_error,' causing the termination of the synthesis process.
![image](https://private-user-images.githubusercontent.com/49134118/299508142-2757a8e7-4a50-494d-9a8b-43c54c62630d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNzQxNDksIm5iZiI6MTczOTA3Mzg0OSwicGF0aCI6Ii80OTEzNDExOC8yOTk1MDgxNDItMjc1N2E4ZTctNGE1MC00OTRkLTlhOGItNDNjNTRjNjI2MzBkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDA0MDQwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg5ZDRkMzVmMjc5YzkwZDkyMzYxZWIxZGM1ZTcxNThkOWU2NmM3Nzk4YmRjYzk0YzI3NjA5ZmVjYTA1MDg4NGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.C8R8-xO5vUK6fEsg1UJY5FWn_vT61JiltrEw3nck8IM)
Synthesis processes as follows:
read_verilog rtl.v
synth
write_verilog syn_yosys.v
Please find attached the code of RTL .
Thank you in advance for your attention to this matter.
I look forward to hearing from you regarding this issue.
yosys_project_01.zip
Expected Behavior
synthesis success
Actual Behavior
synthesis fail
The text was updated successfully, but these errors were encountered: