-- the type works out.
mkConcSm (bndr, Cast expr ty) = mkConcSm (bndr, expr)
+-- For simple a = b assignments, just generate an unconditional signal
+-- assignment. This should only happen for dataconstructors without arguments.
+-- TODO: Integrate this with the below code for application (essentially this
+-- is an application without arguments)
+mkConcSm (bndr, Var v) = return $ [mkUncondAssign (Left bndr) (varToVHDLExpr v)]
+
mkConcSm (bndr, app@(CoreSyn.App _ _))= do
let (CoreSyn.Var f, args) = CoreSyn.collectArgs app
let valargs' = filter isValArg args
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