-
Notifications
You must be signed in to change notification settings - Fork 917
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
smt2: abits must be min 1 #3797
Conversation
We do have a pass That issue can also be avoided by running I would slightly prefer requiring I haven't run into any zero-width signals/memories so far (is that even possible with the verilog frontend?) so I might also be missing some downsides of my proposed alternatives. |
This is kinda essentially what this PR does anyway — I'm forcing a minimum of 1 (which means it uses a 1-length bitvector for the address line) and then always using I've investigated trying this instead, and you know what? It works perfectly, and does exactly what I was trying to do here but with that much less code. Because Lines 375 to 381 in 8b2a001
I've tested this with my test cases, and the generated logic is the same as this PR currently is (modulo slightly different comments), and it works correctly: (define-fun |in_fifo_m:R0A storage| ((state |in_fifo_s|)) (_ BitVec 1) #b0) ; 1'0
; ...
(define-fun |in_fifo_m:W0A storage| ((state |in_fifo_s|)) (_ BitVec 1) #b0) ; 1'0 Given how simple this fix is, and how the code seems to already anticipate(/expect!) it with the zero-padding already being done, I'm inclined to suggest this is probably the fix. I'm not sure if
I'm a bit of a noob so take my observations with a grain of salt, but quite possibly not! The ultimate cause of this is a |
BitVecs need a minimum length of 1; we zero-fill any extra bits in the extend_u0() calls which works perfectly.
68e7877
to
c9d31c3
Compare
I've force-pushed this PR to have the suggested fix; it's at least strictly better than what it was. |
Fixes #2577.
I first explored trying to do away with the address line related stuff entirely here, changing the state from
(Array (_ BitVec <abits>) (_ BitVec <width>))
to just(_ BitVec <width>)
where abits == 0, drop the unnecessary(select ...)
and(store ...)
etc., but then ran into trouble where smtbmc interacts with related entities.It would be neater to use a single-member sort for the key (is there a "Unit" equivalent?) instead of
(_ BitVec 1)
where we only use the#b0
index and not#b1
, but this does get things working with minimally invasive changes.Tested with regular stat,
--stdt
, and--stbv
; it looks like there's another latent stbv bug (probably similar to #525) I noted while testing. I think it's because wemakebits()
for the "#final" memstate variant at both lines 1245 and 801.