scope bit-indexed modport binding

This commit is contained in:
Zachary Snow
2024-05-01 09:07:31 -04:00
parent 7a7482c964
commit 05cafc3d2a
4 changed files with 14 additions and 2 deletions
+4 -1
View File
@@ -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 =
+8
View File
@@ -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]