diff --git a/CHANGELOG.md b/CHANGELOG.md index a5f921eed5..397e33e6eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Changed: ## 1.6.4 *Aug 30th 2022* Fixed: + * Add hex and octal BitVector parsing. [#1772] (https://github.com/clash-lang/clash-compiler/pull/2505) * Input validation of the used arguments in blackboxes is now complete. [#2184](https://github.com/clash-lang/clash-compiler/pull/2184) * `Clash.Annotations.BitRepresentation.Deriving.deriveAnnotation` no longer has quadratic complexity in the size of the constructors and fields. [#2209](https://github.com/clash-lang/clash-compiler/pull/2209) * Fully resolve type synonyms when deriving bit representations. [#2209](https://github.com/clash-lang/clash-compiler/pull/2209) diff --git a/clash-prelude/src/Clash/Sized/Internal/BitVector.hs b/clash-prelude/src/Clash/Sized/Internal/BitVector.hs index 8a6f6bb474..803d6bc007 100644 --- a/clash-prelude/src/Clash/Sized/Internal/BitVector.hs +++ b/clash-prelude/src/Clash/Sized/Internal/BitVector.hs @@ -3,6 +3,7 @@ Copyright : (C) 2013-2016, University of Twente, 2019 , Gergő Érdi 2016-2019, Myrtle Software Ltd, 2021-2022, QBayLogic B.V. + 2023 , Nadia Chambers License : BSD2 (see the file LICENSE) Maintainer : QBayLogic B.V. -} @@ -560,7 +561,7 @@ read# cs0 = (fromIntegral (length cs1), BV m v) -- >>> $(hLit "dead") -- 0b1101111010101101 -- --- Don't care digits are interpreted as f as a hexadecimal digit. +-- Don't care digits set 4 bits in the undefined mask. hLit :: String -> ExpQ hLit s = pure (SigE body typ) where @@ -587,10 +588,10 @@ read16# cs0 = (fromIntegral $ 4 * length cs1, BV m v) ++ show c ++ " in input: " ++ cs0 -- | Create an octal literal. --- >>> $(hLit "5234") +-- >>> $(oLit "5234") -- 0b101011010100 -- --- Don't care digits are interpreted as 7 as an octal digit. +-- Don't care digits set 3 bits in the undefined mask. oLit :: String -> ExpQ oLit s = pure (SigE body typ) where