Commit 107291e7 by Zachary Snow

significant refactor of packed array flatten conversion; now supports module…

significant refactor of packed array flatten conversion; now supports module items in generate blocks
parent cf232677
...@@ -13,7 +13,7 @@ import qualified Convert.AlwaysKW ...@@ -13,7 +13,7 @@ import qualified Convert.AlwaysKW
import qualified Convert.CaseKW import qualified Convert.CaseKW
import qualified Convert.Logic import qualified Convert.Logic
import qualified Convert.Typedef import qualified Convert.Typedef
import qualified Convert.PackedArrayFlatten import qualified Convert.PackedArray
import qualified Convert.SplitPortDecl import qualified Convert.SplitPortDecl
import qualified Convert.StarPort import qualified Convert.StarPort
...@@ -22,7 +22,7 @@ type Phase = AST -> AST ...@@ -22,7 +22,7 @@ type Phase = AST -> AST
phases :: Args.Target -> [Phase] phases :: Args.Target -> [Phase]
phases Args.YOSYS = phases Args.YOSYS =
[ Convert.Typedef.convert [ Convert.Typedef.convert
, Convert.PackedArrayFlatten.convert , Convert.PackedArray.convert
, Convert.StarPort.convert , Convert.StarPort.convert
] ]
phases Args.VTR = phases Args.VTR =
......
...@@ -69,8 +69,11 @@ traverseModuleItemsM mapper (Module name ports items) = ...@@ -69,8 +69,11 @@ traverseModuleItemsM mapper (Module name ports items) =
i2' <- genItemMapper i2 i2' <- genItemMapper i2
return $ GenIf e i1' i2' return $ GenIf e i1' i2'
genItemMapper (GenNull) = return GenNull genItemMapper (GenNull) = return GenNull
genItemMapper (GenModuleItem moduleItem) = genItemMapper (GenModuleItem moduleItem) = do
fullMapper moduleItem >>= return . GenModuleItem moduleItem' <- fullMapper moduleItem
return $ case moduleItem' of
Generate subItems -> GenBlock Nothing subItems
_ -> GenModuleItem moduleItem'
genItemMapper (GenCase e cases def) = do genItemMapper (GenCase e cases def) = do
caseItems <- mapM (genItemMapper . snd) cases caseItems <- mapM (genItemMapper . snd) cases
let cases' = zip (map fst cases) caseItems let cases' = zip (map fst cases) caseItems
......
...@@ -66,7 +66,7 @@ executable sv2v ...@@ -66,7 +66,7 @@ executable sv2v
Convert.AlwaysKW Convert.AlwaysKW
Convert.CaseKW Convert.CaseKW
Convert.Logic Convert.Logic
Convert.PackedArrayFlatten Convert.PackedArray
Convert.SplitPortDecl Convert.SplitPortDecl
Convert.StarPort Convert.StarPort
Convert.Typedef Convert.Typedef
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment