X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=VHDL.hs;h=eac7079155bd8d0b89e02aa441b321e9be890874;hb=5f9b7f3e0c999e765f75b0c48b0f675d99842cea;hp=6b8b7b6d3ba26635ad94832659b9d41dc30615c9;hpb=7ab181699998f86de0a079ec7a63f7e61ec95cb9;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/VHDL.hs b/VHDL.hs index 6b8b7b6..eac7079 100644 --- a/VHDL.hs +++ b/VHDL.hs @@ -22,13 +22,13 @@ import TranslatorTypes createEntity :: HsFunction -- | The function signature -> FuncData -- | The function data collected so far - -> FuncData -- | The modified function data + -> VHDLState () createEntity hsfunc fdata = let func = flatFunc fdata in case func of -- Skip (builtin) functions without a FlatFunction - Nothing -> fdata + Nothing -> do return () -- Create an entity for all other functions Just flatfunc -> @@ -41,7 +41,7 @@ createEntity hsfunc fdata = ent_decl' = createEntityAST hsfunc args' res' entity' = Entity args' res' (Just ent_decl') in - fdata { funcEntity = Just entity' } + setEntity hsfunc entity' where mkMap :: Eq id => [(id, SignalInfo)] -> id -> (AST.VHDLId, AST.TypeMark) mkMap sigmap id = @@ -89,13 +89,13 @@ mkEntityId hsfunc = createArchitecture :: HsFunction -- | The function signature -> FuncData -- | The function data collected so far - -> FuncData -- | The modified function data + -> VHDLState () createArchitecture hsfunc fdata = let func = flatFunc fdata in case func of -- Skip (builtin) functions without a FlatFunction - Nothing -> fdata + Nothing -> do return () -- Create an architecture for all other functions Just flatfunc -> let @@ -113,7 +113,7 @@ createArchitecture hsfunc fdata = insts = map (AST.CSISm . mkCompInsSm) apps arch = AST.ArchBody (mkVHDLId "structural") (AST.NSimple entity_id) (map AST.BDISD sig_decs) insts in - fdata { funcArch = Just arch } + setArchitecture hsfunc arch mkSigDec :: SignalInfo -> AST.SigDec mkSigDec info =