clifford changed the topic of #yosys to: Yosys Open SYnthesis Suite: http://www.clifford.at/yosys/ -- Channel Logs: https://irclog.whitequark.org/yosys
togo has quit [Quit: Leaving]
futarisIRCcloud has joined #yosys
AlexDaniel has joined #yosys
lutsabound has quit [Quit: Connection closed for inactivity]
AlexDaniel has quit [Ping timeout: 246 seconds]
emeb has left #yosys [#yosys]
emeb_mac has joined #yosys
PyroPeter has quit [Ping timeout: 250 seconds]
PyroPeter has joined #yosys
rohitksingh_work has joined #yosys
gsi__ has joined #yosys
gsi_ has quit [Ping timeout: 250 seconds]
proteusguy has joined #yosys
gsi__ is now known as gsi_
leviathanch has joined #yosys
bpye has joined #yosys
<bpye> Hey, could anyone look at this tiny example: https://gist.github.com/benpye/2fc36cf4555d24c47ff7eebecfac5f78 - I'm not sure why the inductive formal proof is failing
<tpb> Title: min.v · GitHub (at gist.github.com)
<bpye> Wait try https://gist.github.com/benpye/008009e97f54d732e689bada85e227fe I've included the sby file
<tpb> Title: min.sby · GitHub (at gist.github.com)
<bpye> I realise it's a slightly silly assertion in a way, I just can't work out why it's failing
<bpye> Ah, it's because next_counter is combinatorial?
<emeb_mac> why not use $past(next_counter) ?
<bpye> How can I get that to work with the clock enable?
<bpye> Maybe I'm missing something :)
<emeb_mac> also, your assertion is keying of f_past_valid = 0, so it's trying to run on the first clock cycle
<emeb_mac> and f_past_next_counter isn't assigned then
<bpye> Huh, shouldn't '~f_past_valid' be NOT f_past_valid, sorry, my verilog is rusty
<emeb_mac> are you making any assumptions about i_clk_en?
<emeb_mac> and have you looked at the .vcd trace to see what's failing?
<bpye> No assumptions about i_clk_en
<bpye> My traces all show f_past_valid starting 1 which is confusing me
<emeb_mac> yeah
<emeb_mac> I don't like the way you're setting counter and f_past_valid in their declarations.
<emeb_mac> I've never seen that syntax before
<emeb_mac> I'd suggest using an initial statement to set those.
<bpye> splitting it to an initial block unfortuantely makes no difference
<emeb_mac> also you're not setting an initial value for f_past_next_counter so it could be anything and definitely not equal to counter when the assert runs.
<bpye> But f_past_valid should equal zero if f_past_next_counter has yet to be set, I believe
<emeb_mac> what exactly is your assertion trying to prove?
<emeb_mac> and you're not wrapping the clauses inside the assert with () so are you sure of the order of operations?
<bpye> This is just a minimal example, I hit this in a more complex testbench
<bpye> Trying to ensure that the state is moved correctly
<emeb_mac> well, I'm a newb @ formal so I'm not much help here. Perhaps ping ZipCPU about it when he's around.
<emeb_mac> but I see a lot of stuff here that I'd do differently based on the class I took.
<bpye> Yeah, I did take a class on formal verification as an undergrad but we covered SVA so I would have never written code like this anyway, sadly I don't have a Verific license
<bpye> Hm, it does seem that i simply need to constrain it further, using abc pdr rather than smtbmc does result in a sucessful proof
emeb_mac has quit [Ping timeout: 250 seconds]
proteusguy has quit [Ping timeout: 245 seconds]
kraiskil has joined #yosys
proteusguy has joined #yosys
m4ssi has joined #yosys
SpaceCoaster has quit [Ping timeout: 245 seconds]
kraiskil has quit [Ping timeout: 250 seconds]
wifasoi has joined #yosys
leviathanch has quit [Remote host closed the connection]
MoeIcenowy has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
MoeIcenowy has joined #yosys
SpaceCoaster has joined #yosys
mirage335 has quit [Ping timeout: 252 seconds]
proteusguy has quit [Remote host closed the connection]
mirage335 has joined #yosys
rohitksingh_work has quit [Ping timeout: 250 seconds]
rohitksingh_work has joined #yosys
develonepi3 has quit [Remote host closed the connection]
<ZipCPU> bpye: Were you having problems with BMC (i.e. was FAIL the result) or with the induction step (i.e. was UNKNOWN the result)?
<ZipCPU> Without trying your example myself, my guess would be that this is what's going on: http://zipcpu.com/blog/2018/03/10/induction-exercise.html
<tpb> Title: An Exercise in using Formal Induction (at zipcpu.com)
<ZipCPU> Ok, I just tried it ... the result was "UNKNOWN"
<ZipCPU> The problem is the assertion regarding (~f_past_valid || counter == f_past_next_counter); If you move this assertion outside of the i_clk_en if block, then the design passes
<ZipCPU> The problem is specifically that clk_en, and the fact that you are not saying anything about what counter and f_past_next_counter must be when clk_en is false
leviathanch has joined #yosys
<ZipCPU> Therefore the solver is setting this value false for all but the third to the last cycle. During the first several cycles, f_past_next_counter doesn't match counter--because this is induction and assertions are required to get you into a valid state.
<ZipCPU> Then, on the third to the last cycle, the solver raises i_clk_en. To make this design fail, this must be the case. On the second to the last cycle the assertion is now checked. It fails, because the design was allowed to get into an illegal state, not because the design would've failed.
<ZipCPU> A better assertion, such as moving the counter == f_past_next_counter outside the if (i_clk_en) would fix this problem, since it would keep the solver from starting with an illegal state.
develonepi3 has joined #yosys
lutsabound has joined #yosys
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
rohitksingh_work has quit [Read error: Connection reset by peer]
AlexDaniel has joined #yosys
emeb_mac has joined #yosys
rohitksingh has joined #yosys
maikmerten has joined #yosys
emeb_mac has quit [Ping timeout: 245 seconds]
rohitksingh has quit [Ping timeout: 245 seconds]
lutsabound has quit [Quit: Connection closed for inactivity]
rohitksingh has joined #yosys
rohitksingh has quit [Ping timeout: 272 seconds]
rohitksingh has joined #yosys
rohitksingh has quit [Ping timeout: 246 seconds]
leviathanch has quit [Remote host closed the connection]
MoeIcenowy has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
MoeIcenowy has joined #yosys
rohitksingh has joined #yosys
rohitksingh has quit [Ping timeout: 255 seconds]
m4ssi has quit [Remote host closed the connection]
tlwoerner has quit [Quit: Leaving]
tlwoerner has joined #yosys
leptonix has joined #yosys
tmbinc2 has quit [Ping timeout: 250 seconds]
leptonix has quit [Quit: leaving]
develonepi3 has quit [Remote host closed the connection]
mrsteveman1 has joined #yosys
shorne has quit [Ping timeout: 245 seconds]
leptonix has joined #yosys
leptonix has quit [Client Quit]
leptonix has joined #yosys
maikmerten has quit [Quit: Ex-Chat]
togo has joined #yosys
leptonix has quit [Ping timeout: 255 seconds]
leptonix has joined #yosys
leptonix has quit [Ping timeout: 244 seconds]
leptonix has joined #yosys
develonepi3 has joined #yosys
togo has quit [Quit: Leaving]
emeb_mac has joined #yosys
tpb has quit [Remote host closed the connection]
tpb has joined #yosys