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
<_whitenotifier> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/nextpnr/compare/e9af21a9cafd...fb2fd31de471
<_whitenotifier> [YoWASP/nextpnr] whitequark fb2fd31 - Update dependencies.
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 248 seconds]
Degi_ is now known as Degi
jn has quit [Ping timeout: 246 seconds]
jn has joined #amaranth-lang
jn has joined #amaranth-lang
<_whitenotifier> [amaranth] charlottia commented on pull request #830: hdl.ast: implement ShapeCastable.__subclasshook__. - https://github.com/amaranth-lang/amaranth/pull/830#issuecomment-1690917706
indy_ is now known as indy
dyniec_ has joined #amaranth-lang
Raito_Bezarius has quit [*.net *.split]
whitequark[cis] has quit [*.net *.split]
dyniec has quit [*.net *.split]
roflincopter has quit [*.net *.split]
whitequark[cis] has joined #amaranth-lang
roflincopter has joined #amaranth-lang
Raito_Bezarius has joined #amaranth-lang
<galibert[m]> Is there a way to express in Amaranth (and, I guess, in verilog/rtlil) that "this set of signals is one-hot, so don't bother checking if the others are zero, that will be less wires to route"
<galibert[m]> s/less/fewer/
<whitequark[cis]> hm, you could control downstream logic with the individual bits rather than the entire word?
cr1901_ has joined #amaranth-lang
cr1901 has quit [Ping timeout: 248 seconds]
<galibert[m]> amaranth will still want to manage the priorities between the possibilities
<galibert[m]> with m.If(hot1): [...] with m.If(hot2): [...], both blocks hitting the same registers it's going to explicitely prioritize
<whitequark[cis]> yes
<whitequark[cis]> this is intentional
<whitequark[cis]> there's no way to turn it off nor is a way to turn it off planned
<galibert[m]> Yeah, I'm not sure if it should be at the amaranth level or at the yosys level, noticing/proving that it is one-hot and that some freedom is gained in synthesis thanks to that
<galibert[m]> Optimization but without relying on undefined stuff, only with proof that it's not going to happen
<galibert[m]> but seeing that it's one-hot at the yosys level may be difficult, too low level
<whitequark[cis]> Oh, no, that's something that I think yosys actually does
<whitequark[cis]> it uses SAT
<galibert[m]> It's not an entirely well-formed concept in my head :-)
<galibert[m]> Ah nice
<whitequark[cis]> this is mainly useful for merging memory ports where enables are mutually exclusive
<whitequark[cis]> but I think it might be applying the same logic in other cases
<galibert[m]> here it's instruction register -> one-hot behaviour-to-do register -> switch on the behaviour
<galibert[m]> It would be nice to have the concept of one-hot even for the debugging and proof aspects. I'd love amaranth to tell me when I fuck up in a 1-hot set
<whitequark[cis]> oh, you should be able to do that soon with an Assert
<whitequark[cis]> they're going to become simulatable
<galibert[m]> "compile" time would be nicer
<galibert[m]> as always
<whitequark[cis]> you can use formal verification for that
<galibert[m]> An idea just sprang to mind: a variant of Signal(Enum) that is underneath encoded as one-hot
<whitequark[cis]> hm, there is an open issue for Enum type safety which I'm going to write an RFC for, probably, today
<whitequark[cis]> you could simply define an enum with one-hot representation then?
<galibert[m]> That would lose auto() though
<whitequark[cis]> assigning something other than the values of this enum would be a compile time error
<whitequark[cis]> so?
<whitequark[cis]> actually I'm not even sure of that
<whitequark[cis]> with IntFlag, auto() gives you one hot values
<galibert[m]> Niiiiiiice
<Wanda[cis]> yosys doesn't do much SAT-based optimization; none other than the memory stuff in default scripts, in fact
<whitequark[cis]> ah got it
<Wanda[cis]> (the other two are mostly just gimmicks)
<galibert[m]> (it's really, really annoying that non-flag auto() starts at 1 and not 0)
<whitequark[cis]> we can provide our own variation on auto in amaranth.lib.enum I guess
<galibert[m]> To get the eventual type-safety, I need to use Flag and not IntFlag, right?
<whitequark[cis]> galibert[m]: yea
<galibert[m]> amaranth.lib.enum providing a start-at-0 auto() for Enum/IntEnum and a start-at-2**0 for Flag/IntFlag would make a lot of sense I think
<galibert[m]> You'd just have to switch between Enum and Flag to switch between numbered and one-hot too
<whitequark[cis]> no, it would not be auto
<Wanda[cis]> Flag is not one-hot
<whitequark[cis]> amaranth.lib.enum.Enum is a drop-in replacement for enum.Enum
<Wanda[cis]> like, sure, the encoding is, but the whole concept of Flag is that you can OR them
<galibert[m]> Would be more like EnumOneHot with appropriate i_cant_believe_its_not_auto()?
<galibert[m]> accepting only == and != like a typesafe Enum?
<galibert[m]> the difficulty is going to ensure ==/!= generate a single-bit comparison and not the whole word, right?
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Client Quit]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Client Quit]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
cr1901__ has joined #amaranth-lang
cr1901_ has quit [Ping timeout: 246 seconds]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Client Quit]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
jjsuperpower has quit [Ping timeout: 252 seconds]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Client Quit]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Client Quit]
Bluefoxicy has joined #amaranth-lang
jjsuperpower has joined #amaranth-lang
jjsuperpower has quit [Ping timeout: 245 seconds]
cr1901__ is now known as cr1901
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
Bluefoxicy has quit [Quit: ZNC - http://znc.in]
Bluefoxicy has joined #amaranth-lang
adamgreig[m] has quit [Quit: Idle timeout reached: 172800s]
girlies[m] has joined #amaranth-lang
* girlies[m] [removed]
<josuah> whitequark[cis]: do you have write access to the matrix history?
<josuah> occasionally kickban the IP
<bob_twinkles[m]> @moderator (discord side) ^^
josuah_dem[m] has joined #amaranth-lang
<josuah_dem[m]> Ah thanks! Discord-fu to the rescue!
dragonmux[m] has joined #amaranth-lang
<dragonmux[m]> Sorted
fancypop[m] has joined #amaranth-lang
* fancypop[m] [removed]
esden[m] has joined #amaranth-lang
<esden[m]> thanks dragonmux (@_discord_397464999494418444:catircservices.org)