, AST.SubProgBody plusgtSpec [AST.SPVD plusgtVar] [plusgtExpr, plusgtRet]
, AST.SubProgBody emptySpec [AST.SPVD emptyVar] [emptyExpr]
, AST.SubProgBody singletonSpec [AST.SPVD singletonVar] [singletonRet]
+ , AST.SubProgBody copySpec [AST.SPVD copyVar] [copyExpr]
]
where
ixPar = AST.unsafeVHDLBasicId "ix"
[AST.ToRange (AST.PrimLit "0") (AST.PrimLit "0")]))
(Just $ AST.Aggregate [AST.ElemAssoc (Just AST.Others)
(AST.PrimName $ AST.NSimple aPar)])
- singletonRet = AST.ReturnSm (Just $ AST.PrimName $ AST.NSimple resId)
\ No newline at end of file
+ singletonRet = AST.ReturnSm (Just $ AST.PrimName $ AST.NSimple resId)
+ copySpec = AST.Function copyId [AST.IfaceVarDec nPar naturalTM,
+ AST.IfaceVarDec aPar elemTM ] vectorTM
+ -- variable res : fsvec_x (0 to n-1) := (others => a);
+ copyVar =
+ AST.VarDec resId
+ (AST.SubtypeIn vectorTM
+ (Just $ AST.ConstraintIndex $ AST.IndexConstraint
+ [AST.ToRange (AST.PrimLit "0")
+ ((AST.PrimName (AST.NSimple nPar)) AST.:-:
+ (AST.PrimLit "1")) ]))
+ (Just $ AST.Aggregate [AST.ElemAssoc (Just AST.Others)
+ (AST.PrimName $ AST.NSimple aPar)])
+ -- return res
+ copyExpr = AST.ReturnSm (Just $ AST.PrimName $ AST.NSimple resId)
\ No newline at end of file
, ("map" , (2, Right $ genMapCall ) )
, ("empty" , (0, Left $ genExprFCall emptyId ) )
, ("singleton" , (1, Left $ genExprFCall singletonId ) )
+ , ("copy" , (2, Left $ genExprFCall copyId ) )
, ("hwxor" , (2, Left $ genExprOp2 AST.Xor ) )
, ("hwand" , (2, Left $ genExprOp2 AST.And ) )
, ("hwor" , (2, Left $ genExprOp2 AST.Or ) )