X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=VHDL.hs;h=24c4eb0f1fc788b9cebfdcb28332a5eb9d8bf0fe;hb=aa03222c571e37a1a05b6fbf4e09c748cf786286;hp=a40ad00311c7bf5338f7c5537e98422feb48ba3f;hpb=de5278001659d6673ba90e9b721c665805ce4962;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/VHDL.hs b/VHDL.hs index a40ad00..24c4eb0 100644 --- a/VHDL.hs +++ b/VHDL.hs @@ -289,7 +289,7 @@ mkConcSm (bndr, app@(CoreSyn.App _ _))= do -- It's a global value imported from elsewhere. These can be builtin -- functions. funSignatures <- getA vsNameTable - entSignatures <- getA vsSignatures + signatures <- getA vsSignatures case (Map.lookup (bndrToString f) funSignatures) of Just (arg_count, builder) -> if length valargs == arg_count then @@ -306,13 +306,13 @@ mkConcSm (bndr, app@(CoreSyn.App _ _))= do return [AST.CSSASm assign] Right genBuilder -> let - sigs = map (varBndr) valargs + sigs = map varBndr valargs signature = Maybe.fromMaybe (error $ "Using function '" ++ (bndrToString (head sigs)) ++ "' without signature? This should not happen!") - (Map.lookup (head sigs) entSignatures) - arg_name = mkVHDLExtId (bndrToString (last sigs)) + (Map.lookup (head sigs) signatures) + arg_names = map (mkVHDLExtId . bndrToString) (tail sigs) dst_name = mkVHDLExtId (bndrToString bndr) - genSm = genBuilder 4 signature [arg_name, dst_name] + genSm = genBuilder 4 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