let sigs = flat_sigs flatfunc
let args = flat_args flatfunc
let res = flat_res flatfunc
let sigs = flat_sigs flatfunc
let args = flat_args flatfunc
let res = flat_res flatfunc
let entity_id = Maybe.fromMaybe
(error $ "Building architecture without an entity? This should not happen!")
(getEntityId fdata)
-- Create signal declarations for all signals that are not in args and
-- res
let sig_decs = Maybe.catMaybes $ map (mkSigDec . snd) sigs
let entity_id = Maybe.fromMaybe
(error $ "Building architecture without an entity? This should not happen!")
(getEntityId fdata)
-- Create signal declarations for all signals that are not in args and
-- res
let sig_decs = Maybe.catMaybes $ map (mkSigDec . snd) sigs
- -- Create component instantiations for all function applications
- insts <- mapM (mkCompInsSm sigs) apps
+ -- Create concurrent statements for all signal definitions
+ statements <- mapM (mkConcSm sigs) defs
setArchitecture hsfunc arch
mkStateProcSm :: (StateId, SignalInfo, SignalInfo) -> AST.ProcSm
setArchitecture hsfunc arch
mkStateProcSm :: (StateId, SignalInfo, SignalInfo) -> AST.ProcSm
- -> FApp -- | The application to look at.
- -> VHDLState AST.CompInsSm -- | The corresponding VHDL component instantiation.
+ -> SigDef -- | The signal definition
+ -> VHDLState AST.ConcSm -- | The corresponding VHDL component instantiation.
fdata_maybe <- getFunc hsfunc
let fdata = Maybe.fromMaybe
(error $ "Using function '" ++ (prettyShow hsfunc) ++ "' that is not in the session? This should not happen!")
fdata_maybe <- getFunc hsfunc
let fdata = Maybe.fromMaybe
(error $ "Using function '" ++ (prettyShow hsfunc) ++ "' that is not in the session? This should not happen!")
- let portmaps = mkAssocElems sigs app entity
- return $ AST.CompInsSm (mkVHDLId label) (AST.IUEntity (AST.NSimple entity_id)) (AST.PMapAspect portmaps)
+ let portmaps = mkAssocElems sigs args res entity
+ return $ AST.CSISm $ AST.CompInsSm (mkVHDLId label) (AST.IUEntity (AST.NSimple entity_id)) (AST.PMapAspect portmaps)
- [(SignalId, SignalInfo)] -- | The signals in the current architecture
- -> FApp -- | The application to look at.
+ [(SignalId, SignalInfo)] -- | The signals in the current architecture
+ -> [SignalMap] -- | The signals that are applied to function
+ -> SignalMap -- | the signals in which to store the function result
-- the similar form?
arg_ports = concat (map Foldable.toList (ent_args entity))
res_ports = Foldable.toList (ent_res entity)
-- the similar form?
arg_ports = concat (map Foldable.toList (ent_args entity))
res_ports = Foldable.toList (ent_res entity)
-- Extract the id part from the (id, type) tuple
ports = (map (fmap fst) (arg_ports ++ res_ports))
-- Translate signal numbers into names
-- Extract the id part from the (id, type) tuple
ports = (map (fmap fst) (arg_ports ++ res_ports))
-- Translate signal numbers into names