Lookup input port names for instantiations in the session.
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Thu, 22 Jan 2009 16:40:04 +0000 (17:40 +0100)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Thu, 22 Jan 2009 16:40:04 +0000 (17:40 +0100)
This replaces the previously hardcoded portnames.

Translator.hs

index b18a86fd1cd939b6850a246a45f7feec49c2a651..f16f40f2d6f63f4a42f4f73f86480cc312896715 100644 (file)
@@ -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)