X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=VHDL.hs;h=4f8d1055af2e0df5a9db8b82ad7a709505a4e216;hb=b4b8def2facb3d3bf92ee02a499405efdf986324;hp=b2f166e046c77bd51638ea5d13dd42713f376306;hpb=a5a073e51209d741f9c7d2323df8e2c4571e86e6;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/VHDL.hs b/VHDL.hs index b2f166e..4f8d105 100644 --- a/VHDL.hs +++ b/VHDL.hs @@ -274,10 +274,7 @@ mkConcSm (bndr, app@(CoreSyn.App _ _))= do --let valargs = filter isValArg args in if all is_var valargs then do labels <- getFieldLabels (CoreUtils.exprType app) - let assigns = zipWith mkassign labels valargs - let block_id = bndrToVHDLId bndr - let block = AST.BlockSm block_id [] (AST.PMapAspect []) [] assigns - return [AST.CSBSm block] + return $ zipWith mkassign labels valargs else error $ "VHDL.mkConcSm Not in normal form: One ore more complex arguments: " ++ pprString args where @@ -313,20 +310,16 @@ mkConcSm (bndr, app@(CoreSyn.App _ _))= do (error $ "Using function '" ++ (bndrToString f) ++ "' without signature? This should not happen!") (Map.lookup f signatures) entity_id = ent_id signature - label = bndrToString bndr + label = "comp_ins_" ++ bndrToString bndr -- Add a clk port if we have state --clk_port = Maybe.fromJust $ mkAssocElem (Just $ mkVHDLExtId "clk") "clk" + clk_port = Maybe.fromJust $ mkAssocElem (Just $ mkVHDLExtId "clk") "clk" --portmaps = mkAssocElems sigs args res signature ++ (if hasState hsfunc then [clk_port] else []) - portmaps = mkAssocElems args bndr signature + portmaps = clk_port : mkAssocElems args bndr signature in return [AST.CSISm $ AST.CompInsSm (mkVHDLExtId label) (AST.IUEntity (AST.NSimple entity_id)) (AST.PMapAspect portmaps)] details -> error $ "Calling unsupported function " ++ pprString f ++ " with GlobalIdDetails " ++ pprString details --- GHC generates some funny "r = r" bindings in let statements before --- simplification. This outputs some dummy ConcSM for these, so things will at --- least compile for now. -mkConcSm (bndr, CoreSyn.Var _) = return [AST.CSPSm $ AST.ProcSm (mkVHDLBasicId "unused") [] []] - -- A single alt case must be a selector. This means thee scrutinee is a simple -- variable, the alternative is a dataalt with a single non-wild binder that -- is also returned.