X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=VHDL.hs;h=08375b7bd1d54a178d327b8905a4334e217031ec;hb=ee39139fa25cb75c8acc40b10d90f6482b8d1b30;hp=24c4eb0f1fc788b9cebfdcb28332a5eb9d8bf0fe;hpb=aa03222c571e37a1a05b6fbf4e09c748cf786286;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/VHDL.hs b/VHDL.hs index 24c4eb0..08375b7 100644 --- a/VHDL.hs +++ b/VHDL.hs @@ -264,6 +264,11 @@ mkConcSm :: (CoreSyn.CoreBndr, CoreSyn.CoreExpr) -- ^ The binding to process -> VHDLState [AST.ConcSm] -- ^ The corresponding VHDL component instantiations. + +-- Ignore Cast expressions, they should not longer have any meaning as long as +-- the type works out. +mkConcSm (bndr, Cast expr ty) = mkConcSm (bndr, expr) + mkConcSm (bndr, app@(CoreSyn.App _ _))= do let (CoreSyn.Var f, args) = CoreSyn.collectArgs app let valargs' = filter isValArg args @@ -306,13 +311,15 @@ mkConcSm (bndr, app@(CoreSyn.App _ _))= do return [AST.CSSASm assign] Right genBuilder -> let + ty = Var.varType bndr + len = tfvec_len ty sigs = map varBndr valargs signature = Maybe.fromMaybe (error $ "Using function '" ++ (bndrToString (head sigs)) ++ "' without signature? This should not happen!") (Map.lookup (head sigs) signatures) arg_names = map (mkVHDLExtId . bndrToString) (tail sigs) dst_name = mkVHDLExtId (bndrToString bndr) - genSm = genBuilder 4 signature (arg_names ++ [dst_name]) + genSm = genBuilder len signature (arg_names ++ [dst_name]) in return [AST.CSGSm genSm] else error $ "VHDL.mkConcSm Incorrect number of arguments to builtin function: " ++ pprString f ++ " Args: " ++ pprString valargs