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] ethanuppal commented on issue #48: Add a lexical analyzer (tokenizer) to the IR parser - https://github.com/prjunnamed/prjunnamed/issues/48#issuecomment-2670121398
<_whitenotifier-4> [prjunnamed] wanda-phi commented on issue #48: Add a lexical analyzer (tokenizer) to the IR parser - https://github.com/prjunnamed/prjunnamed/issues/48#issuecomment-2670140587
sdomi has quit [Ping timeout: 244 seconds]
sdomi has joined #prjunnamed
<whitequark[cis]> meow
Chips4MakersakaS has quit [Quit: Idle timeout reached: 172800s]
<povikMartinPovie> I think you were considering modelling each target cell with a small Design. Is that still on the table?
<povikMartinPovie> I guess those designs would have to be generated on request per value of parameters
<whitequark[cis]> we think that fixing the SMT emitter to not involve so much associated types would work out better
<povikMartinPovie> so would the target support code tie into the SMT emitter to model the primitives?
<whitequark[cis]> yeah
<whitequark[cis]> hm
<whitequark[cis]> do we even need IO declarations?
<whitequark[cis]> actually yeah we do
<whitequark[cis]> their only real utility is nailing down the iteration order
<_whitenotifier-4> [prjunnamed] whitequark created branch cat/ios - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] whitequark opened pull request #58: Change I/O declaration syntax to `&"meow":4 = io` - https://github.com/prjunnamed/prjunnamed/pull/58
<whitequark[cis]> i think this is a better syntax because now all declarations are uniform
<whitequark[cis]> plus we can later attach something, like metadata, to IOs if we want or need to
<_whitenotifier-4> [prjunnamed] whitequark synchronize pull request #58: Change I/O declaration syntax to `&"meow":4 = io` - https://github.com/prjunnamed/prjunnamed/pull/58
<_whitenotifier-4> [prjunnamed] whitequark synchronize pull request #58: Change I/O declaration syntax to `&"meow":4 = io` - https://github.com/prjunnamed/prjunnamed/pull/58
<_whitenotifier-4> [prjunnamed] whitequark synchronize pull request #58: Change I/O declaration syntax to `&"meow":4 = io` - https://github.com/prjunnamed/prjunnamed/pull/58
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-58-f6b3e2e761f9a80bce7d64fc72f66eef9435f12f - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] whitequark closed pull request #58: Change I/O declaration syntax to `&"meow":4 = io` - https://github.com/prjunnamed/prjunnamed/pull/58
<_whitenotifier-4> [prjunnamed] whitequark deleted branch cat/ios - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed/prjunnamed] github-merge-queue[bot] pushed 2 commits to main [+0/-0/±6] https://github.com/prjunnamed/prjunnamed/compare/f6b3e2e761f9...fbaa444b66ac
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 50faed5 - netlist: change I/O declaration syntax to `&"meow":4 = io`.
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark fbaa444 - docs: describe value references.
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-58-f6b3e2e761f9a80bce7d64fc72f66eef9435f12f - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] whitequark created branch cat/unset - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] whitequark opened pull request #59: Drop unnecessary `set` keyword from `set target` - https://github.com/prjunnamed/prjunnamed/pull/59
<_whitenotifier-4> [prjunnamed/prjunnamed] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±4] https://github.com/prjunnamed/prjunnamed/compare/fbaa444b66ac...740c4d030560
<_whitenotifier-4> [prjunnamed/prjunnamed] whitequark 740c4d0 - netlist: drop unnecessary `set` keyword from `set target`.
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-59-fbaa444b66acd3786ccd3c8ac836266d94e08737 - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] whitequark deleted branch cat/unset - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] whitequark closed pull request #59: Drop unnecessary `set` keyword from `set target` - https://github.com/prjunnamed/prjunnamed/pull/59
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-59-fbaa444b66acd3786ccd3c8ac836266d94e08737 - https://github.com/prjunnamed/prjunnamed
jn has quit [Ping timeout: 252 seconds]
jn has joined #prjunnamed
jn has joined #prjunnamed
<_whitenotifier-4> [prjunnamed/amaranth] whitequark pushed 2 commits to main [+0/-0/±2] https://github.com/prjunnamed/amaranth/compare/a0a5cabbe321...050afd0060a3
<_whitenotifier-4> [prjunnamed/amaranth] whitequark 860ecc8 - back.unnamed: update I/O declaration syntax.
<_whitenotifier-4> [prjunnamed/amaranth] whitequark 050afd0 - vendor._siliconblue: update prjunnamed target syntax.
<Wanda[cis]> <whitequark[cis]> "i think this is a better..." <- yeah, I was thinking of changing that too
<Wanda[cis]> alright, Rust edition 2024 is out
<Wanda[cis]> time to convert the codebase
<mei[m]> uh oh
<galibert[m]> Significant changes ?
<Wanda[cis]> galibert: absolutely nothing worth mentioning.
<Wanda[cis]> I got very excited for edition 2024
<galibert[m]> Oh good, should be fast then
<Wanda[cis]> because they were going to make ranges Copy
<Wanda[cis]> and we uh. clone ranges a lot.
<Wanda[cis]> which is incredibly annoying
<galibert[m]> And they didn’t ?
<Wanda[cis]> except then I learned they descoped it for some reason
<Wanda[cis]> so yeah.
<galibert[m]> Annoying
leocassarani[m] has joined #prjunnamed
<leocassarani[m]> ranges in Rust are really annoying
<leocassarani[m]> the RangeBounds trait is theoretically a good idea for abstracting over all the different types of ranges, but it's also not dyn safe
<leocassarani[m]> and then they just kind of feel underpowered — would it kill them to have methods like intersect, union, overlaps, etc that work across the different ranges (.., ..=, etc)
<leocassarani[m]> And yeah then you've got the limitation that you can't call iter() on a range (and iterate it by reference), you need to consume the value by calling into_iter() which means more cloning, indeed
<Wanda[cis]> yeah the new ranges were going to fix that particular annoyance
<Wanda[cis]> I mean, they still are; just, in 2027 or so
<Wanda[cis]> sigh we may have spent a significant amount of time fighting Rust annoyances when writing prjunnamed core
<Wanda[cis]> beats C++ I guess, but ehhhh
<Wanda[cis]> (have you seen the sheer amount of `Into<Cow<'_, Value>>` impls we have?)
<Wanda[cis]> (I actually think I'll want to make this stuff even more messy at some point, to avoid creating ephermeral Values in places)
<Wanda[cis]> (note: if I need to make a "behaves-like-a-Value" trait at any point, you can bet it's going to be called Valuable)
<Wanda[cis]> I with unsized types were real so I could just struct ValueSlice([Net])
<Wanda[cis]> ohhhh hey that reminds me, I have mei here now so I can get in-catperson help with annoying Rust stuff
<Wanda[cis]> hey mei remind me to ask you about enum-maps once we finish eating
<mei[m]> btw thoughts on piping uir to graphviz?
<Wanda[cis]> as is the compiler tradition
<Wanda[cis]> yeah, just make sure to gate it under an optional feature
<Wanda[cis]> (for wasm reasons mostly)
<galibert[m]> mei is your resident Rust expert ?
<mei[m]> meow
<Wanda[cis]> mei's my roommate; it also happens to be even more of a programming language nerd than me
<Wanda[cis]> and a compiler nerd
<Wanda[cis]> (and many other kinds of nerd)
<Wanda[cis]> I maaaaay have ranted at it a lot about unnamed long before its existence became public
<galibert[m]> Feel like a load-bearing « may » :-)
<_whitenotifier-4> [prjunnamed] meithecatte created branch mei/edition-2024 - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] meithecatte opened pull request #60: Migrate to Rust 2024 - https://github.com/prjunnamed/prjunnamed/pull/60
<_whitenotifier-4> [prjunnamed] meithecatte synchronize pull request #60: Migrate to Rust 2024 - https://github.com/prjunnamed/prjunnamed/pull/60
<whitequark[cis]> <Wanda[cis]> "(I actually think I'll want to..." <- is that really important?
<Wanda[cis]> I don't really know
<Wanda[cis]> definitely not prioritizing it
<mei[m]> Catherine: do you have opinions on one vs two commits in #60?
<whitequark[cis]> am actually reviewing it rn
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-60-740c4d030560e0381be4d79396a0f4a48c6a80cf - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed/prjunnamed] github-merge-queue[bot] pushed 2 commits to main [+0/-0/±5] https://github.com/prjunnamed/prjunnamed/compare/740c4d030560...e33681cd11c5
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte 0321a06 - Migrate to Rust 2024
<_whitenotifier-4> [prjunnamed/prjunnamed] meithecatte e33681c - ci: Use Rust 1.85 for cargo-deny
<_whitenotifier-4> [prjunnamed] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-60-740c4d030560e0381be4d79396a0f4a48c6a80cf - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] whitequark closed pull request #60: Migrate to Rust 2024 - https://github.com/prjunnamed/prjunnamed/pull/60
<_whitenotifier-4> [prjunnamed] whitequark deleted branch mei/edition-2024 - https://github.com/prjunnamed/prjunnamed
<whitequark[cis]> Wanda[cis]: i don't see Value allocations in the profiles any more, so my guess is it's mostly not
<Wanda[cis]> right, that'd be a no then
<povikMartinPovie> mapper is alive!
<povikMartinPovie> I had to rewrite a piece of it but I'm happy with the way it works now
<whitequark[cis]> nice! wait, did i introduce a bug into the cell printing code
<whitequark[cis]> (the first char must be + - or space)
<povikMartinPovie> looks fine to me
<whitequark[cis]> oh okay
<whitequark[cis]> just matrix being weird then
<whitequark[cis]> anyway, great work! let me know if you want me to look at the code
<whitequark[cis]> do you read liberty files?
<povikMartinPovie> yes
<povikMartinPovie> you know what, let me just post it the way it is
<whitequark[cis]> your own parser or is there a crate?
<povikMartinPovie> own parser, it's the piece I started with
<whitequark[cis]> ah interesting
<povikMartinPovie> I couldn't find a good reference for the syntax though, the Liberty manuals didn't seem complete
<povikMartinPovie> if you want to look at the code: https://gist.github.com/povik/acc0446ac245fbc112f647280a7b8668
<povikMartinPovie> I'll be refining it later, I just got it to work
<whitequark[cis]> interesting
<whitequark[cis]> have you seen prjunnamed-lut?
<whitequark[cis]> i think the Truth6 stuff duplicates it a bit
<povikMartinPovie> it does, but I would say the duplication is minor and it's worth to specialize it to u64 in all the inner loops
<povikMartinPovie> looking at Lut, I don't need the inputs array and I don't need it to work with Trits
<whitequark[cis]> right
<mei[m]> if i may ask... what's Liberty?
<povikMartinPovie> it's the format standard cell libraries are described in for synthesis
<Wanda[cis]> ASIC standard cell libraries
<mei[m]> so asic stuff?
<mei[m]> ah
<mei[m]> neat
<Wanda[cis]> though I've seen them used for FPGA stuff too, with ... mixed results
<Wanda[cis]> sigh icecube
<mei[m]> so, currently the cell count statistics only get printed if you're outputting the IR to stdout. thoughts about printing them always instead?
<mei[m]> i think it would make the most sense to print the statistics to stdout at all times (maybe have a --quiet option that would let you suppress it)
<whitequark[cis]> mmm
<whitequark[cis]> originally they were in impl Display for Design
<whitequark[cis]> then i factored them out since it seemed expensive and not always necessary
<whitequark[cis]> proposal: we make "alternate" mean "no comments, no toposort" and print the stats always otherwise
<mei[m]> hm, i think it might specifically be useful to print the statistics to stdout even if the actual IR is being output to a file
<whitequark[cis]> mmm, true actually
<whitequark[cis]> yeah sure lets do that
<whitequark[cis]> put it in print_statistics() or smth
<whitequark[cis]> we can add --quiet when we have real users i guess
<_whitenotifier-4> [prjunnamed] meithecatte created branch mei/stats - https://github.com/prjunnamed/prjunnamed
<_whitenotifier-4> [prjunnamed] meithecatte opened pull request #61: cli: Always print cell count statistics - https://github.com/prjunnamed/prjunnamed/pull/61
<whitequark[cis]> mei do you wanna help me write documentation for cells?
<whitequark[cis]> hm. the PrintUIR thing is cursed
<whitequark[cis]> should that not just be picking stdout as a file?
<mei[m]> hm, possibly. especially if we later want to expose a commandline option that would let you do json export but still output to stdout
<mei[m]> in that case I think the cell stats should go to stderr, though
<whitequark[cis]> i think they should always go to stderr and without the initial ;