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
Verilator supports assert but not assume #1269
Comments
Original Redmine Comment That patch didn't come through properly. Here it is in code, and as an attached file.
Dan |
Original Redmine Comment Good point. The catch is if a user misuses the statement they might get errors like "Unexpected assert" instead of "Unexpected assume" which will be confusing. So, would you mind making a new patch which returns yASSUME, then duplicate the verilog.y rules that use yASSERT to "or"-in yASSUME rules. Also, please add a test case - you can duplicate a line in one of the existing test_regress tests. Thanks. |
Original Redmine Comment Ok, sure and (hopefully) done. Please consider the attached (updated) patch, Dan |
Original Redmine Comment Perfect, thanks. Fixed in git towards 3.919. |
Original Redmine Comment In 3.920. |
Author Name: Dan Gisselquist
Original Redmine Issue: 1269 from https://www.veripool.org
Original Assignee: Dan Gisselquist
According to the 2004 Accellera specification, section 17.13.2 regarding the assume statement,
Judging by this statement, adding the "assume" capability into Verilator should be as simple as treating it just like the assert() statement. For this reason, I propose the following patch:
diff --git a/src/verilog.l b/src/verilog.l
index c39a930..b1cee6a 100644
--- a/src/verilog.l
+++ b/src/verilog.l
@@ -437,6 +437,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
"always_comb" { FL; return yALWAYS_COMB; }
"always_ff" { FL; return yALWAYS_FF; }
"always_latch" { FL; return yALWAYS_LATCH; }
"assert" { FL; return yASSERT; }
"bind" { FL; return yBIND; }
"bit" { FL; return yBIT; }
The text was updated successfully, but these errors were encountered: