whitequark changed the topic of #amaranth-lang to: Amaranth hardware definition language ยท weekly meetings on Mondays at 1700 UTC ยท code https://github.com/amaranth-lang ยท logs https://libera.irclog.whitequark.org/amaranth-lang
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 264 seconds]
Degi_ is now known as Degi
bl0x_ has joined #amaranth-lang
bl0x has quit [Ping timeout: 240 seconds]
key2 has quit [Quit: Connection closed for inactivity]
skipwich_ has quit [Quit: DISCONNECT]
skipwich has joined #amaranth-lang
SpaceCoaster has quit [Quit: Bye]
SpaceCoaster has joined #amaranth-lang
leohoo_sdu[m] has joined #amaranth-lang
leohoo_sdu[m] has left #amaranth-lang [#amaranth-lang]
<_whitenotifier-8> [rfcs] josuah commented on pull request #12: rfc: Better definition of clock domains - https://github.com/amaranth-lang/rfcs/pull/12#issuecomment-1545590504
<_whitenotifier-8> [amaranth] josuah commented on pull request #681: Add CRC generator - https://github.com/amaranth-lang/amaranth/pull/681#issuecomment-1545591914
<josuah> hehe: https://github.com/shrine-maiden-heavy-industries/torii-hdl the fork chain never ends!
<josuah> >
<josuah> This branch is 325 commits ahead, 63 commits behind amaranth-lang:main.
<whitequark> yeah I know about Torii
<josuah> it looks like there is some discussion between the two projects ongoing: https://github.com/shrine-maiden-heavy-industries/torii-hdl/commit/ebc54c1c6e16d779041e7f59d4197daed71e1e3f
<josuah> in hope they are interested in keeping a compatible interface for all the code written on top of these
<whitequark> I think it was done because lethalbit has some issue with me personally and chose to approach it in this way
<whitequark> I think it's not really relevant to anything
<whitequark> I talked to lethalbit and they said they expect divergence to occur and are comfortable with it happening
<_whitenotifier-8> [amaranth] whitequark commented on pull request #681: Add CRC generator - https://github.com/amaranth-lang/amaranth/pull/681#issuecomment-1545597458
<josuah> that might allow them to push commits in a free-running wheel style, without the overhead of community discussion and experiment things their way
<_whitenotifier-8> [rfcs] whitequark commented on pull request #12: rfc: Better definition of clock domains - https://github.com/amaranth-lang/rfcs/pull/12#issuecomment-1545603109
<_whitenotifier-8> [rfcs] whitequark edited pull request #12: Better definition of clock domains - https://github.com/amaranth-lang/rfcs/pull/12
<_whitenotifier-8> [rfcs] whitequark edited pull request #12: Better definition of clock domains - https://github.com/amaranth-lang/rfcs/pull/12
<_whitenotifier-8> [rfcs] whitequark edited pull request #12: Better definition of clock domains - https://github.com/amaranth-lang/rfcs/pull/12
<d1b2> <Olivier Galibert> whitequark: happy that you like it
<d1b2> <Olivier Galibert> I tried to write it in an almost-standardese way
<whitequark> it's a good RFC. it's not written how I would it (obviously, since it wasn't me who wrote it) but it has very reasonable suggestions and is written well
<whitequark> in terms of contents, there are a few things I would maybe do differently, but they're surface level
luffy[m]1 has joined #amaranth-lang
<d1b2> <Olivier Galibert> that's what rfcs are for, tuning that kind of surface-level stuff ๐Ÿ™‚
<whitequark> yes
<d1b2> <Olivier Galibert> not clear what's different in practice between torii and amaranth
<d1b2> <Olivier Galibert> Also, w.r.t domains, I suspect Reset needs a rfc of its own. Between sync and async and non-zero reset values, some clarity would be useful
<d1b2> <Olivier Galibert> f.i. CV's FF has an async reset-to-zero, sync reset-to-given-value
<d1b2> <Olivier Galibert> independant, of course
<whitequark> Amaranth does not make a distinction between types of resets
<whitequark> if a flop is reset, it is always reset to the init value
<_whitenotifier-8> [amaranth] whitequark opened pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<d1b2> <Olivier Galibert> Yeah but reality does ๐Ÿ™‚
<d1b2> <Olivier Galibert> plus amaranth does make a difference between sync and async reset
<d1b2> <Olivier Galibert> and there are interesting question like does sync reset take the enable into account?
<whitequark> no
<whitequark> Amaranth defines sync signals to use reset-over-enable and reset to their initial value
<whitequark> the technology mapper has to make that happen
<d1b2> <Olivier Galibert> what does "reset-over-enable" mean?
<whitequark> I don't think there is any FPGA where this isn't possible (you can always emulate sync enable with a LUT) so it will always work
<d1b2> <Olivier Galibert> sync reset on the CV is just a mux in front of the D input fwiw
<whitequark> sure
<_whitenotifier-8> [amaranth] codecov[bot] commented on pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773#issuecomment-1545676822
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark opened issue #774: Drop support for Python 3.7 on 2023-06-27 - https://github.com/amaranth-lang/amaranth/issues/774
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark edited pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<whitequark> please review https://github.com/amaranth-lang/amaranth/pull/773 if you can
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<d1b2> <Olivier Galibert> ok, I have an extremely-urgent-I'm-so-late-oh-my thing to do then I'll look after
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
SpaceCoaster has quit [Ping timeout: 256 seconds]
SpaceCoaster has joined #amaranth-lang
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark pushed 1 commit to tmp [+0/-0/ยฑ1] https://github.com/amaranth-lang/rfcs/commit/5232ae5eb816
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark 5232ae5 - RFC #4: amend behavior of enumerations with const-castable members.
<_whitenotifier-8> [rfcs] whitequark created branch tmp - https://github.com/amaranth-lang/rfcs
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark created branch tmp2 https://github.com/amaranth-lang/rfcs/commit/5232ae5eb816e2849d5e11f29966455728aa28bb
<_whitenotifier-8> [rfcs] whitequark created branch tmp2 - https://github.com/amaranth-lang/rfcs
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark deleted branch tmp
<_whitenotifier-8> [rfcs] whitequark deleted branch tmp2 - https://github.com/amaranth-lang/rfcs
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark deleted branch tmp2
<_whitenotifier-8> [rfcs] whitequark deleted branch tmp - https://github.com/amaranth-lang/rfcs
<_whitenotifier-8> [rfcs] whitequark opened pull request #13: RFC #4: amend behavior of enumerations with const-castable members - https://github.com/amaranth-lang/rfcs/pull/13
SpaceCoaster has quit [Ping timeout: 265 seconds]
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark pushed 2 commits to main [+0/-0/ยฑ2] https://github.com/amaranth-lang/rfcs/compare/04b2370973eb...e5d83de15390
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark 5232ae5 - RFC #4: amend behavior of enumerations with const-castable members.
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark e5d83de - RFC #4: amend behavior of enumerations with const-castable members (#13)
<_whitenotifier-8> [rfcs] whitequark closed pull request #13: RFC #4: amend behavior of enumerations with const-castable members - https://github.com/amaranth-lang/rfcs/pull/13
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-0/ยฑ4] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/dec4385b3913...6ec3d481a96e
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark 6ec3d48 - Deploying to main from @ amaranth-lang/rfcs@e5d83de15390aa61631b38faaa731841f4209a9d ๐Ÿš€
<FL4SHK> making pretty good progress on my GCC port to my custom processor that I'll be implementing in Amaranth
<FL4SHK> I got libgcc to compile
SpaceCoaster has joined #amaranth-lang
<FL4SHK> ...granted I did co-design the instruction set and the GCC port
<FL4SHK> so some instructions are there for the sake of easier implementation of the GCC backend
<FL4SHK> though I do think the instructions like that are good to have
<whitequark> nice
<whitequark> oh, would you be willing to take a look at the document I wrote?
<FL4SHK> which document is that?
<FL4SHK> I'd be willing to look at it
<FL4SHK> oh nice
<FL4SHK> this stuff
<FL4SHK> yeah, I'm very interested in this stuff
<FL4SHK> ooh, introspection
<FL4SHK> boy it'd be nice if HDLs like VHDL and SV had that kind of thing
<FL4SHK> but I don't know if I'll be using those HDLs any more after I transfer to software dev at work
<whitequark> so one thing that will be implementable with this is fixnums
<whitequark> I think those should actually be in the stdlib
<whitequark> fixnums and complex numbers
<FL4SHK> what is fixnums, is that for fixed-point arithmetic?
<whitequark> oh sorry, yes, fixpoint numbers
<whitequark> s/fixpoint/fixed-point/
<whitequark> crossed a few wires
<FL4SHK> those are good to have in the language directly
<FL4SHK> or, the library, as the case may be... but Amaranth is a lot like its own language
<whitequark> Amaranth is a language
<FL4SHK> sounds good
<whitequark> (which is implemented as a library)
<FL4SHK> I can see that
<FL4SHK> how exactly does `Union` work
<whitequark> same as in C
<FL4SHK> hm, so it just re-uses the fields as other types
<FL4SHK> C unions unfortunately involve UB...
<whitequark> yeah
<FL4SHK> I don't use them in C or C++ because of that
<whitequark> but... that's the entire point of a union
<FL4SHK> is it?
<FL4SHK> hm
<FL4SHK> I just have been using `memcpy` or `memset` instead
<FL4SHK> which is fine if there are no virtual methods in C++
<whitequark> in C and C++ this is preferable for UB reasons
<whitequark> however in HDL you might have a situation where e.g. the same register is interpreted differently depending on a type field
<FL4SHK> yeah, that's true
<whitequark> if you have a functional block that sends a command to another, defining a union is a good way to let the compiler calculate all the sizes for you
<whitequark> i.e. pick the size of the biggest command (plus command discriminator) for the command bus size
<whitequark> I should actually describe that
<FL4SHK> that sounds good
<whitequark> there's an upcoming change that I think might make your processor a little bit more elegant
<_whitenotifier-8> [amaranth] whitequark opened pull request #775: RFC 4: accept any constant-castable expression as enumeration value - https://github.com/amaranth-lang/amaranth/pull/775
<d1b2> <Olivier Galibert> you can have 16 bits that can be RGB 656, ARGB 1555, YUV 4.2.2 for instance. You can have amaranth unions being non-UB because the bit representation is explicit, and they end up very nice semantic converters
<whitequark> yeah
<whitequark> FL4SHK: check out the second example: http://laptop.bobcat-little.ts.net:8000/stdlib/enum.html
<_whitenotifier-8> [amaranth] whitequark commented on pull request #759: add Lattice Nexus vendor platform (using nextpnr-nexus and prjoxide) - https://github.com/amaranth-lang/amaranth/pull/759#issuecomment-1545885006
<_whitenotifier-8> [amaranth] codecov[bot] commented on pull request #775: RFC 4: accept any constant-castable expression as enumeration value - https://github.com/amaranth-lang/amaranth/pull/775#issuecomment-1545885596
<d1b2> <Olivier Galibert> Ok, I survived, let's have a look at your doc now
<d1b2> <Olivier Galibert> i_color = data.View(rgb565_layout)
<d1b2> <Olivier Galibert> is i_color a Signal?
<whitequark> it's a View that wraps a Signal
<d1b2> <Olivier Galibert> how do you access its reset properties?
<whitequark> data.View(rgb565_layout, reset={"red": 123})
<whitequark> this is explicitly in the doc: https://whitequark.github.io/amaranth/docs/rfc-1-doc/stdlib/data.html#amaranth.lib.data.View
<whitequark> > When creating a view, either only the target argument, or any of the name, reset, reset_less, attrs, or decoder arguments may be provided. If a target is provided, it is used as the underlying value. Otherwise, a new Signal is created, and the rest of the arguments are passed to its constructor.
<d1b2> <Olivier Galibert> ok yeah, that's later in the doc
<d1b2> <VA3TEC-Mikek-14362> Please forgive me, what does UB stand for? Union binary?
<d1b2> <Olivier Galibert> Undefined Behaviour
<d1b2> <VA3TEC-Mikek-14362> OK thanks.
<d1b2> <Olivier Galibert> I didn't think value-castable meant writeable
<whitequark> it can be writeable if it has .eq
<whitequark> Amaranth places no restrictions here and data.View just forwards .eq to the wrapped value
<d1b2> <Olivier Galibert> I'm trying to feel my way aroudn the named concepts there. If Layout is a Shape, can I write Signal(some_layout) and ignore the existence of View?
<d1b2> <Olivier Galibert> or are some shapes signal-compatible and some not?
<whitequark> this is a very good question. all shapes are signal-compatible, however right now Signal(some_layout) will always return a Signal, not a View
<whitequark> sorry, I'm trying to find something I've misplaced
<d1b2> <Olivier Galibert> so you need the view to get the access attributes?
<whitequark> yes
<whitequark> anyway, there was the idea that Signal(layout) should return a View instance
<whitequark> oh right!
<whitequark> so RFC 9 would allow you to pass a dict as a Signal reset value, but it will still return a Signal
<whitequark> we would need a new RFC to let the Signal() constructor return a View
<d1b2> <Olivier Galibert> I'm not certain whether the View really adds semantics or is just an implementation detail that's visible?
<whitequark> I dunno what "adds semantics" means
<whitequark> the view is what knows how to slice the bit container to give you fields
<whitequark> the View is also what you subclass to add methods on your custom data structures
<whitequark> you can't subclass Signal, for good reason
<d1b2> <Olivier Galibert> yeah, but the fields are already in the shape which is taken by the Signal, so arguably Signal could be less dumb and handle slicing itself
<whitequark> no
<whitequark> that would mean we can never add another method on Signal without breaking backwards compat
<d1b2> <Olivier Galibert> So the semantics added is the Signal-wrapping capability which allows you to be more flexible there
<whitequark> I think so
<whitequark> I mean, it's also important that amaranth.lib.data is completely independent from the core language
<d1b2> <Olivier Galibert> Oh yeah, that is a good reason
<whitequark> if you don't like it you can reimplement it yourself
<whitequark> the core language gives you enough hooks to do so
<whitequark> there's been many requests to have Signal(layout) return a view
<whitequark> so it probably needs to be done, I'll draft an RFC later
<d1b2> <Olivier Galibert> Docs-wise, "The View is value-castable and can be used anywhere a plain value can be used. For example, it can be assigned to in the usual way" doesn't work for me, since a Const is a value and value-castable and can't be assigned to
<d1b2> <Olivier Galibert> If you do that you make the core language dependant on lib.data\
<whitequark> nope
<whitequark> Layout becomes callable, and if you call it, it wraps the value you give it
<d1b2> <Olivier Galibert> ok, real nice
<whitequark> we already have that behavior and it's used in recursive accesses through the view
<whitequark> like x.y.z
<whitequark> so now we only need to teach Signal to do it
<whitequark> and then we can remove the weird and complicated forwarding logic in data.View that duplicates all the Signal's arguments
<whitequark> normally people would go for inheritance here, but I forbid that for a good reason. instead we will now have composition
<whitequark> which is a lot more robust than inheritance
<d1b2> <Olivier Galibert> sure is
<d1b2> <Olivier Galibert> ok, there's something that's tickling me and it's the dual-functionality of view, that is providing both wrapping and fields
<d1b2> <Olivier Galibert> is "wrapping signal" some kind of core functionality in general, and is it documented?
<whitequark> it's not wrapping Signal, really
<whitequark> it's wrapping any bit containe
<whitequark> s/containe/container/
<whitequark> the constructor, right now, also happens to make a Signal if you don't give it any existing bit container
<d1b2> <Olivier Galibert> I'm looking at brightness and wonder why I can't have that on non-fielded data, essentially
<whitequark> but if we go with this new RFC I've just proposed, then View doesn't have to know anything about Signal
<whitequark> it would only know things about wrapping bit containers
<whitequark> (also, a layout becomes something like a type for a signal, which feels good to have this way)
<whitequark> d1b2: you can. you can make a freestanding function
<whitequark> you can also make your own ValueCastable wrapping any arbitrary expression and giving it .brightness()
<whitequark> this is exactly what data.View is doing
<whitequark> that's it. that's the wrapper
<d1b2> <Olivier Galibert> very interesting
<d1b2> <Olivier Galibert> ValueCastable is way more than what is written on the tin
<_whitenotifier-8> [amaranth] whitequark closed pull request #775: RFC 4: accept any constant-castable expression as enumeration value - https://github.com/amaranth-lang/amaranth/pull/775
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark pushed 2 commits to main [+0/-0/ยฑ6] https://github.com/amaranth-lang/amaranth/compare/5f6b36e91f44...4398575322bd
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark bf8bbb0 - lib.enum: check member value shapes before subclassing. NFCI
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark 4398575 - lib.enum: accept any const-castable expression as member value.
<_whitenotifier-8> [amaranth] whitequark closed issue #755: Implement RFC 4: Const-castable expressions - https://github.com/amaranth-lang/amaranth/issues/755
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-0/ยฑ41] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/6ec3d481a96e...18de9e88d27b
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark 18de9e8 - Deploying to main from @ amaranth-lang/amaranth@4398575322bd07a03732f787b798daaa83107303 ๐Ÿš€
<d1b2> <Olivier Galibert> hmmm, why is Union a View and not a Shape (add castable wherever you want)
<whitequark> it's both
<whitequark> Struct and Union subclasses themselves are shape-castable, and their instances are value-castable
<d1b2> <Olivier Galibert> errr, why do you have both Struct and StructLayout then?
<d1b2> <Olivier Galibert> (sorry, still trying to parse it all)
<d1b2> <Olivier Galibert> ah duh you have UnionLayout too
<whitequark> yeah
<d1b2> <Olivier Galibert> ok, *Layout are the "core" shape structures, and Struct/Union/Array are facilitators/shortcuts
<whitequark> there's no Array
<d1b2> <Olivier Galibert> not Array then
<whitequark> but yes
<d1b2> <Olivier Galibert> Yeah, I wouldn't have written the doc that way (surprise! I'm not you!), but I get the gist now, and it's real nice
<_whitenotifier-8> [amaranth] whitequark opened pull request #776: lib.data: implement extensibility as specified in RFC 8 - https://github.com/amaranth-lang/amaranth/pull/776
<d1b2> <Olivier Galibert> so lib.interface is gonna build on that to handle directionality and connectivity?
<whitequark> yes
<d1b2> <Olivier Galibert> Then of course I want it yesterday ๐Ÿ˜‰
<d1b2> <Olivier Galibert> I really need to write my version of the documentation so that people who think like me have an easier time at it
<d1b2> <Olivier Galibert> (I have no intention of forking the implementation, mind you)
<whitequark> what is unclear?
<d1b2> <Olivier Galibert> That a ValueCastable is a wrapper over the complete properties of a Signal (reset, bindness, storage) and not just a read-time transformation
<whitequark> ValueCastable is not tied to Signal in any way
<whitequark> I see your point though
<_whitenotifier-8> [amaranth] codecov[bot] commented on pull request #776: lib.data: implement extensibility as specified in RFC 8 - https://github.com/amaranth-lang/amaranth/pull/776#issuecomment-1545956712
<whitequark> right now there is no API documentation for ValueCastable at all, only the reference documentation (which doesn't really explain what it is from a Python perspective)
<whitequark> we'll have that eventually
<whitequark> and it should be written in a way that ensures people who think like you (and others too) understand it
<whitequark> Sarayan: you can actually stuff two signals into a ValueCastable if you want
<whitequark> data.View(layout, Cat(sig1, sig2)) is legal
<d1b2> <Olivier Galibert> That the layouts are building blocks of shapes, and signal take shapes but only cares about them minimally. You need a View (which is a ValueCastable as per the previous definition) to actually manifest its properties
<d1b2> <Olivier Galibert> In fact Signals, semantically, are only one simple version of ValueCastable
<whitequark> no, that's not right
<whitequark> Signals are Values
<d1b2> <Olivier Galibert> (implementation is another issue, but as in my domains rfc I really, really don't want to care about implementation)
<whitequark> hm
<whitequark> we don't have the luxury of not caring about implementation
<whitequark> these RFCs provide extensibility points for user code, which specifically extends the implementation (in a robust way)
<whitequark> extending the implementation is the point
<whitequark> that's what we're defining
<whitequark> it's different for clock domains because clock domains aren't extensible by user code. they just exist
<d1b2> <Olivier Galibert> Well, the way I tend to see those concepts is that, for me, an object is characterized by what I can do with it (I'm very formal mathematics there)
<whitequark> you have a few ways to interact with them, take it or leave
<whitequark> sure
<whitequark> so the whole point of ValueCastable is that it's something that lets you do value-like things with it, but is not a Value
<whitequark> (ValueCastable the class)
<d1b2> <Olivier Galibert> And a core object in amaranth is Mumble, when Mumble has a shape, a reset value, a reset_less characteristic, has .eq and can bind to domains
<whitequark> there is also value-castable (the language guide concept) which includes values, because there the difference doesn't matter
<whitequark> it's horribly confusing to be honest
<josuah> @Oliver Galibert: here is what I do to work around for now (untested until very soon):
<_whitenotifier-8> [rfcs] josuah commented on pull request #2: Interface definition library - https://github.com/amaranth-lang/rfcs/pull/2#issuecomment-1545963606
<josuah> ^ that message
<whitequark> but I think we have to live with isinstance(Signal(), ValueCastable) returning False
<d1b2> <Olivier Galibert> Oh sure, but that enters the 'implementation details' territory in my view of the world
<whitequark> it's not an implementation detail because it's visible to everyone using Amaranth
<whitequark> imagine asking a newcomer's question: "how do I tell if something is value-castable?"
<whitequark> and isinstance(x, ValueCastable) is the wrong answer
<whitequark> the right answer is Value.cast(x) and catch a TypeError
<whitequark> which is very unintuitive
<whitequark> s/asking/answering/
<d1b2> <Olivier Galibert> My answer would tend to be "what are you doing that you would ever have to ask yourself this question?" ๐Ÿ˜‰
<whitequark> I wish it was an implementation detail, but I could not make it work that way
<whitequark> compare to clock domain implementation, which will be visible to exactly the Amaranth maintainers and nobody else
<d1b2> <Olivier Galibert> hmmm, still playing with semantics, what happens if you have s = Struct(a=5, b=5), m.d.domain1 += s.a.eq(42), m.d.domain2 += s.b.eq(666) and domain1 and 2 are not compatible?
<d1b2> <Olivier Galibert> (I know the struct syntax is bullshit, but you get the gist)
<d1b2> <Olivier Galibert> (damn, it would be a ncie syntax though)
<whitequark> it's nominated for the next meeting but I think it's unworkable
<d1b2> <Olivier Galibert> rgb565 = StructLayout(r=5, g=6, b=5) weee
<whitequark> oh you can do almost that
<whitequark> hold on, are messages dropped again
<whitequark> yes. matrix is goddamn awful
<whitequark> so I missed this: > 16:00 <d1b2> <Olivier Galibert> And a core object in amaranth is Mumble, when Mumble has a shape, a reset value, a reset_less characteristic, has .eq and can bind to domains
<whitequark> and also this: > 16:05 <d1b2> <Olivier Galibert> hmmm, still playing with semantics, what happens if you have s = Struct(a=5, b=5), m.d.domain1 += s.a.eq(42), m.d.domain2 += s.b.eq(666) and domain1 and 2 are not compatible?
<d1b2> <Olivier Galibert> annoying
<whitequark> for the 1st one: is Mumble here referring to Signal specifically or just "the" Amaranth type?
<whitequark> for the 2nd one: the same as if you assign half of a signal from one domain and another half from another
<whitequark> which is, hm, exception right now I believe
<d1b2> <Olivier Galibert> 1. The concept, which is shared by Signal and ValueCastable at least
<d1b2> <Olivier Galibert> 2. Is it going to work out with Interfaces to require everything in it to be on (the same/compatible) domains?
<whitequark> 1. ValueCastable does not in general have reset_less or reset or .eq
<d1b2> <Olivier Galibert> Well, substitute with View then for instance
<whitequark> 2. with Interfaces you can have individual ports be in different domains
<d1b2> <Olivier Galibert> Ah, so an interface is not going to be over a struct but over a collection of structs
<d1b2> <Olivier Galibert> Yeah, I have a difficulty with ValueCastable being either readonly or readwrite (or maybe rvalue and lvalue) depending on... not entirely sure what it depends on
<d1b2> <Olivier Galibert> The semantics are a little moddy
<d1b2> <Olivier Galibert> I understand where it comes from, ValueCastable is essentially defined by having as_value, which allows it to appear in a read context in place of a signal/value, and if you add .eq on a derivative you can make it inherit the properties of a writeable thing you've tucked in the object
<d1b2> <Olivier Galibert> e.g. the Signal wrapped in the View
<d1b2> <Olivier Galibert> because Python-wise you only really need the read aspect and have the .eq return a correct type
<d1b2> <Olivier Galibert> ok, I have some shopping to do before it's too late, much thanks for the discussion, I understand many more things now
<FL4SHK> whitequark: let me look at that
<FL4SHK> so
<FL4SHK> I can't seem to load the page
<whitequark> you took too long ^^; it was shared from my laptop and now it's not I guess
<whitequark> let me fix that
<FL4SHK> oh sorry, I was working
<whitequark> this link won't expire
<FL4SHK> cool
<whitequark> jfng: are you getting any of my private messages in the matrix room?
<jfng[m]> Catherine: some, not all
<whitequark> can you respond with the last one you got (in PM)?
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark opened pull request #777: Improve handling of documentation on CI - https://github.com/amaranth-lang/amaranth/pull/777
<FL4SHK> whitequark: so you think I should use an `enum.Enum` for instruction encodings? Yeah, I've done that before
<whitequark> yep
<FL4SHK> in SystemVerilog though
<whitequark> well, amaranth.lib.enum.Enum
<FL4SHK> oh
<whitequark> which is a drop in compatible replacement
<whitequark> but it lets you specify the shape
<FL4SHK> that's neat
<whitequark> and it lets you use Cat() in enum member values
<whitequark> like constexpr basically
<FL4SHK> that's neat
<FL4SHK> I like `constexpr` a lot
<whitequark> Amaranth now has constexpr!
<FL4SHK> ooh
<_whitenotifier-8> [amaranth] whitequark closed pull request #777: Improve handling of documentation on CI - https://github.com/amaranth-lang/amaranth/pull/777
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark pushed 3 commits to main [+0/-0/ยฑ3] https://github.com/amaranth-lang/amaranth/compare/4398575322bd...61a8f213190f
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark 4f70cd6 - CI: split document and publish steps, and skip publish in forks.
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark 2d379d0 - CI: publish docs to GitHub pages in forks, per branch.
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark 61a8f21 - CI: simplify publish-docs job.
<FL4SHK> does Amaranth support anything like a VHDL/SystemVerilog `function`?
<whitequark> you can use constant expressions in switch case values too
<whitequark> no more having to glue enums together by hand to write an instruction decoder
<whitequark> is that a pure function?
<FL4SHK> yeah
<FL4SHK> at least, the VHDL `function`s are pure
<FL4SHK> I think...
<whitequark> but you can have if/else type constructs in it?
<FL4SHK> yeah
<whitequark> then there isn't (yet)
<whitequark> an RFC needs to be written
<FL4SHK> I will be happy to see that get implemented
<FL4SHK> because it's something I'll use once it's in the language
<whitequark> I think it will be basically a decorator, something like... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/69950214da712ec8001e23a0d3d04e57b34e4384>)
<FL4SHK> where can I read about `constexpr` in Amaranth?
<FL4SHK> ooh
<FL4SHK> very neat
<whitequark> thank you ^^
<whitequark> there's also something akin to overloaded constructors now: https://amaranth-lang.org/rfcs/0009-const-init-shape-castable.html
<FL4SHK> yw
<whitequark> the 0.4 release will feature vastly improved language extensibility
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark pushed 1 commit to main [+0/-0/ยฑ1] https://github.com/amaranth-lang/amaranth/compare/61a8f213190f...a5ffa38e643c
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark a5ffa38 - CI: fix publish-docs job.
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+26/-0/ยฑ27] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/18de9e88d27b...21e9c77421bb
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark 21e9c77 - Deploying to main from @ amaranth-lang/amaranth@a5ffa38e643c73409ff392b23716f1ac434bb538 ๐Ÿš€
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #776: lib.data: implement extensibility as specified in RFC 8 - https://github.com/amaranth-lang/amaranth/pull/776
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #776: lib.data: implement extensibility as specified in RFC 8 - https://github.com/amaranth-lang/amaranth/pull/776
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark pushed 1 commit to main [+6/-0/ยฑ4] https://github.com/amaranth-lang/amaranth/compare/a5ffa38e643c...68e292c6810e
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark 68e292c - lib.data: add reference documentation.
<_whitenotifier-8> [amaranth] whitequark closed pull request #773: lib.data: add reference documentation - https://github.com/amaranth-lang/amaranth/pull/773
<whitequark> ๐ŸŽ‰
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+14/-0/ยฑ37] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/21e9c77421bb...105bc341a7c7
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark 105bc34 - Deploying to main from @ amaranth-lang/amaranth@68e292c6810e6c7034d8b6122820feeb46a5b20c ๐Ÿš€
<_whitenotifier-8> [amaranth] whitequark synchronize pull request #776: lib.data: implement extensibility as specified in RFC 8 - https://github.com/amaranth-lang/amaranth/pull/776
<_whitenotifier-8> [amaranth] whitequark closed pull request #776: lib.data: implement extensibility as specified in RFC 8 - https://github.com/amaranth-lang/amaranth/pull/776
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark pushed 1 commit to main [+0/-0/ยฑ3] https://github.com/amaranth-lang/amaranth/compare/68e292c6810e...7166455a6a23
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark 7166455 - lib.data: implement extensibility as specified in RFC 8.
<whitequark> ๐ŸŽ‰๐ŸŽ‰
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-0/ยฑ30] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/105bc341a7c7...9d9e7da6b9ad
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark 9d9e7da - Deploying to main from @ amaranth-lang/amaranth@7166455a6a23ce3a7b6808eada147567df927bb4 ๐Ÿš€
<_whitenotifier-8> [amaranth] whitequark closed issue #772: Implement RFC 8: Aggregate data structure extensibility - https://github.com/amaranth-lang/amaranth/issues/772
<FL4SHK> whitequark: what are you thinking of for language extensibility?
<whitequark> I think the existing story is pretty good already, where arbitrary new values can be introduced and work reasonably seamlessly
<FL4SHK> I see
<FL4SHK> that is very cool
<whitequark> the only thing that would make it better is arbitrary new control structures, which should be doable as well
<FL4SHK> oh dang
<whitequark> but the need is much lower
<FL4SHK> I don't even know what I would do with that
<whitequark> it would be nice to implement e.g. FSM in library code
<FL4SHK> I see
<_whitenotifier-8> [rfcs] whitequark opened pull request #14: RFC #9: remove pointless `Const.cast(obj, shape)` overload - https://github.com/amaranth-lang/rfcs/pull/14
<_whitenotifier-8> [rfcs] whitequark closed pull request #14: RFC #9: remove pointless `Const.cast(obj, shape)` overload - https://github.com/amaranth-lang/rfcs/pull/14
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark pushed 2 commits to main [+0/-0/ยฑ2] https://github.com/amaranth-lang/rfcs/compare/e5d83de15390...7d5dbff82ff0
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark 440c003 - RFC #9: remove pointless `Const.cast(obj, shape)` overload.
<_whitenotifier-8> [amaranth-lang/rfcs] whitequark 7d5dbff - RFC #9: remove pointless `Const.cast(obj, shape)` overload (#14)
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-0/ยฑ4] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/9d9e7da6b9ad...152ccd1c2d37
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark 152ccd1 - Deploying to main from @ amaranth-lang/rfcs@7d5dbff82ff09b5dc6ba14f76489e23b3f34b9be ๐Ÿš€
bl0x has joined #amaranth-lang
bl0x_ has quit [Ping timeout: 240 seconds]
<_whitenotifier-8> [amaranth] whitequark opened issue #778: Improve type safety of enumerations - https://github.com/amaranth-lang/amaranth/issues/778
<_whitenotifier-8> [amaranth] whitequark closed issue #748: Implement RFC 1 "Aggregate data structure library" - https://github.com/amaranth-lang/amaranth/issues/748
<_whitenotifier-8> [amaranth] whitequark commented on issue #666: Should build products be documented and how? - https://github.com/amaranth-lang/amaranth/issues/666#issuecomment-1546323819
<_whitenotifier-8> [amaranth] whitequark closed issue #666: Should build products be documented and how? - https://github.com/amaranth-lang/amaranth/issues/666
<_whitenotifier-8> [amaranth] whitequark opened pull request #779: Implement RFC 9: Constant initialization for shape-castable objects - https://github.com/amaranth-lang/amaranth/pull/779
<_whitenotifier-8> [amaranth] whitequark closed pull request #779: Implement RFC 9: Constant initialization for shape-castable objects - https://github.com/amaranth-lang/amaranth/pull/779
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark pushed 2 commits to main [+0/-0/ยฑ8] https://github.com/amaranth-lang/amaranth/compare/7166455a6a23...54d5c4c047f0
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark ea5a150 - lib.data: fix documentation style. NFC
<_whitenotifier-8> [amaranth-lang/amaranth] whitequark 54d5c4c - Implement RFC 9: Constant initialization for shape-castable objects.
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-0/ยฑ30] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/152ccd1c2d37...1d442e72f598
<_whitenotifier-8> [amaranth-lang/amaranth-lang.github.io] whitequark 1d442e7 - Deploying to main from @ amaranth-lang/amaranth@54d5c4c047f0d8dd010a599dc1fccbeafe026995 ๐Ÿš€
<_whitenotifier-8> [rfcs] whitequark opened pull request #15: Lifting shape-castable objects - https://github.com/amaranth-lang/rfcs/pull/15
<_whitenotifier-8> [rfcs] whitequark edited pull request #15: Lifting shape-castable objects - https://github.com/amaranth-lang/rfcs/pull/15
<_whitenotifier-8> [rfcs] whitequark commented on pull request #6: CRC generator - https://github.com/amaranth-lang/rfcs/pull/6#issuecomment-1546437025
lf has quit [Ping timeout: 240 seconds]
<_whitenotifier-8> [rfcs] adamgreig commented on pull request #6: CRC generator - https://github.com/amaranth-lang/rfcs/pull/6#issuecomment-1546439745
lf has joined #amaranth-lang
<_whitenotifier-8> [rfcs] whitequark commented on pull request #6: CRC generator - https://github.com/amaranth-lang/rfcs/pull/6#issuecomment-1546440506