mirror of https://github.com/zachjs/sv2v.git
type inference for localparams performed lazily
The implicit type of a localparam is not always needed. This improves performance when complex localparam expressions are processed.
This commit is contained in:
parent
9de4d44305
commit
e09aea48e0
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
module Convert.TypeOf (convert) where
|
module Convert.TypeOf (convert) where
|
||||||
|
|
||||||
|
import Control.Monad.State.Strict
|
||||||
import Data.Tuple (swap)
|
import Data.Tuple (swap)
|
||||||
|
|
||||||
import Convert.ExprUtils (dimensionsSize, endianCondRange, simplify)
|
import Convert.ExprUtils (dimensionsSize, endianCondRange, simplify)
|
||||||
|
|
@ -71,7 +72,8 @@ traverseDeclM decl = do
|
||||||
-- rewrite and store a non-genvar data declaration's type information
|
-- rewrite and store a non-genvar data declaration's type information
|
||||||
insertType :: Identifier -> Type -> ST ()
|
insertType :: Identifier -> Type -> ST ()
|
||||||
insertType ident typ = do
|
insertType ident typ = do
|
||||||
typ' <- scopeType typ
|
-- hack to make this evaluation lazy
|
||||||
|
typ' <- gets $ evalState $ scopeType typ
|
||||||
insertElem ident typ'
|
insertElem ident typ'
|
||||||
|
|
||||||
-- convert TypeOf in a ModuleItem
|
-- convert TypeOf in a ModuleItem
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue