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
peepsalot has quit [Quit: Connection reset by peep]
peepsalot has joined #amaranth-lang
<_whitenotifier-6> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/yosys/compare/7006ebfedf33...406c6f76bd87
<_whitenotifier-6> [YoWASP/yosys] whitequark 406c6f7 - Update dependencies.
<_whitenotifier-6> [amaranth] charlottia edited pull request #832: lib.enum: allow empty enums. - https://github.com/amaranth-lang/amaranth/pull/832
jess has quit []
<_whitenotifier-6> [amaranth] charlottia edited pull request #832: lib.enum: allow empty enums. - https://github.com/amaranth-lang/amaranth/pull/832
<_whitenotifier-6> [amaranth-lang/amaranth-yosys] amaranth-lang-bot pushed 1 commit to develop [+0/-0/±1] https://github.com/amaranth-lang/amaranth-yosys/compare/386b76b1671f...5a644f0ab2cd
<_whitenotifier-6> [amaranth-lang/amaranth-yosys] whitequark 5a644f0 - [autorelease] Update wasmtime version requirement from <10 to <11.
jess has joined #amaranth-lang
<_whitenotifier-6> [amaranth-lang/amaranth-yosys] amaranth-lang-bot pushed 1 commit to release [+0/-0/±1] https://github.com/amaranth-lang/amaranth-yosys/compare/386b76b1671f...5a644f0ab2cd
<_whitenotifier-6> [amaranth-lang/amaranth-yosys] whitequark 5a644f0 - [autorelease] Update wasmtime version requirement from <10 to <11.
<_whitenotifier-6> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/nextpnr/compare/3639458de976...447c512c11fa
<_whitenotifier-6> [YoWASP/nextpnr] whitequark 447c512 - Update dependencies.
<_whitenotifier-6> [YoWASP/runtime] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/runtime/compare/58bca156138f...7be0277ac96d
<_whitenotifier-6> [YoWASP/runtime] whitequark 7be0277 - [autorelease] Update wasmtime version requirement from <10 to <11.
<_whitenotifier-6> [YoWASP/runtime] whitequark pushed 1 commit to release [+0/-0/±1] https://github.com/YoWASP/runtime/compare/58bca156138f...7be0277ac96d
<_whitenotifier-6> [YoWASP/runtime] whitequark 7be0277 - [autorelease] Update wasmtime version requirement from <10 to <11.
anubis has joined #amaranth-lang
<_whitenotifier-6> [amaranth] charlottia commented on pull request #832: lib.enum: allow empty enums. - https://github.com/amaranth-lang/amaranth/pull/832#issuecomment-1619373823
<_whitenotifier-6> [amaranth] charlottia commented on pull request #830: hdl.ast: implement ShapeCastable.__subclasshook__. - https://github.com/amaranth-lang/amaranth/pull/830#issuecomment-1619382208
anubis has quit [Remote host closed the connection]
<d1b2> <vipqualitypost> so looking through some materials written by various people that mostly pre-dates amaranth (using nmigen): what's the difference between yield Settle() and yield Tick() and when should you use one or the other or neither for simulating?
<d1b2> <vipqualitypost> maybe that is vague: I am using amaranth, but the materials I am looking at are written with nmigen- are settle and tick still things and when should they be used?
<charlottia> They are still things. Tick() advances the simulation one clock cycle (by default in the sync domain). It's also the default default action in a sync process added to a simulation, i.e. yield on its own is equivalent to Tick().
Qyriad has joined #amaranth-lang
<d1b2> <vipqualitypost> is settle like a tick but on a smaller timescale for comb logic?
peepsalot has quit [Quit: Connection reset by peep]
<charlottia> More or less — it'll not advance the simulation time, but let processes run while comb logic resolves to a stable point (settles).
<d1b2> <vipqualitypost> ok, makes sense. and so presumably comb logic should be resolved by the end of any tick, right? i.e. I only need to use settle in some special cases where I specifically don't want to wait for a full cycle?
peepsalot has joined #amaranth-lang
leptonix has quit [Server closed connection]
leptonix has joined #amaranth-lang
<charlottia> I think that's true except when you're messing with the DUT directly from the simulator. I haven't looked into the exact behaviour myself, but e.g. I've found sometimes when I permute things and Tick() but don't Settle(), the behavior can be different to what I expect when there's comb logic downstream of it.
<d1b2> <vipqualitypost> interesting, I will keep that in mind! thank you for the help!
Qyriad has quit [Quit: Connection closed for inactivity]
<_whitenotifier-6> [amaranth] charlottia commented on pull request #830: hdl.ast: implement ShapeCastable.__subclasshook__. - https://github.com/amaranth-lang/amaranth/pull/830#issuecomment-1619845095
<_whitenotifier-6> [amaranth-lang/amaranth] github-merge-queue[bot] pushed 1 commit to gh-readonly-queue/main/pr-832-e6d8d5a3547747c1fdf9b955e8713b36e81f2fb0 [+0/-0/±2] https://github.com/amaranth-lang/amaranth/compare/a4237be19ca0...acba7d912432
<_whitenotifier-6> [amaranth-lang/amaranth] charlottia acba7d9 - lib.enum: allow empty enums.
<_whitenotifier-6> [amaranth-lang/amaranth] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-832-e6d8d5a3547747c1fdf9b955e8713b36e81f2fb0
<_whitenotifier-6> [amaranth] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-832-e6d8d5a3547747c1fdf9b955e8713b36e81f2fb0 - https://github.com/amaranth-lang/amaranth
<_whitenotifier-6> [amaranth-lang/amaranth] github-merge-queue[bot] pushed 1 commit to gh-readonly-queue/main/pr-832-e6d8d5a3547747c1fdf9b955e8713b36e81f2fb0 [+0/-0/±2] https://github.com/amaranth-lang/amaranth/compare/4b93a0fccb65...7e438180e08f
<_whitenotifier-6> [amaranth-lang/amaranth] charlottia 7e43818 - lib.enum: allow empty enums.
<_whitenotifier-6> [amaranth-lang/amaranth] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±2] https://github.com/amaranth-lang/amaranth/compare/e6d8d5a35477...7e438180e08f
<_whitenotifier-6> [amaranth-lang/amaranth] charlottia 7e43818 - lib.enum: allow empty enums.
<_whitenotifier-6> [amaranth-lang/amaranth] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-832-e6d8d5a3547747c1fdf9b955e8713b36e81f2fb0
<_whitenotifier-6> [amaranth] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-832-e6d8d5a3547747c1fdf9b955e8713b36e81f2fb0 - https://github.com/amaranth-lang/amaranth
<_whitenotifier-6> [amaranth] whitequark closed pull request #832: lib.enum: allow empty enums. - https://github.com/amaranth-lang/amaranth/pull/832
<_whitenotifier-6> [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/9f33cd4fb28f...47817a0f843f
<_whitenotifier-6> [amaranth-lang/amaranth-lang.github.io] github-merge-queue[bot] 47817a0 - Deploying to main from @ amaranth-lang/amaranth@7e438180e08f72fd5d960d279bc4f0051bdb5e42 🚀
<fl4shk[m]> <adamgreig[m]> "libera are ending portalling..." <- dang it, and I just switched to Matrix, too
<whitequark> this room isn't bridged
<whitequark> also from discussions I had, this is primarily on the Matrix side which is ... not doing so well
<galibert[m]> You mean Matrix in general is not doing well?
<galibert[m]> Or just the bridging stuff?
<fl4shk[m]> I can switch back to IRC
<fl4shk[m]> I liked Matrix though
<whitequark> given a binary choice between IRC and Matrix it will be Matrix for me
<whitequark> and for all of the channels I operate
<fl4shk[m]> I see
<fl4shk[m]> that sounds good!
<whitequark> but it's not a binary choice (yet?)
<fl4shk[m]> most of what I use Matrix for is this channel anyway
<fl4shk[m]> oh
<fl4shk[m]> Yeah
<galibert[m]> ok, went through the configs, there are some nice options in there
<galibert[m]> including not fetching ulrls by default, should make the commits way less noisy in there
<robtaylor> I would love if #amaranth was on matrix :)
<galibert[m]> it....is?
<robtaylor> i mean properly...
<robtaylor> the bridge gets a bit annoying at times..
<galibert[m]> Catherine is on matrix, so it's properly there, everywhere else is improper
<robtaylor> hah, yes, but eveything gets munged through irc semantics at the moment
<whitequark> I use IRC through Matrix, which is intentional
<whitequark> Matrix to me is essentially a bouncer
<robtaylor> same here
<charlottia> The inline code spans all getting some weird unicode prefix on the IRC(/Discord) side is off-putting, and the truncation is super annoying.
<whitequark> the prefix is actually an mIRC code I think
<charlottia> whitequark: Likewise, literally replaced my IRC bouncer with it!
<whitequark> so it's standard-ish (as much as IRC things are standard)
<charlottia> whitequark: Ohhhhhhhhhh lmao, that makes sense.
<charlottia> nod!
<whitequark> the truncation is pretty bad yeah
<fl4shk[m]> whitequark: me too
FL4SHK has joined #amaranth-lang
<fl4shk[m]> maybe I should write or find a Matrix bridge to host locally for just me
<galibert[m]> something wrong with the matrix web interface?
<fl4shk[m]> well
<fl4shk[m]> Libera is making the Matrix bridge opt-in
<fl4shk[m]> and that's a problem for me because I wanted to use Libera from my phone
<galibert[m]> which is rather sane when you think about it
<fl4shk[m]> I agree that it's sane, but one of the channels I'm in has no ops at all
<fl4shk[m]> so it won't be bridged opt-in
<fl4shk[m]> and also there are other channels that I don't know whether they'd opt-in
<fl4shk[m]> admittedly I couldn't figure out how to join libera channels that start with ## from Matrix
<whitequark> if you read between the lines of the announcement, it looks like they want it opt-in because they don't trust the Matrix side of things (hence mentions of +s)
<whitequark> this is my speculation
<galibert[m]> yeah, reads like that
<whitequark> and I do know that the Libera folks have no say in how the bridge is run (this is well described if you look)
<galibert[m]> So unreliable, acceptance not under control of the libera side, and ignoring some channel modes, not surprising they consider the situation suboptimal
<whitequark> yep
<galibert[m]> they may have used stronger words at some point too, I suspect
<FL4SHK> gotcha
<FireFly> it's been sort of a long-running problem
Allie has joined #amaranth-lang
FL4SHK has quit [Quit: WeeChat 4.0.1]
FL4SHK has joined #amaranth-lang
<FL4SHK> I got this algorithm set up for my interconnect
<FL4SHK> unfortunately you need more logic for the count leading zeros
<FL4SHK> this isn't Amaranth, just regular Python
<whitequark> that seems... complicated
<whitequark> what does it do
<FL4SHK> the main meat is in `calc_next_gnt`
<FL4SHK> It's actually not that complex
<whitequark> can you use words to explain?
<FL4SHK> at least, the hardware won't be
<FL4SHK> yes
<FL4SHK> it is a priority-based bus arbiter
<FL4SHK> # x = {req, req}; // dense vector of requests, concat'd. eg, 01100110
<FL4SHK> # t = x & (~x + last_one_hot); // bitscan
<FL4SHK> # next_one_hot = t[2*N-1:N] | t[N-1:0]; // handle wrap.
<FL4SHK> that's the gist of it
<FL4SHK> that's what it does in HDL code
<whitequark> for cases like this, I find it's easiest to write a loop covering every possible case in a lookup table
<whitequark> and just let the toolchain optimize
<whitequark> it's going to be the same netlist in the end
<FL4SHK> yeah
<FL4SHK> I agree
<FL4SHK> but this isn't Amaranth code
<FL4SHK> I just needed to figure out the algorithm
<whitequark> ah
<FL4SHK> so I convert integers to Python `list`s of 1 and 0
<FL4SHK> just for the slicing aspect
<FL4SHK> not technically necessary
<FL4SHK> just makes the code more like it'll be in the Amaranth code
<FL4SHK> it'd be nice if slicing into integers was a more common thing outside of HDLs
<FL4SHK> but instead we're stuck with manually constructing bitmasks and stuff
<galibert[m]> slicing an integer is not very complicated. val[a:b] = (val >> a) & ((1 << (b-a)) - 1)
<FL4SHK> true
<zyp[m]> if I had to work on bits like that in python, I'd make a generator like this that produces the indexes of the bits: https://paste.jvnv.net/view/LpNwD
<zyp[m]> finding the first bit then becomes next(bits_set(n)) and the count of ones becomes sum(1 for _ in bits_set(n))
Guest97 has joined #amaranth-lang
Guest97 has quit [Client Quit]