whitequark[cis] changed the topic of #prjunnamed to: FPGA toolchain project · rule #0 of prjunnamed: no one should ever burn out building software · https://prjunnamed.org · https://github.com/prjunnamed/prjunnamed · logs: https://libera.irclog.whitequark.org/prjunnamed
<_whitenotifier-4> [prjunnamed] meithecatte synchronize pull request #61: cli: Always print cell count statistics - https://github.com/prjunnamed/prjunnamed/pull/61
<mei[m]> agreed. I ended up squashing the two commits because I entangled myself in the git-foo too much trying to keep them separate
<_whitenotifier-4> [prjunnamed] meithecatte synchronize pull request #61: cli: Always print cell count statistics - https://github.com/prjunnamed/prjunnamed/pull/61
<whitequark[cis]> wouldn't the BufWriter flush itself on drop?
<whitequark[cis]> oh i guess you want to propagate the error
<whitequark[cis]> or... actually no i see what's going on
<mei[m]> yeah you want to flush it before printing stats
<mei[m]> ready to merge?
<mei[m]> actually I should add a clarifying comment to the flush
<_whitenotifier-4> [prjunnamed] meithecatte synchronize pull request #61: cli: Always print cell count statistics - https://github.com/prjunnamed/prjunnamed/pull/61
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-61-e33681cd11c5ff1b09348270be514b90135986c5 - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-61-e33681cd11c5ff1b09348270be514b90135986c5 - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] whitequark deleted branch mei/stats - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed/prjunnamed] github-merge-queue[bot] pushed 2 commits to main [+0/-0/±4] https://github.com/prjunnamed/prjunnamed/compare/e33681cd11c5...4fb61eb6239a
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte cab1e29 - cli: Always print cell count statistics
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte 4fb61eb - cli: Always buffer output writes
<_whitenotifier-4> [prjunnamed] whitequark closed pull request #61: cli: Always print cell count statistics - https://github.com/prjunnamed/prjunnamed/pull/61
<mei[m]> is anyone against merging #9 (pattern language docs)
<whitequark[cis]> i still havent reviewed them so yes
<mei[m]> <whitequark[cis]> "mei do you wanna help me write..." <- how do you see this working?
<mei[m]> I think a good starting point would be the doc comments we have in the netlist crate...
<whitequark[cis]> i dont think so
<whitequark[cis]> LangRef has a different audience and purpose than the doc comments
<whitequark[cis]> i talked about this before; the reason we need both is because they're for different things
<mei[m]> ok
<mei[m]> so uh, voice call?
<whitequark[cis]> mei[m]: i'm thinking of documenting one cell to define a format for it to begin with
<mei[m]> makes sense i think
<mei[m]> behold, the graphviz visualization of boneless-cpu
<whitequark[cis]> yeah this is why i have not bothered
<whitequark[cis]> i think you want to select the Sugiyama layout
<whitequark[cis]> * Sugiyama layout engine
<mei[m]> (that's actually one particularly bad example where i tried to use the neato engine)
<mei[m]> is the fact that there's no way to obtain the underlying &Design from a CellRef intentional?
<whitequark[cis]> no, it just never came up
<mei[m]> it's starting to look kinda reasonable
<whitequark[cis]> oh that gives me yosys flashbacks
<_whitenotifier-4> [prjunnamed] meithecatte created branch mei/graphviz - https://github.com/prjunnamed/prjunnamed
<Wanda[cis]> <whitequark[cis]> "oh that gives me yosys flashback..." <- yeahhh
<_whitenotifier-4> [prjunnamed] meithecatte created branch mei/display-value - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] meithecatte opened pull request #62: impl Display for Value: use new syntax - https://github.com/prjunnamed/prjunnamed/pull/62
<mei[m]> what's the idea behind IndexedScope?
<Wanda[cis]> so in Verilog, you have the concept of a block
<Wanda[cis]> which corresponds to a named scope
<Wanda[cis]> begin : abc
<Wanda[cis]> [...]
<Wanda[cis]> end
<Wanda[cis]> most commonly, you don't write blocks directly, but they are the result of a generate statement
<Wanda[cis]> now, blocks can also be indexed, which is what happens when they are a result of a generate-for loop
<Wanda[cis]> they'd then be named something like abc[0], abc[1], ...
<Wanda[cis]> also, when instantiating a module, you can decide to create an instance array instead of a singular instance
<Wanda[cis]> given that our netlist is flattened, these two result in basically the same metadata
<Wanda[cis]> uh.
<Wanda[cis]> actually hold on
<Wanda[cis]> Catherine: weren't we supposed to store the scope's gender (block, module, struct, etc) on the metadata item?
<mei[m]> i made it list any names attached to the node
<_whitenotifier-4> [prjunnamed] meithecatte created branch mei/rewrite-muxes - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] meithecatte opened pull request #63: simplify: rewrite mux patterns generated by assign lowering - https://github.com/prjunnamed/prjunnamed/pull/63
<_whitenotifier-4> [prjunnamed] meithecatte synchronize pull request #63: simplify: rewrite mux patterns generated by assign lowering - https://github.com/prjunnamed/prjunnamed/pull/63
<whitequark[cis]> hm, that is pretty dirty. interesting that boneless benefits from it far more too
<whitequark[cis]> i think the main thing that stops me is that some other reasonable looking rules are counterproductive
<whitequark[cis]> as a result i have no faith that this is actually the right change to make
<mei[m]> it would probably make sense to modify the assign lowering to not emit this instead
<mei[m]> the issue with that is that it requires a refactoring that looks painful
<whitequark[cis]> since some of the other reasonable patterns are *counter*productive im happy to keep the PR open until someone does the refactoring i think
<galibert[m]> huhu, for once arch is not up-to-date enough to reach edition2024
<mei[m]> not using rustup?
<galibert[m]> no, trying to follow the system distribution
<galibert[m]> there are pro and cons for that, of course
<galibert[m]> they put a new version in testing yesterday, so that should be ok in a handful of weeks
<whitequark[cis]> interesting
<whitequark[cis]> how does collapsing work?
<mei[m]> edges out of high-fanout nodes don't get drawn unless it is the only input of a node
<mei[m]> actually, I think wording this as "21 other uses" is less confusing
<povikMartinPovie> interesting output, looking forward to trying it out
<_whitenotifier-4> [prjunnamed] meithecatte commented on pull request #62: impl Display for Value: use new syntax - https://github.com/prjunnamed/prjunnamed/pull/62#issuecomment-2674074866
<_whitenotifier-4> [prjunnamed] whitequark commented on pull request #62: impl Display for Value: use new syntax - https://github.com/prjunnamed/prjunnamed/pull/62#issuecomment-2674076919
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-62-4fb61eb6239a71236d696035c30698ca8d971fb6 - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] meithecatte closed pull request #62: impl Display for Value: use new syntax - https://github.com/prjunnamed/prjunnamed/pull/62
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-62-4fb61eb6239a71236d696035c30698ca8d971fb6 - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed/prjunnamed] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/prjunnamed/prjunnamed/compare/4fb61eb6239a...4bd74685539e
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte 4bd7468 - netlist: impl Display for Value: use new syntax
<_whitenotifier-4> [prjunnamed] meithecatte deleted branch mei/display-value - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] whitequark commented on pull request #62: impl Display for Value: use new syntax - https://github.com/prjunnamed/prjunnamed/pull/62#issuecomment-2674146317
<widlarizerEmilJT> Trying to use prjunnamed/amaranth in a nix flake and getting my teeth kicked in by pdm-backend version "2.4.3" not actually being 2.4.3 and I have no idea what's going on. Repro is `nix develop`
<widlarizerEmilJT> Wait, this pulls in 2.1.8. I think I know what's going on, I was previously overriding the version, but didn't override the hash, which would use 2.1.8 and call it 2.4.3. Yikes.
<_whitenotifier-4> [prjunnamed] meithecatte opened pull request #64: Implement Graphviz output - https://github.com/prjunnamed/prjunnamed/pull/64
<widlarizerEmilJT> Nothing particularly standing out in my five stage pipelined RV32IM
<widlarizerEmilJT> this is targeting siliconblue for the demo
<widlarizerEmilJT> <povikMartinPovie> "if you want to look at the code:..." <- Wanna push what it to a fork? I'd like to poke around and this isn't self-contained enough for that
<_whitenotifier-4> [prjunnamed] whitequark commented on pull request #64: Implement Graphviz output - https://github.com/prjunnamed/prjunnamed/pull/64#issuecomment-2674540262
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-64-4bd74685539e45cd2dec1cea25631d6034e9cc92 - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] whitequark closed pull request #64: Implement Graphviz output - https://github.com/prjunnamed/prjunnamed/pull/64
<_whitenotifier-4> [prjunnamed] whitequark deleted branch mei/graphviz - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed/prjunnamed] github-merge-queue[bot] pushed 19 commits to main [+2/-0/±27] https://github.com/prjunnamed/prjunnamed/compare/4bd74685539e...69833e5cc307
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte 60725ff - Design::display_cell: don't repeat output twice
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte 030429e - Implement rudimentary Graphviz output
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte 06d85e3 - graphviz: Output cells as records
<_whitenotifier-4> [prjunnamed/prjunnamed] ... and 16 more commits.
<povikMartinPovie> sure, I've fixed some bugs and I'll upload it somewhere later
<ignaloidas> Hey, so I decided to make an alternative verification backend directly using SAT a solver, and I'm not sure about this place https://github.com/prjunnamed/prjunnamed/blob/69833e5cc307bdbc76aa930af8b6a2729772d316/netlist/src/smt.rs#L196
<ignaloidas> aren't those bvands unneeded?
<povikMartinPovie> in what sense?
<povikMartinPovie> I guess it could be written as "to.x implies from.x"
<ignaloidas> seems fairly confusing for me to compare whether two bit vectors are the same by comparing whether left == (left & right)
<povikMartinPovie> feels like there's something subtle going on, I don't know
<povikMartinPovie> note that they are not being tested for equality, this is a test of to refining from, so an x-state in from can be refined to 0/1 in to, though not the other way around
<povikMartinPovie> with that the code just looks to be the way Catherine has decided to write "implies"
<ignaloidas> oh, found my problem elsewhere
<ignaloidas> implementing traits from name inference isn't the best strategy to avoid subtle bugs
<whitequark[cis]> <povikMartinPovie> "with that the code just looks to..." <- yes
<whitequark[cis]> there is no 'bvimplies' in SMT
<whitequark[cis]> you kind of have to write it out
<whitequark[cis]> i think Wanda also found it confusing during review
Guest53 has joined #prjunnamed
Guest53 has left #prjunnamed [#prjunnamed]
<ignaloidas> implemented ~90% of SAT verification backend (passes all but 5 tests because of missing implementations), and it seems to be almost 100x faster
<ignaloidas> code is a horrific mess that will take a while to fix into something acceptable
<whitequark[cis]> i presume it is not using stdio to talk to the solver?
<whitequark[cis]> i think that is the bulk of the time taken by the current SMT impl
<whitequark[cis]> i don't love it but i'm also unconvinced this is the way to go
<ignaloidas> It's actually writing the solution to a temp file and getting the output from solvers stdout
<ignaloidas> the format is extremely simple, just lines of numbers, so formatting is essentially free
<povikMartinPovie> I'm lacking a way to debug print a single cell
<povikMartinPovie> not really, there's design.display_cell
<_whitenotifier-4> [prjunnamed] meithecatte synchronize pull request #35: decision: Accurately check whether nets are mutually exclusive - https://github.com/prjunnamed/prjunnamed/pull/35
<_whitenotifier-4> [prjunnamed] meithecatte commented on pull request #35: decision: Accurately check whether nets are mutually exclusive - https://github.com/prjunnamed/prjunnamed/pull/35#issuecomment-2675618306
<_whitenotifier-4> [prjunnamed] wanda-phi opened issue #65: Design and implement P&R metadata on the netlist - https://github.com/prjunnamed/prjunnamed/issues/65
<_whitenotifier-4> [prjunnamed] wanda-phi opened issue #66: Ingest placement and timing constraints from the user - https://github.com/prjunnamed/prjunnamed/issues/66
<_whitenotifier-4> [prjunnamed] wanda-phi opened issue #67: Design a means of storing timing constraints on the netlist - https://github.com/prjunnamed/prjunnamed/issues/67
<ignaloidas> threw what I've done with SAT here https://github.com/ignaloidas/prjunnamed/tree/wip-sat, it's fast but still missing some pieces and full of jank
<ignaloidas> I think the way I approched it at first isn't the correct one, will try another approach over the weekend
<_whitenotifier-4> [prjunnamed] wanda-phi opened issue #68: Implement SiliconBlue carry chain legalization - https://github.com/prjunnamed/prjunnamed/issues/68
<_whitenotifier-4> [prjunnamed] wanda-phi opened issue #69: Implement icecube-based SiliconBlue P&R - https://github.com/prjunnamed/prjunnamed/issues/69
<_whitenotifier-4> [prjunnamed] wanda-phi opened issue #70: Implement timing analysis - https://github.com/prjunnamed/prjunnamed/issues/70
<_whitenotifier-4> [prjunnamed] wanda-phi opened issue #71: Emit SiliconBlue bitstreams - https://github.com/prjunnamed/prjunnamed/issues/71
<_whitenotifier-4> [prjunnamed] wanda-phi opened issue #72: Implement a placer - https://github.com/prjunnamed/prjunnamed/issues/72
<_whitenotifier-4> [prjunnamed] wanda-phi opened issue #73: Implement a router - https://github.com/prjunnamed/prjunnamed/issues/73
<Wanda[cis]> oh hey, I managed to create a perfectly unhinged issue as #69
<Wanda[cis]> excellent, I wasn't even trying
<cr1901> What
<cr1901> s icecube-based*?
<galibert[m]> Catnip overdose
<leocassarani[m]> nice
<leocassarani[m]> I like what you've done with the sub-issues for the roadmap btw! I didn't even know GitHub supported that
<Wanda[cis]> sorry we have decided that reversing bitstreams is too hard, we will only use vendor P&R from now on
<mei[m]> seems to be a recent feature
<Wanda[cis]> yeah it's some recent stuff
<galibert[m]> Yeah, must have been good catnip
<cr1901> Oh I should've actually opened the link...
<galibert[m]> of course within the umbrella of #17 is suddendly makes complete sense
<Wanda[cis]> the last step is cutting the umbilical icecube.
<galibert[m]> yeah :-)
<Wanda[cis]> it's a very good plan
<Wanda[cis]> but I can't take credit for it
<galibert[m]> I think xilinx stuff may allow something similar. Quartus is very unwilling at showing its work though iirc
<Wanda[cis]> Cat convinced me to do it like that. I considered it completely batshit at first, then it dawned on me that it's actually the only reasonable way to do this
<galibert[m]> well, you're in a domain where batshit is the most reasonable
<Wanda[cis]> yeah this is also going to be the blueprint for xilinx (though reduced in scope because the common infra will be already in place)
<Wanda[cis]> galibert[m]: what do you mean? quartus emits perfectly reasonable P&R data
<galibert[m]> hmmmm
<galibert[m]> oh yeah, yeah it does. What it doesn't allow iirc is giving your stuff to turn into a bitstream, like xilinx allows with xdl
<galibert[m]> (or did, I haven't used xilinx stuff in years)
<mei[m]> galibert[m]: isn't quartus showing its work the key reason why prjcombine has a relatively easy time with xilinx?
<Wanda[cis]> that doesn't sound right either, you can actually give quartus a routing file
<Wanda[cis]> (not that we'd need it)
<cr1901> > parse icecube placer PCF to obtain final placement, back-annotate it onto the netlist <-- icecube emits a PCF with the final placement of everything?
<mei[m]> ah, wait, quartus is the altera stuff
<cr1901> As opposed to having to also disassemble the bitstream to get placement info*?
<Wanda[cis]> cr1901: several PCFs actually! I have no clue why it emits so many PCFs
<Wanda[cis]> but yes
<mei[m]> this is a certified neocat_woozy moment on my part
<Wanda[cis]> it also emits the complete routing graph
<cr1901> Huh... :o
<Wanda[cis]> though it's easier to parse the bitstream.
<galibert[m]> you can? I missed that when I started the RE. Oh well
<Wanda[cis]> (prjcombine does a really weird combo of recovering most routing information from the routing graph via atrocious name conversion code, but also filling in missing data from btistream disassembly for hard IP related wires, which are a pain to deal with otherwise)
<Wanda[cis]> (or, um, will, when I get around to writing that part)
<Wanda[cis]> ohhh hold on
<Wanda[cis]> I actually implemented that already
<Wanda[cis]> I have no memory of it
<Wanda[cis]> mmm yeah
<Wanda[cis]> that's some cute code
<Wanda[cis]> I particularly like the circular dependency involved
<mei[m]> bootstrapping :3
<Wanda[cis]> it's reversing the bitstream format, but for that it needs routing information, which it obtains partially by disassembling the bitstream
<Wanda[cis]> and it does that by pulling in the already-done bitstream database for an earlier device that doesn't have hard IP and uses that for disassembly
<Wanda[cis]> it may be a little mismatched, but the routing bits are the same, so oh well
<Wanda[cis]> one day I should write down all the weird tricks that make prjcombine capable of reversing FPGAs at scale.
<galibert[m]> that will be a fun read
<Wanda[cis]> well. the good news is that the bitstream disassembly in prjunnamed won't be anywhere near as batshit, since it can just use the final database
<galibert[m]> yup