mirror of
https://github.com/zachjs/sv2v.git
synced 2026-09-02 19:48:30 +02:00
scope bit-indexed modport binding
This commit is contained in:
@@ -222,7 +222,10 @@ convertDescription tops parts (Part att ext Module lif name ports items) =
|
||||
then Nothing
|
||||
else Just (portName, modportBinding)
|
||||
where
|
||||
modportBinding = (substitutions, replaceBit modportE)
|
||||
modportBinding =
|
||||
( substitutions
|
||||
, scopeExprWithScopes modports $ replaceBit modportE
|
||||
)
|
||||
substitutions =
|
||||
genSubstitutions modports base instanceE modportE
|
||||
maybeInfo =
|
||||
|
||||
@@ -38,6 +38,8 @@ module Convert.Scoper
|
||||
, replaceInExpr
|
||||
, scopeExpr
|
||||
, scopeType
|
||||
, scopeExprWithScopes
|
||||
, scopeTypeWithScopes
|
||||
, insertElem
|
||||
, removeElem
|
||||
, injectItem
|
||||
@@ -209,6 +211,12 @@ scopeType = traverseNestedTypesM $ traverseTypeExprsM scopeExpr
|
||||
{-# INLINABLE scopeExpr #-}
|
||||
{-# INLINABLE scopeType #-}
|
||||
|
||||
scopeExprWithScopes :: Scopes a -> Expr -> Expr
|
||||
scopeExprWithScopes scopes = flip evalState scopes . scopeExpr
|
||||
|
||||
scopeTypeWithScopes :: Scopes a -> Type -> Type
|
||||
scopeTypeWithScopes scopes = flip evalState scopes . scopeType
|
||||
|
||||
class ScopePath k where
|
||||
toTiers :: Scopes a -> k -> [Tier]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user