X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=blobdiff_plain;f=clash%2FCLasH%2FVHDL%2FGenerate.hs;h=80b2d438562dd089989fcf6ce3c020186bd3eddc;hp=022adeaa90dc5600f2b88014b6619e8cf65296a1;hb=a1b19f34a500caafbfc494ed101eb457ffc3262b;hpb=d8b60ced4dcb0498199608f25db4f9989d0e7a3f diff --git a/clash/CLasH/VHDL/Generate.hs b/clash/CLasH/VHDL/Generate.hs index 022adea..80b2d43 100644 --- a/clash/CLasH/VHDL/Generate.hs +++ b/clash/CLasH/VHDL/Generate.hs @@ -1102,8 +1102,21 @@ genApplication dst f args = do mkassign label arg = let sel_name = mkSelectedName ((either varToVHDLName id) dst) label in mkUncondAssign (Right sel_name) arg + -- Enumeration types have no arguments and are just + -- simple assignments + Right (EnumType _ _) -> + simple_assign + -- These builtin types are also enumeration types + Right (BuiltinType tyname) | tyname `elem` ["Bit", "Bool"] -> + simple_assign Right _ -> error $ "Datacon application does not result in a aggregate type? datacon: " ++ pprString f ++ " Args: " ++ show args Left _ -> error $ "Unrepresentable result type in datacon application? datacon: " ++ pprString f ++ " Args: " ++ show args + where + -- Simple uncoditional assignment, for (built-in) + -- enumeration types + simple_assign = do + expr <- MonadState.lift tsType $ dataconToVHDLExpr dc + return ([mkUncondAssign dst expr], []) Right _ -> error "\nGenerate.genApplication(DataConWorkId): Can't generate dataconstructor application without an original binder" IdInfo.DataConWrapId dc -> case dst of