From: Christiaan Baaij Date: Tue, 23 Jun 2009 14:22:58 +0000 (+0200) Subject: Merge branch 'cλash' of http://git.stderr.nl/matthijs/projects/master-project X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=dfdf88c20bacf8f8e7863cf7a41c86c869735f6f;hp=69f55a9c6716f385e22378ce8be378e08b02377d;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Merge branch 'cλash' of git.stderr.nl/matthijs/projects/master-project * 'cλash' of http://git.stderr.nl/matthijs/projects/master-project: Add a hardware module for a generalized Alu. Make mkConcSm support a = b style bindings. Make appsimpl also simplify dataconstructors. Make subeverywhere support NonRec Lets. --- diff --git a/Generate.hs b/Generate.hs index 9a3a48c..5c1ca08 100644 --- a/Generate.hs +++ b/Generate.hs @@ -76,6 +76,7 @@ genUnconsVectorFuns elemTM vectorTM = , 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" @@ -233,4 +234,18 @@ genUnconsVectorFuns elemTM vectorTM = [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 diff --git a/GlobalNameTable.hs b/GlobalNameTable.hs index 429b966..45eed89 100644 --- a/GlobalNameTable.hs +++ b/GlobalNameTable.hs @@ -29,6 +29,7 @@ globalNameTable = mkGlobalNameTable , ("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 ) )