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
import qualified Convert.CaseKW
import qualified Convert.Logic
import qualified Convert.Typedef
import qualified Convert.PackedArrayFlatten
import qualified Convert.PackedArray
import qualified Convert.SplitPortDecl
import qualified Convert.StarPort
......@@ -22,7 +22,7 @@ type Phase = AST -> AST
phases :: Args.Target -> [Phase]
phases Args.YOSYS =
[ Convert.Typedef.convert
, Convert.PackedArrayFlatten.convert
, Convert.PackedArray.convert
, Convert.StarPort.convert
]
phases Args.VTR =
......
......@@ -69,8 +69,11 @@ traverseModuleItemsM mapper (Module name ports items) =
i2' <- genItemMapper i2
return $ GenIf e i1' i2'
genItemMapper (GenNull) = return GenNull
genItemMapper (GenModuleItem moduleItem) =
fullMapper moduleItem >>= return . GenModuleItem
genItemMapper (GenModuleItem moduleItem) = do
moduleItem' <- fullMapper moduleItem
return $ case moduleItem' of
Generate subItems -> GenBlock Nothing subItems
_ -> GenModuleItem moduleItem'
genItemMapper (GenCase e cases def) = do
caseItems <- mapM (genItemMapper . snd) cases
let cases' = zip (map fst cases) caseItems
......
......@@ -66,7 +66,7 @@ executable sv2v
Convert.AlwaysKW
Convert.CaseKW
Convert.Logic
Convert.PackedArrayFlatten
Convert.PackedArray
Convert.SplitPortDecl
Convert.StarPort
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