You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/tmp/a.py", line 16, in <module>
m.d.comb += out.eq(signal == any_const)
File "/data/projects/amaranth/amaranth/lib/data.py", line 888, in __eq__
raise TypeError(
TypeError: View with layout StructLayout({}) can only be compared to another view or constant with the same layout, not (anyconst 0')
It would be nice if such comparisons would be possible. (Its of course possible to work around this by creating a intermediate Signal with the correct shape driven by the Any{Seq,Const} and comparing to that)
The text was updated successfully, but these errors were encountered:
you can work around it by writing any_const = S(AnyConst(S))
it may be a good idea to make AnyConst/AnySeq auto-wrap themselves with a shapecastable like Signal does, but that's probably an RFC-grade item, and AnyConst/AnySeq are currently kinda in limbo because we lack a coherent formal verification model in amaranth (we just kinda emit stuff that yosys parses without much thought)
Something like this:
fails with
It would be nice if such comparisons would be possible. (Its of course possible to work around this by creating a intermediate
Signal
with the correct shape driven by theAny{Seq,Const}
and comparing to that)The text was updated successfully, but these errors were encountered: