-- TODO: Using show here isn't really pretty, but we'll need some
-- unique-ish value...
let label = "comp_ins_" ++ (either show prettyShow) dst
- portmaps <- mkAssocElems args' ((either varToVHDLName id) dst) signature
+ let portmaps = mkAssocElems args' ((either varToVHDLName id) dst) signature
return ([mkComponentInst label entity_id portmaps], [f])
False -> do
-- Not a top level binder, so this must be a local variable reference.
-- TODO: Using show here isn't really pretty, but we'll need some
-- unique-ish value...
let label = "comp_ins_" ++ (either show prettyShow) dst
- portmaps <- mkAssocElems args' ((either varToVHDLName id) dst) signature
+ let portmaps = mkAssocElems args' ((either varToVHDLName id) dst) signature
return ([mkComponentInst label entity_id portmaps], [f])
False -> do
-- Not a top level binder, so this must be a local variable reference.
+--
-- Functions to create a VHDL testbench from a list of test input.
--
module CLasH.VHDL.Testbench where
let finalIDecs = iDecs ++
[AST.SigDec clockId std_logicTM (Just $ AST.PrimLit "'0'"),
AST.SigDec resetId std_logicTM (Just $ AST.PrimLit "'0'")]
- portmaps <- mkAssocElems (map idToVHDLExpr iIds) (AST.NSimple oId) signature
+ let portmaps = mkAssocElems (map idToVHDLExpr iIds) (AST.NSimple oId) signature
let mIns = mkComponentInst "totest" entId portmaps
(stimuliAssigns, stimuliDecs, cycles, used) <- createStimuliAssigns mCycles stimuli (head iIds)
let finalAssigns = (AST.CSSASm (AST.NSimple resetId AST.:<==:
[AST.Expr] -- ^ The argument that are applied to function
-> AST.VHDLName -- ^ The binder in which to store the result
-> Entity -- ^ The entity to map against.
- -> TranslatorSession [AST.AssocElem] -- ^ The resulting port maps
+ -> [AST.AssocElem] -- ^ The resulting port maps
mkAssocElems args res entity =
- return $ arg_maps ++ (Maybe.maybeToList res_map_maybe)
+ arg_maps ++ (Maybe.maybeToList res_map_maybe)
where
arg_ports = ent_args entity
res_port_maybe = ent_res entity