whitequark changed the topic of #amaranth-lang to: Amaranth hardware definition language · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang
duck2 has quit [Quit: Ping timeout (120 seconds)]
ebb has quit [Remote host closed the connection]
duck2 has joined #amaranth-lang
electronic_eel has quit [Quit: No Ping reply in 180 seconds.]
wolfshappen has quit [Read error: Connection reset by peer]
wolfshappen has joined #amaranth-lang
electronic_eel has joined #amaranth-lang
alyssa has quit [Quit: brain]
StephanvanSchaik has quit [Ping timeout: 256 seconds]
StephanvanSchaik has joined #amaranth-lang
ebb has joined #amaranth-lang
urja has quit [Ping timeout: 256 seconds]
Ekho has quit [Ping timeout: 256 seconds]
bob_twinkles_ has quit [Ping timeout: 256 seconds]
bob_twinkles has joined #amaranth-lang
Ekho has joined #amaranth-lang
urja has joined #amaranth-lang
<_whitenotifier-9> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/nextpnr/compare/090b29c65018...97e5ded5111e
<_whitenotifier-9> [YoWASP/nextpnr] whitequark 97e5ded - Update dependencies.
Degi has quit [Ping timeout: 260 seconds]
Degi has joined #amaranth-lang
<_whitenotifier-9> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/yosys/compare/73d1547fbf3e...37b9a340305c
<_whitenotifier-9> [YoWASP/yosys] whitequark 37b9a34 - Update dependencies.
indy has quit [Ping timeout: 256 seconds]
indy has joined #amaranth-lang
nak has quit [Ping timeout: 272 seconds]
SpaceCoaster_ has joined #amaranth-lang
SpaceCoaster has quit [Ping timeout: 256 seconds]
Xesxen has quit [Ping timeout: 256 seconds]
SpaceCoaster_ is now known as SpaceCoaster
Xesxen_ has joined #amaranth-lang
<_whitenotifier-9> [amaranth] whitequark opened issue #691: Remove interpretation of shapes as (int, bool) tuples - https://github.com/amaranth-lang/amaranth/issues/691
<_whitenotifier-9> [amaranth] whitequark opened issue #692: Remove the Migen compatibility layer - https://github.com/amaranth-lang/amaranth/issues/692
Raito_Bezarius has quit [Ping timeout: 252 seconds]
Raito_Bezarius has joined #amaranth-lang
wolfshappen has quit [Quit: later]
wolfshappen has joined #amaranth-lang
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]
Lord_Nightmare has joined #amaranth-lang
wolfshappen has quit [Read error: Connection reset by peer]
<_whitenotifier-9> [amaranth] whitequark commented on issue #608: [RFC] get rid of that `+=` and `.eq()` - https://github.com/amaranth-lang/amaranth/issues/608#issuecomment-1089028845
<_whitenotifier-9> [amaranth] whitequark closed issue #608: [RFC] get rid of that `+=` and `.eq()` - https://github.com/amaranth-lang/amaranth/issues/608
<_whitenotifier-9> [amaranth] whitequark opened issue #693: [RFC] Aggregate data structure library - https://github.com/amaranth-lang/amaranth/issues/693
<whitequark> it's been far too long, but the aggregate data structure library RFC (previously referred to as `PackedStruct`) is finally here!
<whitequark> please read, discuss, and comment
<_whitenotifier-9> [amaranth] whitequark commented on issue #623: Option to disable debug verilog generation - https://github.com/amaranth-lang/amaranth/issues/623#issuecomment-1089088832
<_whitenotifier-9> [amaranth] whitequark commented on issue #660: Guidance on naming - when to say "Amaranth HDL" versus just "Amaranth". - https://github.com/amaranth-lang/amaranth/issues/660#issuecomment-1089090715
<vup> yay
<Degi> Oh cool, so we don't need to use layouts with string number tuples anymore but can use Structs
<Degi> (Ooh, a consequence is that python editors can detect which members it has, right?)
<_whitenotifier-9> [amaranth] mithro commented on issue #693: [RFC] Aggregate data structure library - https://github.com/amaranth-lang/amaranth/issues/693#issuecomment-1089100450
<_whitenotifier-9> [amaranth] whitequark commented on issue #693: [RFC] Aggregate data structure library - https://github.com/amaranth-lang/amaranth/issues/693#issuecomment-1089134258
wolfshappen has joined #amaranth-lang
<anuejn> very nice :)
<anuejn> am I correct, assuming that the stuff named `Interface` in https://github.com/amaranth-lang/amaranth/issues/342 is stuff for a separate rfc?
<_whitenotifier-9> [amaranth-lang/amaranth] whitequark created branch rfc-issue-693 https://github.com/amaranth-lang/amaranth/commit/07c6ea5af28095ad329cb70344733c174d113d3b
<_whitenotifier-9> [amaranth] whitequark created branch rfc-issue-693 - https://github.com/amaranth-lang/amaranth
<whitequark> anuejn: correct
<whitequark> hopefully coming soon :)
<whitequark> once those two land, streams!
<_whitenotifier-9> [amaranth] lachlansneff commented on issue #693: [RFC] Aggregate data structure library - https://github.com/amaranth-lang/amaranth/issues/693#issuecomment-1089322514
<_whitenotifier-9> [amaranth] modwizcode opened pull request #694: Add a flag for disabling debug Verilog generation - https://github.com/amaranth-lang/amaranth/pull/694
<cr1901> Something like the following is legal python?
<cr1901> class Float32(data.Struct):
<cr1901> sign: unsigned(1)
<cr1901> (indentation not included)
<lsneff> It is
<cr1901> What does it do? Or rather, when did the "self.sign =" become optional?
<_whitenotifier-9> [amaranth] codecov-commenter commented on pull request #694: Add a flag for disabling debug Verilog generation - https://github.com/amaranth-lang/amaranth/pull/694#issuecomment-1089344347
<abby> that's a class var not an instance var (unless data.Struct does some magic)
<cr1901> Okay I thought a class var still needed an assignment
<cr1901> i.e. "=" and not colon
<abby> see dataclasses in the stdlib
<cr1901> tyvm
<_whitenotifier-9> [amaranth] whitequark reviewed pull request #694 commit - https://github.com/amaranth-lang/amaranth/pull/694#discussion_r843271132
<_whitenotifier-9> [amaranth] whitequark reviewed pull request #694 commit - https://github.com/amaranth-lang/amaranth/pull/694#discussion_r843269372
<_whitenotifier-9> [amaranth] modwizcode reviewed pull request #694 commit - https://github.com/amaranth-lang/amaranth/pull/694#discussion_r843272312
<_whitenotifier-9> [amaranth] whitequark commented on issue #693: [RFC] Aggregate data structure library - https://github.com/amaranth-lang/amaranth/issues/693#issuecomment-1089370238
<whitequark> abby: data.Struct is supposed to do some magic, yeah; same idea as with dataclasses
<abby> cool
<whitequark> it's going to have a metaclass, which makes me sad
<whitequark> but there's no way around that
<_whitenotifier-9> [amaranth] modwizcode synchronize pull request #694: Add a flag for disabling debug Verilog generation - https://github.com/amaranth-lang/amaranth/pull/694
<_whitenotifier-9> [amaranth] whitequark reviewed pull request #694 commit - https://github.com/amaranth-lang/amaranth/pull/694#discussion_r843284360
<_whitenotifier-9> [amaranth] modwizcode synchronize pull request #694: Add a flag for disabling debug Verilog generation - https://github.com/amaranth-lang/amaranth/pull/694
<_whitenotifier-9> [amaranth] modwizcode synchronize pull request #694: Add a flag for disabling debug Verilog generation - https://github.com/amaranth-lang/amaranth/pull/694
<_whitenotifier-9> [amaranth] whitequark commented on pull request #694: Add a flag for disabling debug Verilog generation - https://github.com/amaranth-lang/amaranth/pull/694#issuecomment-1089401945
<_whitenotifier-9> [amaranth] lachlansneff commented on issue #693: [RFC] Aggregate data structure library - https://github.com/amaranth-lang/amaranth/issues/693#issuecomment-1089441675
<anuejn> whitequark: why is data.Struct not a class decorator?
<anuejn> (like dataclass)
<_whitenotifier-9> [amaranth] whitequark commented on issue #693: [RFC] Aggregate data structure library - https://github.com/amaranth-lang/amaranth/issues/693#issuecomment-1089469834
<whitequark> anuejn: needs to have a metaclass so that `class Foo(data.Struct):` lets you do `Shape.cast(Foo)` and thus `Signal(Foo)`
<whitequark> and by that point you might as well just use inheritance for the rest
<whitequark> this is the purely technical reason
<whitequark> the more conceptual reason is that dataclasses are designed to be as unobtrusive as possible, since they're a building block for your own classes (which you want to inherit from whatever) that's as generic as possible, but `data.Struct` and friends are serving a very specific purpose
<whitequark> it's fine to add a bunch of attributes or properties to a `data.Struct` but you probably shouldn't be using that as a generic building block. having to inherit indicates that the derived class is Amaranth's more so than yours
<_whitenotifier-9> [amaranth] lachlansneff commented on issue #693: [RFC] Aggregate data structure library - https://github.com/amaranth-lang/amaranth/issues/693#issuecomment-1089495509
<_whitenotifier-9> [amaranth] whitequark closed pull request #694: Add a flag for disabling debug Verilog generation - https://github.com/amaranth-lang/amaranth/pull/694
<_whitenotifier-9> [amaranth] whitequark closed issue #623: Option to disable debug verilog generation - https://github.com/amaranth-lang/amaranth/issues/623
<_whitenotifier-9> [amaranth-lang/amaranth] whitequark pushed 2 commits to main [+0/-0/±2] https://github.com/amaranth-lang/amaranth/compare/07c6ea5af280...ee9da63287c1
<_whitenotifier-9> [amaranth-lang/amaranth] modwizcode 9eb208c - build/plat: improve handling of get_override().
<_whitenotifier-9> [amaranth-lang/amaranth] modwizcode ee9da63 - build/plat: implement an override disabling debug Verilog generation.
<_whitenotifier-9> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-0/±26] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/2236e47375d6...ee718d47d607
<_whitenotifier-9> [amaranth-lang/amaranth-lang.github.io] whitequark ee718d4 - Deploying to main from @ amaranth-lang/amaranth@ee9da63287c1ea5b478f93ca9624f1449e3c4d0c 🚀
<lsneff> Catherine: Is there a plan in the future to revisit whether there should be a semantic distinction between storing data and moving data in amaranth? e.g. registers vs wires?
<d1b2> <dub_dub_11> isn't that sync vs comb
<lsneff> Pretty much I guess
<lsneff> Sync vs. comb is a great distinction, but it constantly throws me off that they're assigned with the same syntax
<whitequark> Lachlan Sneff: by "registers vs wires" do you mean the Verilog concepts, or the EE concepts?
<lsneff> The EE concept
<lsneff> ~vaguely~
<whitequark> the answer is "no" in either case, but for the latter I'm curious what you would like to see?
<lsneff> If only python was expression rather than statement based
<lsneff> I'm not 100% sure, but I feel like something that feels more like a dataflow programming language for the combinatorial logic would fit what I'm saying
<lsneff> Instead of treating it as a clock domain
<lsneff> That's not actionable though
<lsneff> I'll keep thinking about something concrete
<whitequark> Amaranth is a thin abstraction over decision trees and multiplexers; the difference between a signal assigned in m.d.comb and m.d.sync is that in the former case the freshly computed value is propagated immediately, and in the latter it's buffered through a flop
<lsneff> Right. I understand that
<whitequark> it doesn't quite work that way right now, but most of a Module should translate to one giant `always @*` process computing the `s$next` values for every signal `s`, and then one process per domain (including the comb pseudo-domain) assigning the `s$next` values back to `s`
<whitequark> (the RTLIL backend is doing something silly, inefficient, and vaguely unsound instead; I should fix that)
<_whitenotifier-9> [amaranth] jfng commented on issue #693: [RFC] Aggregate data structure library - https://github.com/amaranth-lang/amaranth/issues/693#issuecomment-1089522558
<modwizcode> I am still not entirely sure how the provided fix actually changes how sound what is happening is
<whitequark> with the "LHS grouping" workaround, you can construct a contrived sequence of statements using Cat() on the LHS to make Amaranth emit an equivalent of `always @* begin c = b; b = a; end`; something along the lines of `m.d.comb += [Cat(z, c).eq(Cat(z, b)), Cat(z, b).eq(Cat(z, a))]`
<modwizcode> That unfortunately makes a lot of sense.
<whitequark> it's kind of tricky to actually get it to do that
<Degi> What is the z for
<whitequark> tying c and b together
<whitequark> m = Module(); with m.If(t): m.d.comb += [Cat(z, c).eq(Cat(z, b)), Cat(z, b).eq(Cat(z, a))] # this does it
<Degi> Does that result in c = b = a? Or what while the if is true that c has the old value of b and b has the value of a or so?
<whitequark> ignore the If, just set t to 1
<Degi> Hmm, shouldn't that be equivant to m.d.comb += [c.eq(a), b.eq(a)]
<whitequark> https://paste.debian.net/1236942/ iverilog tb.v && ./a.out
<whitequark> run it unmodified and with the modifications in the text
<modwizcode> <whitequark> "tying c and b together" <- Technical explanation: Without it, Amaranth splits the assigns into separate processes which has a different behavior. But anything grouped on the LHS of an assignment is currently grouped together so it will end up in a single `always @*` block and trigger this race condition.
<whitequark> s/text/comments/
<whitequark> it's not actually a race
<whitequark> it's a sensitivity issue
<modwizcode> Isn't it a race condition in the sensitivity?
<modwizcode> Well, I guess technically not
<modwizcode> It's only a race in a theoretical sense, there is some actual defined order internally
<whitequark> it's 100% deterministic, just always wrong
<modwizcode> Oh is it actually deterministic?
<whitequark> I like how they fixed this issue in `always_comb`, but made it so that if you run the same two statements in the _reverse_ order, you get a different wrong result
<modwizcode> Amazing
<whitequark> Verilog is infuriating
<modwizcode> Do you actually like VHDL any better though? (Besides the simulation scheduling model being better/actually defined)
<whitequark> I would be working on GHDL if I liked VHDL a bunch
<Degi> Huh it kinda produces the opposite of what I'd expect
<whitequark> whitequark: oh, nevermind, I misread something
<whitequark> they just didn't fix this for `always_comb`. they only fixed the issue where `always @*` would not be run at time 0 if you don't have any regs on the RHS
lf has quit [Ping timeout: 256 seconds]
<whitequark> `always @*` has another maddening issue, where `reg x = 0;` is actually just `reg x; initial x = 0;` and therefore it's racing with `always @* y = x;`
lf has joined #amaranth-lang
<whitequark> > (IEEE 1800-2017 9.2.2.2) The [always_comb] procedure is automatically triggered once at time zero, after all initial and always procedures have been started so that the outputs of the procedure are consistent with the inputs.
<whitequark> okay, at least they fixed that one too
<modwizcode> Oh, because Verilog doesn't define `initial` to run before T=0?
<modwizcode> Well I guess it does now
<whitequark> yeah, it runs at 0 exactly
<whitequark> no, it's more that `always_comb` runs at 0 plus epsilon now
<whitequark> you know, at time 0+0, which is strictly greater than time 0
<modwizcode> I'm sure that everyone using Verilog has a copy of the specification on hand and looks at it frequently to avoid these sorts of issues!!
<whitequark> hahaha sob
<modwizcode> whitequark: How does that differ from saying `initial` and `always` runs at T=0-epsilon?
<mwk> *sigh*
<whitequark> hi mwk
<mwk> 'reg x; initial x = 0;' is racey, 'reg x = 0;' is not
<mwk> and yes I just had to look it up
<modwizcode> We summoned mwk by talking about verilog
<mwk> hi
<mwk> ... yes that works
<mwk> I hate that it works