ChanServ changed the topic of #prjunnamed to: FPGA toolchain project · rule #0 of prjunnamed: no one should ever burn out building software · https://github.com/prjunnamed/prjunnamed · logs: https://libera.irclog.whitequark.org/prjunnamed
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 3 commits to main [+0/-0/±21] https://github.com/prjunnamed/prjunnamed/compare/179b3f006761...4c013c1eee4e
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 3094a20 - netlist: use [] instead of {} for concatenations.
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 85bf8ae - netlist: specify target with `use target "..."`, not `target "..."`.
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 4c013c1 - netlist: improve documentation for constants and values.
<whitequark[cis]> okay, i've improved some of the things that bothered me the most
<whitequark[cis]> I'm not sure what voice to use for function docstrings, especially constructors; is it "Create foo", "Creates foo", "Foo"?
<whitequark[cis]> (is there some convention for this in Rust?)
<leocassarani[m]> The (loose) Rust convention is "Creates foo"
<whitequark[cis]> ok, done
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 1 commit to main [+0/-0/±13] https://github.com/prjunnamed/prjunnamed/compare/4c013c1eee4e...62e9064a0e14
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 62e9064 - netlist: improve documentation for constants and values.
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 2 commits to main [+0/-0/±3] https://github.com/prjunnamed/prjunnamed/compare/62e9064a0e14...c4512919a1c8
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 9d2550d - netlist: add and use `Design::is_empty()`.
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark c451291 - netlist: prepare for splitting outputs of instance/target cells. NFC
<_whitenotifier-4> [prjunnamed] meithecatte commented on commit 4c013c1eee4e9a793ac6570ef1c3d3e1aaa1b593 - https://github.com/prjunnamed/prjunnamed/commit/4c013c1eee4e9a793ac6570ef1c3d3e1aaa1b593#r152475171
<_whitenotifier-4> [prjunnamed/amaranth] whitequark pushed 1 commit to main [+0/-0/±1] https://github.com/prjunnamed/amaranth/compare/c3b62c329a99...a2b86d432935
<_whitenotifier-4> [prjunnamed/amaranth] whitequark a2b86d4 - back.unnamed: update syntax.
<_whitenotifier-4> [prjunnamed] whitequark commented on commit 4c013c1eee4e9a793ac6570ef1c3d3e1aaa1b593 - https://github.com/prjunnamed/prjunnamed/commit/4c013c1eee4e9a793ac6570ef1c3d3e1aaa1b593#r152475247
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 1 commit to main [+0/-0/±6] https://github.com/prjunnamed/prjunnamed/compare/c4512919a1c8...3b5dd0a6471e
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 3b5dd0a - yosys_json: use `jzon` crate instead of `json`. NFC
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte pushed 1 commit to main [+0/-0/±6] https://github.com/prjunnamed/prjunnamed/compare/3b5dd0a6471e...7e14d7ae21ad
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte 7e14d7a - cleanup: use is_empty() instead of comparing length with zero (NFC)
<_whitenotifier-4> [prjunnamed/vscode-syntax] whitequark pushed 1 commit to main [+1/-0/±4] https://github.com/prjunnamed/vscode-syntax/compare/4a378f3ae1d8...c510ad598733
<_whitenotifier-4> [prjunnamed/vscode-syntax] whitequark c510ad5 - Add keyword for new `set target` syntax.
<_whitenotifier-4> [vscode-syntax] whitequark created tag v0.3.0 - https://github.com/prjunnamed/vscode-syntax
<_whitenotifier-4> [prjunnamed/vscode-syntax] whitequark tagged c510ad5 as v0.3.0 https://github.com/prjunnamed/vscode-syntax/commit/c510ad598733646a1e854878d00f0457e5ba7441
<whitequark[cis]> ok i gotta admit `if target.len() < 1 {` was unhinged
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 1 commit to main [+0/-0/±1] https://github.com/prjunnamed/prjunnamed/compare/7e14d7ae21ad...d2559052fc4d
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark d255905 - netlist: when printing, only attach names to target cells.
<mei[m]> whitequark[cis]: my personal favorite is `a.len() + b.len() == 0`
<whitequark[cis]> i'm proud of that one actually
<whitequark[cis]> it's shorter than an or of is_empty
<whitequark[cis]> s/or/`||`/, s/is_empty/is\_empty/
<Wanda[cis]> it's called branchless code mei
<whitequark[cis]> * it's shorter than an || of is_empty()
<whitequark[cis]> Wanda.
<Wanda[cis]> don't Wanda me you committed that thing
<whitequark[cis]> i do commit things.
<_whitenotifier-4> [prjunnamed/vscode-syntax] whitequark pushed 1 commit to main [+0/-0/±1] https://github.com/prjunnamed/vscode-syntax/compare/c510ad598733...e89d6d868887
<_whitenotifier-4> [prjunnamed/vscode-syntax] whitequark e89d6d8 - Update installation instructions.
<_whitenotifier-4> [prjunnamed] meithecatte created branch cargo-deny - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] meithecatte opened pull request #10: Set up cargo-deny to lint the dependency tree in CI - https://github.com/prjunnamed/prjunnamed/pull/10
<_whitenotifier-4> [prjunnamed] meithecatte synchronize pull request #10: Set up cargo-deny to lint the dependency tree in CI - https://github.com/prjunnamed/prjunnamed/pull/10
<_whitenotifier-4> [prjunnamed] whitequark reviewed pull request #10 commit - https://github.com/prjunnamed/prjunnamed/pull/10#discussion_r1953767906
<_whitenotifier-4> [prjunnamed] meithecatte reviewed pull request #10 commit - https://github.com/prjunnamed/prjunnamed/pull/10#discussion_r1953769108
<_whitenotifier-4> [prjunnamed] whitequark reviewed pull request #10 commit - https://github.com/prjunnamed/prjunnamed/pull/10#discussion_r1953776627
<_whitenotifier-4> [prjunnamed] whitequark closed pull request #10: Set up cargo-deny to lint the dependency tree in CI - https://github.com/prjunnamed/prjunnamed/pull/10
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 1 commit to main [+1/-0/±1] https://github.com/prjunnamed/prjunnamed/compare/d2559052fc4d...924a09caab73
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte 924a09c - Set up cargo-deny to lint the dependency tree in CI
<_whitenotifier-4> [prjunnamed] whitequark deleted branch cargo-deny - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 1 commit to main [+0/-0/±9] https://github.com/prjunnamed/prjunnamed/compare/924a09caab73...07f7bcb5bfbc
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 07f7bcb - netlist: split multiple outputs of a cell in text representation.
<whitequark[cis]> okay, this should be a lot more readable
<_whitenotifier-4> [prjunnamed/vscode-syntax] whitequark pushed 1 commit to main [+1/-1/±0] https://github.com/prjunnamed/vscode-syntax/compare/e89d6d868887...58a7c1f3d9e4
<_whitenotifier-4> [prjunnamed/vscode-syntax] whitequark 58a7c1f - Update examples.
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 1 commit to main [+0/-0/±1] https://github.com/prjunnamed/prjunnamed/compare/07f7bcb5bfbc...7e3d50095eb3
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 7e3d500 - simplify: minor refactor. NFC
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 1 commit to main [+1/-0/±1] https://github.com/prjunnamed/prjunnamed/compare/7e3d50095eb3...608ad2a358d7
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 608ad2a - cli: embed git hash into final executable.
<_whitenotifier-4> [prjunnamed/amaranth] whitequark pushed 5 commits to main [+2/-0/±5] https://github.com/prjunnamed/amaranth/compare/a2b86d432935...c94d845a2771
<_whitenotifier-4> [prjunnamed/amaranth] wipeseals 9f9ea2c - vendor._gowin: fix comment syntax for add_preferences
<_whitenotifier-4> [prjunnamed/amaranth] whitequark 046b32a - back.yosys_json: new backend.
<_whitenotifier-4> [prjunnamed/amaranth] wanda-phi facc20f - back.unnamed: new backend.
<_whitenotifier-4> [prjunnamed/amaranth] ... and 2 more commits.
<whitequark[cis]> huh, we have a cursed kinda behavior; amaranth outputs instances of SB_IO and friends into the netlist as instances rather than target cells (which is fine) but we never call target.import after parsing from a string
<whitequark[cis]> so they just... end up remaining instances until the end of the flow
<whitequark[cis]> * up remaining those instances, * instances (with very limited set of ports) until the
<mei[m]> "end up remaining those instances"?
<whitequark[cis]> the instance is precisely that what amaranth has output
<whitequark[cis]> which means it completely misses out on all the validation
<mei[m]> ah, you transitivized "to remain", that's interesting
<whitequark[cis]> oh
<whitequark[cis]> is that not typical usage
<mei[m]> "to remain something somewhere"?
<mei[m]> (uptime of approximately 16h, might not be fully coherent)
<whitequark[cis]> ~~rookie numbers~~
<whitequark[cis]> * rookie numbers
<_whitenotifier-4> [prjunnamed/amaranth] whitequark pushed 1 commit to main [+0/-0/±1] https://github.com/prjunnamed/amaranth/compare/c94d845a2771...1009ddb13897
<_whitenotifier-4> [prjunnamed/amaranth] whitequark 1009ddb - vendor._siliconblue: add prjunnamed toolchain support.
<galibert[m]> I think the standard verb would be keep, as in ends up keeping those instances until the end of the flow
<whitequark[cis]> oh
<whitequark[cis]> yeah ok I need sleep too
<whitequark[cis]> that's unhinged
<galibert[m]> Sleep is good at times, I’ve noticed as I’m getting older
<whitequark[cis]> i tolerate sleep deprivation incredibly well but that doesn't mean it doesn't give me some amount of cognitive impairment
<whitequark[cis]> and i already have a bunch from "chronic pain" and "chronic pain meds"
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 1 commit to main [+0/-0/±2] https://github.com/prjunnamed/prjunnamed/compare/608ad2a358d7...0f60bb5133b7
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 0f60bb5 - cli: import target cells before processing design.
<whitequark[cis]> okay, that takes care of it
<leocassarani[m]> tbh I think your use of remain was grammatical, I can say "I remain myself", i.e. I haven't changed — and you were saying SB_IO etc remain those instances
<whitequark[cis]> right, that was the idea at least
<galibert[m]> Remain works less as transitive ( I remain the book)
<mei[m]> oh, that's what the intended parse was!
<mei[m]> (good morning! apparently my sleep schedule is in California)
<Wanda[cis]> hi mei
<Wanda[cis]> mei: btw, have I ever discussed the memory inference code with you?
<Wanda[cis]> trying to think about it is giving me intense OI flashbacks so it sounds something you'd enjoy
<Wanda[cis]> * it sounds like something you'd
<mei[m]> you mentioned some stuff about memory inference as a concept
<mei[m]> the coherence thingies, mostly
<mei[m]> read before write etc
<Wanda[cis]> ... coherence?
<Wanda[cis]> mmm
<Wanda[cis]> so, yeah, there's some basic legalization like that, which needs to be performed before you can mp the memory to target primitives
<Wanda[cis]> but that's not the really hard part
<Wanda[cis]> the part that I was really struggling with the first time around (2021, when I was writing memory_libmap) was matching the geometry of the source cell to the target cell
<Wanda[cis]> I think I understood whatever the hell was going on for just long enough to write the final part of the pass, then the whole thing has been completely erased from my memory
<Wanda[cis]> now. it appears to actually work. or at least I never got any complaints. maybe because nobody actually understood this shit enough to complain.
<Wanda[cis]> that said. memory_libmap is an absolutely batshit piece of code that should not ever be replicated. it has been made in a fit of clinical insanity. mostly OCD-induced.
<Wanda[cis]> oh right, and I think the Wanda that designed all that stuff did so while going through a psychotic episode and kinda disintegrated not long afterwards. probably unrelated, but still.
<Wanda[cis]> so. problem statement. you have a memory with some dimensions and read and write ports, and you have a target cell with some dimensions and read and write ports. you can assume that the number of ports and general attributes of the ports have already been matched up. all that remains is fixing up the dimensions.
<Wanda[cis]> there are several things that can make a memory not match a target cell
<Wanda[cis]> 1. the memory can be too wide for target cell. that one's easy, you fix it by replicating the target cell as many times as needed and just spliting the data bits over the replicated cells.
<Wanda[cis]> 2. the memory can be too deep for target cell. you fix it by trimming however many address bits from the MSB side, replicating the target cell, then using the trimmed address bits to drive muxes / write enable decoders
<mei[m]> do fpgas generally have a bunch of different types of memory cells, or like, 1 or 2 at most?
<Wanda[cis]> --- here shit gets actually complicated ---
<Wanda[cis]> 3. the memory can have restrictions on write enable groupings. like, say, one write enable for every 9 bits. and the restrictions vary between selected port widths, so you have to pick a width and then maybe waste some data lanes entirely to pad the thing.
<Wanda[cis]> 4. you can have ports of varying widths, and have to match up with the target port widths by emitting muxes and write address decoders until you end up with something actually supported
<Wanda[cis]> mei[m]: 3 types at most. however, the memory cells tend to be highly configurable.
<Wanda[cis]> for one, you can select various port width combinations
<Wanda[cis]> now. the major design mistake that I have made in memory_libmap is that I have decided to make a general solution that handles all possible memories.
<Wanda[cis]> it involves a DSL where you specify exactly just what capabilities your memory cell has, in all possible configurations, and the pass will figure out a way to lower it or die trying.
<Wanda[cis]> this includes arbitrarily complex cases with 5 different kinds of ports with completely mismatched capabilities and allowed port widths and whatnot.
<Wanda[cis]> the result will be optimal btw.
<Wanda[cis]> (optimal given a shitty heuristic cost function I made up on the spot in the hopes that someone more experienced would help me make a better one later, but uhh that never happened)
<Wanda[cis]> anyway. the decision for unnamed is that there will be no generic pass. there will be some reusable bits and pieces that target-specific code can call into, but ultimately we'll have target-specific inference code.
<Wanda[cis]> this greatly simplifies the whole thing, as we can just focus on the several specific kinds of memory that actually exist on FPGAs; a dozen of them or so
<gatecat[m]> I guess that would make things like dealing with extra register stages easier, too?
widlarizerEmilJT has joined #prjunnamed
<widlarizerEmilJT> Hmmm I just fixed a dangling pointer in memory_libmap this week but managed to avoid reading too much of the pass. Now it sounds kind of interesting though
<Wanda[cis]> <gatecat[m]> "I guess that would make things..." <- yes, and not just that
<Wanda[cis]> there's a bunch of stuff that was left off from memory_libmap because a) describing it in target-independent way was way too complex, b) the DSL and the pass were already ridiculously unwieldy
<Wanda[cis]> pipeline registers at the outputs, fancier forms of cascading such as the ultraram stuff, hard CS lines like ECP* has that could just be wired straight to some address lines instead of requiring more multiplexers, etc.
<Wanda[cis]> and the calculus for all of that changes completely when your memory lowering is driven by target-specific code. you can just write a few dozen lines to hook this stuff up directly instead of thinking of "generic ways"
<gatecat[m]> yes, that all makes good sense
<Wanda[cis]> oh, and pipeline registers also never happened because there was the opinion that this should be handled later in the flow, to have some opportunity for retiming
<Wanda[cis]> except. well. retiming.
mupuf has quit [Remote host closed the connection]
mupuf has joined #prjunnamed
mupuf has quit [Remote host closed the connection]
mupuf has joined #prjunnamed
mupuf has quit [Remote host closed the connection]
mupuf has joined #prjunnamed
mupuf has quit [Remote host closed the connection]
mupuf has joined #prjunnamed
<_whitenotifier-4> [prjunnamed] meithecatte synchronize pull request #4: Clean up zero-length adcs in the IR builder - https://github.com/prjunnamed/prjunnamed/pull/4
<_whitenotifier-4> [prjunnamed] meithecatte commented on pull request #4: Clean up zero-length adcs in the IR builder - https://github.com/prjunnamed/prjunnamed/pull/4#issuecomment-2657850315
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark pushed 1 commit to main [+0/-0/±1] https://github.com/prjunnamed/prjunnamed/compare/0f60bb5133b7...fa53c2a90e5e
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte fa53c2a - adc_split, adc_unsext: Don't emit zero-width adcs
<_whitenotifier-4> [prjunnamed] whitequark closed pull request #4: Clean up zero-length adcs in the IR builder - https://github.com/prjunnamed/prjunnamed/pull/4