clash-lang / clash-prelude

CLaSH prelude library containing datatypes and functions for circuit design
http://www.clash-lang.org/
Other
31 stars 27 forks source link

Fix Read instances for Sized number types #166

Closed basile-henry closed 6 years ago

basile-henry commented 6 years ago

The Read instances for Signed, Unsigned, and Index didn't properly work for numbers using more than 64 bits.

Before:

> read ("0x1" <> Prelude.replicate 16 '0') :: Unsigned 65
0

After:

> read ("0x1" <> Prelude.replicate 16 '0') :: Unsigned 65
18446744073709551616
christiaanb commented 6 years ago

Thanks!