Skip to content

Missing checks for the bit count requirements of custom bit representations #2954

@kleinreact

Description

@kleinreact

Clash currently accepts the following example without any errors or warnings, although the number of bits marked in the individual fields exceeds the number of bits available. The additional bit requirements for the fields are simply discarded in the generated HDL.

data T where
  T0 :: Bool -> Bit -> T

{-# ANN module (DataReprAnn $(liftQ [t|T|]) 2
  [ ConstrRepr 'T0 0b11 0b00 [0b10, 0b01]
  ]) #-}

topEntity :: T
topEntity = T0 True low

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions