From: Matthijs Kooijman Date: Thu, 22 Jan 2009 16:40:04 +0000 (+0100) Subject: Lookup input port names for instantiations in the session. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=33c032737b6c84ff5075567d90f4dd2d830dafd6;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Lookup input port names for instantiations in the session. This replaces the previously hardcoded portnames. --- diff --git a/Translator.hs b/Translator.hs index b18a86f..f16f40f 100644 --- a/Translator.hs +++ b/Translator.hs @@ -146,10 +146,10 @@ getInstantiations sess args outs binds app@(App expr arg) = hwfunc = Maybe.fromMaybe (error $ "Function " ++ compname ++ "is unknown") (lookup compname (funcs sess)) - HWFunction inports outports = hwfunc + HWFunction (Args inports) outport = hwfunc ports = - zipWith (getPortMapEntry binds) [Port "portin0", Port "portin1"] fargs - ++ mapOutputPorts outports outs + zipWith (getPortMapEntry binds) inports fargs + ++ mapOutputPorts outport outs getInstantiations sess args outs binds expr = error $ "Unsupported expression" ++ (showSDoc $ ppr $ expr)