X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=c%CE%BBash%2FCLasH%2FTranslator%2FTranslatorTypes.hs;h=2591e666f0b3491b93b8f8baaced8d993b77998d;hb=466f80bdde9511508c38e951d208a2a52c90c7da;hp=12ca6ed8ea9313f59ecd035e8d2e299a6d58bbc6;hpb=a54863feb7304aa6a843efc15d29f017c45407f4;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git "a/c\316\273ash/CLasH/Translator/TranslatorTypes.hs" "b/c\316\273ash/CLasH/Translator/TranslatorTypes.hs" index 12ca6ed..2591e66 100644 --- "a/c\316\273ash/CLasH/Translator/TranslatorTypes.hs" +++ "b/c\316\273ash/CLasH/Translator/TranslatorTypes.hs" @@ -46,19 +46,21 @@ instance Eq OrdType where instance Ord OrdType where compare (OrdType a) (OrdType b) = Type.tcCmpType a b -data HType = StdType OrdType | - ADTType String [HType] | +data HType = AggrType String [HType] | EnumType String [String] | VecType Int HType | + UVecType HType | SizedWType Int | RangedWType Int | SizedIType Int | - BuiltinType String - deriving (Eq, Ord) + BuiltinType String | + StateType + deriving (Eq, Ord, Show) -- A map of a Core type to the corresponding type name, or Nothing when the -- type would be empty. -type TypeMap = Map.Map HType (Maybe (AST.VHDLId, Either AST.TypeDef AST.SubtypeIn)) +type TypeMapRec = Maybe (AST.VHDLId, Maybe (Either AST.TypeDef AST.SubtypeIn)) +type TypeMap = Map.Map HType TypeMapRec -- A map of a vector Core element type and function name to the coressponding -- VHDLId of the function and the function body. @@ -70,7 +72,7 @@ data TypeState = TypeState { -- | A map of Core type -> VHDL Type tsTypes_ :: TypeMap, -- | A list of type declarations - tsTypeDecls_ :: [AST.PackageDecItem], + tsTypeDecls_ :: [Maybe AST.PackageDecItem], -- | A map of vector Core type -> VHDL type function tsTypeFuns_ :: TypeFunMap, tsTfpInts_ :: TfpIntMap,