ChanServ changed the topic of #yosys to: Yosys Open SYnthesis Suite: https://github.com/YosysHQ/yosys/ | Channel logs: https://libera.irclog.whitequark.org/yosys/
tpb has quit [Remote host closed the connection]
tpb has joined #yosys
strobo has quit [Ping timeout: 245 seconds]
strobo has joined #yosys
peeps[zen] has joined #yosys
peepsalot has quit [Ping timeout: 264 seconds]
indy has quit [Ping timeout: 260 seconds]
indy has joined #yosys
kristianpaul has quit [Read error: Connection reset by peer]
kristianpaul has joined #yosys
kraiskil has joined #yosys
kraiskil has quit [Ping timeout: 264 seconds]
kraiskil has joined #yosys
kraiskil has quit [Ping timeout: 268 seconds]
<cr1901> I'm guessing the answer is "no", but is it possible to get yosys to give more precise src information than "where the beginning of the always block the signal is used in is located"?
peeps[zen] has quit [Ping timeout: 260 seconds]
peepsalot has joined #yosys
dlobato has joined #yosys
<mwk> not really, src information is kept on a kind-of best-effort basis
<mwk> (without all that much effort in the first place)
<mwk> but, could you describe your usecase a little more?
<cr1901> mwk: Sure. I have a bitstream that nextpnr-machxo2 creates successfully, but the behavior on FPGA does not match simulation behavior. 1/2
<cr1901> And I have done a, pre-yosys, post-yosys/pre-pnr, and post-pnr simulation of an input stimulus that fails on FPGA
<cr1901> All three simulations agree w/ each other in iverilog
<cr1901> I've isolated at least _one_ signal in the original verilog whose behavior on the FPGA isn't matching (it's stuck low)
<cr1901> and I want to trace this signal from which slice it's stored in backwards to isolate why the signal is stuck low
<mwk> can you match the name of the signal to something?
<cr1901> I can't add an internal LA to probe the signals because disturbing the original Verilog file moves the design around too much and makes the offending signal unstuck
<cr1901> Yes, at the post-yosys/pre-pnr level, I've matched the signal, or at least "the signal after ABC has potentially merged it w/ other crap"
<cr1901> Would you like the v file and the json yosys produces?
<mwk> ... huh, the yosys backend involved really only supports a LUT4 and the plainest DFF possible?
<cr1901> mwk: Yes, I've not had a good year
<mwk> well
<cr1901> And I don't think I should add more until I make sure the absolute basics are working
<mwk> first thing I'd try is to approach this from the flow feature side, not test design side
<mwk> ie. disable flow features until it stops breaking
<mwk> but it seems you can't really simplify the yosys side, LUT4+DFF is as simple as it gets
<mwk> is there some non-trivial logic in the packer?
<cr1901> No, but there's a caveat I haven't mentioned yet:
<cr1901> I'm testing against an old nextpnr version from February (long story). The bug isn't in nextpnr HEAD- nextpnr HEAD generates a proper bitstream. Problem solved, right?
<cr1901> What if the bug is just masked b/c the PRNG state changed?
<cr1901> There _was_ a bug in the packer I fixed in July
<mwk> retry with lots of seeds, then
<mwk> get some idea of how likely the bug is to occur
* cr1901 nods
<cr1901> I'll do that now
<cr1901> >(12:38:33 PM) mwk: ie. disable flow features until it stops breaking
<cr1901> (Oh... duh... I could've added other features and then disabled them. Although that wouldn't help here, that's a shitty excuse for not adding more DFF types)
<mwk> *shrug* you had your priorities
lambda has quit [Quit: WeeChat 3.2]
lambda has joined #yosys
dlobato has quit [Ping timeout: 268 seconds]
<cr1901> With seeds 0-10 on the bad nextpnr, only 2 of them work properly. I just realized I could automate this too
* cr1901 tries the good nextpnr next
<cr1901> And with the good nextpnr, all seeds 0-10 work
<cr1901> Guess the bug was fixed... I'll need to test more than seed 0 (or whatever the default is) when making changes
<mwk> this resolves the original issue, right?
<cr1901> Yes, but I'd like to understand why for future-me. Up until this point, I've done bugfixes for assertion failures. And earlier I isolated the commit where seed "0" stopped breaking and thought to myself "that can't be right"
<cr1901> https://github.com/YosysHQ/nextpnr/commit/b1f25d4b33a40666a2f483ee3875074c65c2ac68 Commit that supposedly fixes it, and I don't remember why I needed this commit (Feb 22, ignore date)
<mwk> hmm
<mwk> well you can test before/after with more seeds, right?
<mwk> timing changes leading to corectness changes are not impossible
<mwk> don't know that much about how router works, but presumably if pips are 0-cost, there's no need to optimize the length of the path at all
<cr1901> Sure, I could even automate the testing. This particular commit did not make it into my initial PR. So I found out it was needed as part of a bug fix
<cr1901> (Unless gatecat asked me to make this change, which is possible- I'll have to look at logs)
<mwk> (and the real fun part is when you get hold time violations and cannot even see them because you have no timing data!)
<cr1901> Yes indeed. My assumption throughout this is: It's a f***ing UART, you have bigger problems if you have a timing violation at 12MHz
<mwk> hmm, how fast is the Mach-XO2 fabric anyway?
<mwk> also: do you have dedicated clock routing in nextpnr already?
<mwk> because if not... it's really easy to fuck up and get a hold violation
<cr1901> It's in the database, it's not routed
<mwk> uhoh.
<mwk> yeah, non-dedicated clock routes without good timing analysis == you will die by hold time violation
<mwk> and those don't care about clock frequencies
<mwk> I've been there...
<cr1901> Well, I'm satisfied w/ that explanation, tbh
<cr1901> mwk: the "bad" nextpnr I'm testing is one commit away from the commit I linked, plus another commit that fixed a txt cfg generation problem
<cr1901> in other words, they're effectively one commit away from each other, so if 10 seeds work on the linked commit, and they didn't work just before that commit, I'm confident that the linked commit actually did fix the problem
<mwk> mhm
<mwk> *whispers* it's timiiiiing
<cr1901> (I would be very worried if fixing a txt cfg bug affected pnr)
* cr1901 nods
<cr1901> All of this crap happened by chance T_T. I accidentally checked out an old branch w/o realizing how old it was for a demo.
<mwk> oops
<cr1901> Built the UART demo, got an assert failure. That was txt cfg bug.
<cr1901> That's a legitimate bug that's not patched in HEAD yet.
<cr1901> Ironically probably only found b/c seed 0 generated _just_ the correct routing w/ the _very_ bad timing info
<cr1901> Then I fix the txt cfg bug, and I can't get any of my bitstreams to work T_T
<cr1901> I figured "well I already found one legit bug using this old commit, what if I find another?!"
<cr1901> And I wasted half this weekend. The end!
<cr1901> Thanks for the help, I probably would've wasted my whole weekend and then some w/o your help
vidbina has joined #yosys
vidbina has quit [Ping timeout: 260 seconds]
dlobato has joined #yosys
dlobato has quit [Ping timeout: 260 seconds]
vidbina has joined #yosys
vidbina has quit [Ping timeout: 260 seconds]