-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Labels
Description
AFAIK there's always been discussion on how undefinedness should work especially for BitVector n
(whether it should produce an X exception or not)
But regardless of that I think that at least BitVector n
and Bit
should behave the same. Right now we have the following behavior:
ghci> deepErrorX "" :: Bit
*** Exception: X:
CallStack (from HasCallStack):
errorX, called at src/Clash/Sized/Internal/BitVector.hs:300:16 in clash-prelude-1.9.0-67fee7029a5493706dc3a40bc6492fe6aff05d8584aa3f56c3d3f55011874849:Clash.Sized.Internal.BitVector
deepErrorX, called at <interactive>:36:1 in interactive:Ghci21
ghci> deepErrorX "" :: BitVector 8
0b...._....
ghci> Clash.Sized.Internal.BitVector.Bit 1 0 :: Bit
.
ghci> Clash.Sized.Internal.BitVector.BV 1 0 :: BitVector 8
0b0000_000.
I feel like whether or not undefined bits cause an X exception, at least Bit
and BitVector n
should behave the same