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
lf has quit [Ping timeout: 256 seconds]
lf has joined #amaranth-lang
Degi has quit [Ping timeout: 260 seconds]
Degi has joined #amaranth-lang
<_whitenotifier-3> [YoWASP/vscode] whitequark pushed 2 commits to main [+0/-0/±5] https://github.com/YoWASP/vscode/compare/fe50b7df58a7...bae93fca4015
<_whitenotifier> [YoWASP/vscode] whitequark bc6a3b1 - Bump version.
<_whitenotifier-3> [YoWASP/vscode] whitequark bae93fc - Add support for bundles with only a `default` entry point.
<_whitenotifier-3> [YoWASP/vscode] whitequark tagged bae93fc as v0.2.4 https://github.com/YoWASP/vscode/commit/bae93fca4015a5e1845a6fec5398b2570a4cd745
<_whitenotifier> [vscode] whitequark created tag v0.2.4 - https://github.com/YoWASP/vscode
nyanotech has quit [Quit: No Ping reply in 180 seconds.]
nyanotech has joined #amaranth-lang
Stary has quit [Quit: ZNC - http://znc.in]
Stary has joined #amaranth-lang
notgull has joined #amaranth-lang
notgull has quit [Ping timeout: 255 seconds]
notgull has joined #amaranth-lang
peepsalot has quit [Remote host closed the connection]
peepsalot has joined #amaranth-lang
notgull has quit [Ping timeout: 260 seconds]
nelgau has quit [Ping timeout: 276 seconds]
vegard_e[m] has quit [Quit: Idle timeout reached: 172800s]
cr1901 has quit [Quit: Leaving]
cr1901 has joined #amaranth-lang
<vup> Is `Signal(range(0))` intended to raise `SyntaxWarning: Reset value 0 equals the non-inclusive end of the signal shape range(0, 0); this is likely an off-by-one error` ?
<vup> The direct equivalent of `Signal(unsigned(0))` doesn't raise that warning
Wanda[cis] has joined #amaranth-lang
<Wanda[cis]> it's not a direct equivalent; Signal(unsigned(0)) is equivalent to Signal(range(1))
<Hoernchen> but range(0) has a length of 0 so this is not the same at all
<Wanda[cis]> they both have one valid value (which is 0)
<Wanda[cis]> however, Signal(range(0)) nominally has no valid values at all, ie. is a never type
<vup> not sure I follow
<vup> ```
<vup> ```
<vup> unsigned(0)
<vup> >>> Shape.cast(range(0))
<Wanda[cis]> yeah, it gets converted up to a 0-width value
<Wanda[cis]> because Amaranth doesn't have actual never types
<Wanda[cis]> (and it'd be quite hard to figure out sensible semantics for those in a HDL)
<Wanda[cis]> which... well, is actually why this warning happens
<Wanda[cis]> you're effectively asking for a signal with no valid values at all; shape-wise it gets upconverted to unsigned(0) which has one valid value, but the validity check still triggers with the original specification of range(0) for the default initial value of 0
<Wanda[cis]> but, back to the original question
<Wanda[cis]> I'd say this is... a fairly confusing message
<vup> right, to me the warning is quite confusing, because I did not understand that `range(0)` is interpreted as a never type, especially as amaranth doesn't really suport never types and implicitly converts them to 0-width values
<vup> yeah ^^
<Wanda[cis]> so... what's your use case for a Signal(range(0)) in the first place?
<Wanda[cis]> I have honestly no idea what should happen here
<vup> just generic code, that happens to have `range(0)` as an edgecase
<Hoernchen> it should not be just a warning
<Wanda[cis]> vup: yeah, figured, but... what do you expect this signal to do in that edge case?
<Wanda[cis]> I suppose the only valid use case for something that is effectively the never type in a HDL would be when the signal is always gated off to be effectively don't care?
<Wanda[cis]> hm
<Wanda[cis]> yeah I can see something like that
<Wanda[cis]> I do think it'd be useful to just be able to say Signal(range(0)) without triggering a warning about the init value
<Wanda[cis]> ... as long as that value is not explicitly chosen, at least? hm.
<Wanda[cis]> unsure about that part
<Wanda[cis]> either way
<Wanda[cis]> I'd say file a bug, we can talk about it at the meeting tomorrow
<vup> Wanda[cis]: yep, the signal is used in some comparisons, which I would expect to never evaluate to true
<vup> (like (NeverType < 0), (NeverType > 0)
<_whitenotifier> [amaranth] rroohhh opened issue #1019: `Signal(range(0))` raises `SyntaxWarning` - https://github.com/amaranth-lang/amaranth/issues/1019
vipqualitypost[m has quit [Quit: Idle timeout reached: 172800s]
Wolfvak has quit [Ping timeout: 256 seconds]
Wolfvak has joined #amaranth-lang
<cr1901> Probably won't be here for the meeting tomorrow
jfng[m] has quit [Quit: Idle timeout reached: 172800s]
<_whitenotifier-3> [amaranth] fischermoseley opened issue #1020: cannot open build_top.sh: No such file - https://github.com/amaranth-lang/amaranth/issues/1020
mcc111[m] has joined #amaranth-lang
<mcc111[m]> I'm getting: `TypeError: ColorScheme.__init_subclass__() takes no keyword arguments`
<mcc111[m]> What do you suppose I'm missing?
<whitequark[cis]> you are missing `from amaranth.lib import enum`
<mcc111[m]> At the top of the file I have from amaranth.lib import wiring, data, enum
<mcc111[m]> wait
<mcc111[m]> wait no sorry
<mcc111[m]> i see the problem
<mcc111[m]> i was importing regular enum after that 🤦‍♀️
notgull has joined #amaranth-lang
notgull has quit [Ping timeout: 276 seconds]
jjsuperpower has quit [Remote host closed the connection]
jjsuperpower has joined #amaranth-lang