whitequark[cis] changed the topic of #amaranth-lang to: Amaranth hardware definition language · weekly meetings: Amaranth each Mon 1700 UTC, Amaranth SoC each Fri 1700 UTC · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang · Matrix #amaranth-lang:matrix.org
alanvgreen has quit [*.net *.split]
crzwdjk has quit [*.net *.split]
adamgreig[m] has quit [*.net *.split]
_catircservices has quit [*.net *.split]
_whitelogger has joined #amaranth-lang
sauce has joined #amaranth-lang
notgull has joined #amaranth-lang
marcan has joined #amaranth-lang
FFY00 has joined #amaranth-lang
chaoticryptidz has joined #amaranth-lang
mindw0rk has joined #amaranth-lang
<whitequark[cis]1> <rxvoid[m]> "Hi, I was experimenting a bit..." <- it's not intentional I guess; it's just how the implementation is. does using a $adff there cause problems for you?
<whitequark[cis]1> <mcc111[m]> "From the amaranth sample project..." <- it's a *variable annotation*; not a *type annotation*
<cr1901> oops
<cr1901> https://github.com/cr1901/efbutils/blob/amcli/tests/test_amaranth_gen.py Here is an example of how one might test the Amaranth CLI generation (which in fact did find a bug in my code, and will probably find more later)
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 258 seconds]
Degi_ is now known as Degi
<_whitenotifier-1> [amaranth] whitequark reviewed pull request #904 commit - https://github.com/amaranth-lang/amaranth/pull/904#discussion_r1320908938
<whitequark[cis]1> cr1901: ohh cool! yeah this usage is def supported
<whitequark[cis]1> <whitequark[cis]1> "it's a *variable annotation..." <- to expand on this a bit, there's been some disagreement in the python community whether the annotations are only for types, or for arbitrary stuff
<whitequark[cis]1> a lot of people seem to strongly think they are only for types
<whitequark[cis]1> i disagree, chiefly because python types are kind of a real pain and i don't want to be dealing with them
* cr1901 nods
<cr1901> Re: your comment, I don't have a good solution to the duplicate names problem. I suppose we can punt to the user w/ a text replacement w/ a pipe/sed expr (eww :P).
<cr1901> This is also a problem for the fusesoc generation now that I think about it. I just didn't experience it b/c no duplicate module names at all in all src files
<whitequark[cis]1> yep
<cr1901> can a list of names be passed to the name= parameter which can invoke yosys rename pass (Idk if the amaranth wasm yosys has rename)?
<whitequark[cis]1> connect_rpc has a bespoke name mangling pass
<whitequark[cis]1> cr1901: it cannot
<whitequark[cis]1> how would a list work anyway?
<cr1901> dict... operating at 20% today
<cr1901> {"old": "new",...}
<whitequark[cis]1> sounds like annoying busywork
<whitequark[cis]1> (for the API consumer)
<cr1901> Well yes. I can think of one case where explicit renaming is required if you use the class name to derive the module name: I have Python EFB class. When that becomes EFB() module in Verilog source code, it conflicts with EFB primitive that diamond understands.
<cr1901> Is reusing the connect_rpc name mangling pass what you have in mind?
<whitequark[cis]1> what probably needs to happen is that module names need to be mangled (prepended with the toplevel name at least) in rtlil backend
<whitequark[cis]1> cr1901: that's not very reusable, this would be new back.rtlil functionality
<cr1901> Ahhh
<cr1901> Also, to be clear, I'm very happy w/ the refactors I've been able to make so far
<cr1901> The name-mangling should work well- user provides a name= parameter to verilog.convert, which allows the user to instantiate the same module (with multiple child modules) in more than one way without any name collisions
<cr1901> e.g. fifo_8x16 vs fifo_16x16
<whitequark[cis]1> yeah
jjsuperpower has joined #amaranth-lang
<cr1901> whitequark[cis]1: The refactor is nearly complete, btw. I have only one other question.
<whitequark[cis]1> yeah?
<cr1901> https://github.com/cr1901/efbutils/blob/amcli/src/efbutils/ufm/reader/efb.py#L320-L337 I want to get rid of this function. It exists solely because EFBConfig and UFMConfig's constructors cannot accept a str. A string is the wrong arity for their __init__() functions (they are dataclasses). 1/2
<cr1901> Can you think of any resource besides __init__(**kwargs) to distinguish "str" input and "normal" dataclass params
<cr1901> ?
<cr1901> recourse*
<whitequark[cis]1> can you override init in a dataclass?
<cr1901> Yes
<cr1901> I just find **kwargs to be a rather blunt workaround for the lack of multiple constructors in Python
<whitequark[cis]1> seems fine to me
<whitequark[cis]1> it's used a few times in amaranth
<cr1901> Alright, I'll do that then. At least if other ppl run into the same issue of "I need two constructors- one for amaranth CLI, one for everything else", they'll know what to do
<cr1901> @dataclass(init=False) and "just defining your own __init__.py" prevent an init from being created
<cr1901> just defining an __init__()*
<cr1901> I don't even really use any special dataclass functionality. It's just documenting intent :P
<cr1901> Oooooh I just realized... when you do __init__(self, *, foo, bar), the "*" means "this is the rest of the non keyword args, but I'm not bothering to give a binding"
<whitequark[cis]1> no
<whitequark[cis]1> * separates keyword-only arguments
<whitequark[cis]1> s/*/\*/
<cr1901> It seems you can do __init__(self, *args, foo, bar) as well. How is what you're saying different from my interpretation?
<cr1901> If I do "__init__(self, *args, *, foo, bar)", that is a syntax error according to Pylance: "* can only appear once"
<cr1901> huh... I see :D
<cr1901> whitequark[cis]1: Okay I figured it out (ignore the docstring): http://gopher.wdj-consulting.com:70/paste/10ae08f7-5bf0-4d8b-bf7c-d0af752e46a3.txt
Luke has quit [Quit: o/ 3w 6d 23h 59m 18s]
Luke has joined #amaranth-lang
jjsuperpower has quit [Ping timeout: 245 seconds]
Wolly has joined #amaranth-lang
cr1901_ has joined #amaranth-lang
cr1901 has quit [Ping timeout: 240 seconds]
Wolly has quit [Quit: Quit]
jer_emy[m] has joined #amaranth-lang
<jer_emy[m]> is there some way to print out all of the possible resources/pins defined for a particular board? To put it another way, for the platform.request(...) function, is there some way to get a list of all of the valid ... ?
jfng[m] has joined #amaranth-lang
<jfng[m]> .jer_emy: `list(platform.resources)` ?
<jer_emy[m]> yep that works 🙂
<jer_emy[m]> for some reason I thought that the platform object only generated the resources at compile time
<jer_emy[m]> thank you
FFY00 has quit [Ping timeout: 258 seconds]
FFY00 has joined #amaranth-lang
ovf has quit [Server closed connection]
ovf has joined #amaranth-lang
cr1901_ is now known as cr1901
<cr1901> Is today a bank holiday or otherwise no meeting?
<galibert[m]> Otherwise, I guess
<galibert[m]> Hope Catherine is ok
<jfng[m]> afaik catherine is unavailable atm, due to being in a train without a laptop charger and low battery
<galibert[m]> Ok, at least that's not bad
<rxvoid[m]> Thanks Catherine. Actually I found this while writing a SPI interface for my project where the bit banging is done in a domain clocked on SCK, using CS as (async) reset. Some signals need to be reset-less because the transfer to the main domain can occur when CS is already deasserted. Having said that, it's non-critical hobbyist stuff and I could also require the host to keep CS asserted a bit longer. But if you believe that
<rxvoid[m]> honoring the reset_less can make sense, I can propose a pull request with the small change I made to make it work.
zyp[m] has quit [Quit: Idle timeout reached: 172800s]
notgull has quit [Ping timeout: 240 seconds]
<whitequark[cis]1> test
whitequark[cis]1 has quit [Quit: Reconnecting]
whitequark[cis]1 has joined #amaranth-lang
whitequark[cis]1 has quit [Client Quit]
whitequark[cis]1 has joined #amaranth-lang
whitequark[cis]1 is now known as whitequark
whitequark has quit [Client Quit]
whitequark has joined #amaranth-lang
whitequark has quit [Client Quit]
whitequark has joined #amaranth-lang
notgull has joined #amaranth-lang
whitequark is now known as whitequark[cis]
josuah_dem[m] has joined #amaranth-lang
<josuah_dem[m]> echoing back the "test"
<_whitenotifier-1> [amaranth] cr1901 reviewed pull request #904 commit - https://github.com/amaranth-lang/amaranth/pull/904#discussion_r1322150423
<whitequark[cis]> apologies to everyone re: current meeting; I was very exhausted and forgot my charger in the hotel room, and as a result had no connectivity for 4.5 hours
<whitequark[cis]> s/current/today's/
<galibert[m]> That’s ok, there always will be another one
<whitequark[cis]> true
GenTooMan has quit [Ping timeout: 248 seconds]
<_whitenotifier-1> [amaranth] whitequark opened pull request #906: pyproject: migrate to PDM build backend - https://github.com/amaranth-lang/amaranth/pull/906
<_whitenotifier-1> [amaranth] codecov[bot] commented on pull request #906: pyproject: migrate to PDM build backend - https://github.com/amaranth-lang/amaranth/pull/906#issuecomment-1714735324
<_whitenotifier-1> [amaranth] whitequark commented on pull request #906: pyproject: migrate to PDM build backend - https://github.com/amaranth-lang/amaranth/pull/906#issuecomment-1714737699
<_whitenotifier-1> [amaranth] whitequark edited pull request #906: pyproject: migrate to PDM build backend - https://github.com/amaranth-lang/amaranth/pull/906
GenTooMan has joined #amaranth-lang