clifford changed the topic of #yosys to: Yosys Open SYnthesis Suite: http://www.clifford.at/yosys/ -- Channel Logs: https://irclog.whitequark.org/yosys
pie_ has joined #yosys
pie_ has quit [Ping timeout: 248 seconds]
lutsabound has quit [Quit: Connection closed for inactivity]
dh73 has joined #yosys
dh73 has quit [Quit: Leaving.]
_whitelogger has joined #yosys
_whitelogger has joined #yosys
emeb_mac has quit [Quit: Leaving.]
Twix has quit [Ping timeout: 265 seconds]
Jybz has joined #yosys
kraiskil has quit [Ping timeout: 258 seconds]
_whitelogger has joined #yosys
_whitelogger has joined #yosys
kraiskil has joined #yosys
kraiskil has quit [Ping timeout: 258 seconds]
kraiskil has joined #yosys
_whitelogger has joined #yosys
kraiskil has quit [Ping timeout: 260 seconds]
rombik_su has joined #yosys
kraiskil has joined #yosys
rombik_su has quit [Ping timeout: 265 seconds]
vidbina has joined #yosys
maikmerten has joined #yosys
<maikmerten> it's that season of the year where the blessings of formal verification look particularly bright - finally trying to prove some properties of my designs.
<maikmerten> starting with an ALU
<maikmerten> I find that some checks on combinatorial logic is easier than I thought
<maikmerten> struggling a bit with clocked stuff
<tpb> Title: debian Pastezone (at paste.debian.net)
<maikmerten> ('result' is a reg[31:0] that receives values on posedge)
<maikmerten> s/is easier/are easier
<ZipCPU> maikmerten: I'm not sure that second block checked what you wanted
<ZipCPU> The key issue is the idea of $past() --- you want to assert if I_en was true on one clock cycle and I_aluop == `ALUOP_ADD on that same cycle, then result == I_dataS1+I_dataS2 on the next cycle
<ZipCPU> Or ... am I missing something? 'Cause that's not what you've written
kraiskil has quit [Ping timeout: 265 seconds]
<maikmerten> ZipCPU, yeah, basically if on the preceding posedge I_en was asserted with an ADD-aluop and with values dataS1 and dataS2, then on the current posedge the result should be the sum of the previous input values
<maikmerten> I assume that https://paste.debian.net/1123060/ is a bit closer
<tpb> Title: debian Pastezone (at paste.debian.net)
<maikmerten> (btw, hi!)
<ZipCPU> Yeah ... that's pretty decent. How'd that work out for you?
<ZipCPU> (Hi)
<maikmerten> fails :)
<ZipCPU> Ok, there's a common bug with addition and widths
<ZipCPU> Could it be that I_dataS1 + I_dataS2 requires an extra bit that result doesn't have?
<ZipCPU> A bit that would typically be dropped?
<maikmerten> very possible
<ZipCPU> That is, if you force it to the right number of bits, does it then pass?
emeb has joined #yosys
<maikmerten> okay, truncating doesn't help, but the counterexample was an addition with zero as second operand anyways
<tpb> Title: Pasteboard - Uploaded Image (at pasteboard.co)
<maikmerten> waveform looks as expected, so I guess the asserts are meh
<ZipCPU> So ... what's going on?
<ZipCPU> Can you post your sby file at all?
<ZipCPU> I'm betting that's where the problem is
<ZipCPU> Are you running with either "clk2fflogic" or "multiclock on" in your sby file?
<tpb> Title: debian Pastezone (at paste.debian.net)
<maikmerten> and yes, multiclock, for no particular reason...
<maikmerten> so much copy paste, so little insight ;)
<ZipCPU> Ok, let's take that back out, so remove "multiclock on" and remove any assumptions about your clock within your design. This works if 1) you only have one clock, and 2) you only transition on it's positive edge
<ZipCPU> If you do otherwise, then we'll need to work a little harder
<ZipCPU> Are you using $global_clock in your design at all?
<ZipCPU> If so ... I'd have you remove that as well. (Again, assuming only one continuous clock, and all transitions on its positive edge)
<maikmerten> no $global_clock
<ZipCPU> How about clocks and clock edges? Are you using only the one edge of one clock?
<maikmerten> in that design, I only use posedge I_clk to do stuff
<ZipCPU> Ok, good ... let's keep going with removing "multiclock on" then
<maikmerten> https://github.com/maikmerten/spu32/blob/master/cpu/alu.v <-- currently messing around with that
<tpb> Title: spu32/alu.v at master · maikmerten/spu32 · GitHub (at github.com)
<maikmerten> removing multiclock provides the same counterexample
<ZipCPU> Really? Can you post it again?
<ZipCPU> Also ... does any of your logic use I_clk for anything other than a posedge?
<maikmerten> https://pasteboard.co/INwUyEf.png <-- fresh trace
<tpb> Title: Pasteboard - Uploaded Image (at pasteboard.co)
<ZipCPU> Check I_aluop
<maikmerten> it's constant zero, which is ALUOP_ADD
<ZipCPU> Also be aware, when using a test in a clocked logic block, the error will be one step prior to the final step of the trace. In this case, your error is that the MSB is set.
<ZipCPU> How about I_reset?
<maikmerten> constant zero
<ZipCPU> Hmm ...
<ZipCPU> How old is your Yosys distro?
<maikmerten> git master from ~2 days ago
<maikmerten> but quite frankly, I'll assume I messed up before assuming this really is a yosys thing
<ZipCPU> And your yices distro?
<ZipCPU> ... a not unlikely assumption ...
<maikmerten> Yices 2.6.1
<maikmerten> Copyright Free Software Foundation, Inc.
<maikmerten> Copyright SRI International.
<maikmerten> Linked with GMP 6.1.2
<maikmerten> Build date: 2019-05-17
<ZipCPU> Ok, your yices is more recent than mine, so I'll assume that's not a problem then
<maikmerten> fresh bugs, fresh bugs ;-)
<maikmerten> (nah)
<ZipCPU> Lol
<ZipCPU> How about a verilator -Wall check, to see if you are missing anything?
* ZipCPU steps away for lunch --will look back again later
<ZipCPU> Also ... adding `default_nettype none should find a couple bugs too
fsasm has joined #yosys
<maikmerten> enjoy your lunch :)
<maikmerten> (it's not verilator, but iverilog -Wall is perfectly happy)
<maikmerten> ZipCPU, it *was* the reset
<maikmerten> https://paste.debian.net/1123066/ <-- this is PASS
<tpb> Title: debian Pastezone (at paste.debian.net)
<maikmerten> SBY 19:47:20 [alu_prf] summary: successful proof by k-induction.
<maikmerten> ^^ that sounds nice
<maikmerten> (pretty amazing that such an automated proof finishes in around 2 seconds)
<maikmerten> (also passes without truncating the addition)
<ZipCPU> I thought you had told me reset was low in the trace?
<maikmerten> yes, and my current theory is that I done goofed badly by confusing GTKWave instances... :(
<maikmerten> getting a hinch of "let's start over" I cleaned up my window mess, rm -rf'ed some dirs and started fresh
<maikmerten> and then I could indeed observe a counterexample of I_reset being non-zero at the first clock edge, so that was that...
<maikmerten> I'm seriously sorry for wasting your time :(
vidbina has quit [Ping timeout: 258 seconds]
fsasm has quit [Ping timeout: 268 seconds]
kraiskil has joined #yosys
maikmerten has quit [Remote host closed the connection]
emeb_mac has joined #yosys
X-Scale has quit [Ping timeout: 268 seconds]
<ZipCPU> Oh, ah, okay then. I'm glad you were able to discover the problem!
vidbina has joined #yosys
m_w has joined #yosys
m_w has quit [Client Quit]
m_w has joined #yosys
m_w has quit [Client Quit]
m_w has joined #yosys
X-Scale has joined #yosys
vidbina has quit [Ping timeout: 240 seconds]
<whitequark> daveshah: what(): no enum named 'SLICED.REG0.LSRMODE'
<whitequark> any idea what can cause this error in ecppack?
<daveshah> Out o d
<daveshah> *out of date trellis
<daveshah> ?
<whitequark> I just rebuilt prjtrellis and nextpnr-ecp5 twice
<daveshah> hmm
<whitequark> let's try third time?
<daveshah> bet you it's a git issue with the database submodule then
<whitequark> uh ugh
<whitequark> i'll try to update that
<daveshah> or a cmake issue and you have two trellises installed
<whitequark> btw, do you happen to know what are the conditions for LDR to work?
<daveshah> I've never actually tried it
<whitequark> i got it to work, actually
<whitequark> i had to add TDRV_SLICE_* parameters
<whitequark> which is... strange
<daveshah> I guess it's because it still ultimately uses the output H-bridge
<whitequark> ohh right, so even the BSCAN cell would use the SERDES output?
<daveshah> Yeah, it still uses the same final output stage
<whitequark> oh yes I see it now, thanks
<daveshah> Because they recommend it for things like doing low speed standard and HD SDI on the same pins
<daveshah> so it would be odd if the signalling level changed
<whitequark> I'm not sure I understand how the TDRV slices actually work in that case
<whitequark> but then again it's the sort of thing I can directly observe now
<whitequark> daveshah: yep, it was the database submodule, thanks!
<whitequark> daveshah: do you know if there's a way to get EXTREFB.REFCLKO to fabric?
<daveshah> I don't think there is a direct route, no
<whitequark> hm, so there's actually no way to get the onboard clock from lfe5um5g-85f-evm to some sort of connector
<whitequark> i continue to be impressed how useless lattice devboards are
<whitequark> right now i'm grabbing PCLK and routing it through LDR to one of the SMAs
<whitequark> but there's something pretty weird about it
<daveshah> You could just use one of the IO pins and route PCLK to an ODDRX1F?
<daveshah> if you think LDR is the issue
lutsabound has joined #yosys
<whitequark> I actually think PCLK might be the issue
<whitequark> or rather, there's something about PCLK I don't understand
<whitequark> oh I figured it out
<whitequark> the PCLK duty cycle is very strange
<whitequark> can be as large as 55%
<whitequark> daveshah: is this an ecppack bug or is it more likely some issue with prjtrellis versioning again? https://github.com/SymbiFlow/prjtrellis/issues/112
<daveshah> No it is a genuine issue of some kind
<daveshah> I see it here too
<daveshah> whitequark: I think the problem is nextpnr used a connection that doesn't exist any more
<whitequark> hmm
<daveshah> Can you try `touch ecp5/trellis_import.py` and rebuild nextpnr now the db issue is solved (sorry in advance for the CPU time)
<whitequark> building
<whitequark> i think that fixed it
emeb has quit [Quit: Leaving.]
kraiskil has quit [Ping timeout: 265 seconds]
m_w has quit [Quit: leaving]
Jybz has quit [Quit: Konversation terminated!]
tpb has quit [Remote host closed the connection]
tpb has joined #yosys