Skip to content

Commit 261beff

Browse files
committed
scope bit-indexed modport binding
1 parent 6226472 commit 261beff

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- macOS-13
4545
needs: build
4646
env:
47-
IVERILOG_REF: f31d0dcbc5ddcd97e1e2e6f7bc7eb0f5a547fe16
47+
IVERILOG_REF: ef7f0a8f38782dfc0872b1e352ccf32343c10bb8
4848
steps:
4949
- uses: actions/checkout@v4
5050
- name: Install Dependencies (macOS)

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* Fixed unconverted multidimensional struct fields within dimension queries
2727
* Fixed non-typenames (e.g., from packages or subsequent declarations)
2828
improperly shadowing the names of `struct` pattern fields
29+
* Fixed shadowing of interface array indices passed to port connections
2930
* Fixed failure to resolve typenames suffixed with dimensions in contexts
3031
permitting both types and expressions, e.g., `$bits(T[W-1:0])`
3132
* Fixed errant constant folding of shadowed non-trivial localparams

src/Convert/Interface.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ convertDescription tops parts (Part att ext Module lif name ports items) =
222222
then Nothing
223223
else Just (portName, modportBinding)
224224
where
225-
modportBinding = (substitutions, replaceBit modportE)
225+
modportBinding =
226+
( substitutions
227+
, scopeExprWithScopes modports $ replaceBit modportE
228+
)
226229
substitutions =
227230
genSubstitutions modports base instanceE modportE
228231
maybeInfo =

src/Convert/Scoper.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ module Convert.Scoper
3838
, replaceInExpr
3939
, scopeExpr
4040
, scopeType
41+
, scopeExprWithScopes
42+
, scopeTypeWithScopes
4143
, insertElem
4244
, removeElem
4345
, injectItem
@@ -209,6 +211,12 @@ scopeType = traverseNestedTypesM $ traverseTypeExprsM scopeExpr
209211
{-# INLINABLE scopeExpr #-}
210212
{-# INLINABLE scopeType #-}
211213

214+
scopeExprWithScopes :: Scopes a -> Expr -> Expr
215+
scopeExprWithScopes scopes = flip evalState scopes . scopeExpr
216+
217+
scopeTypeWithScopes :: Scopes a -> Type -> Type
218+
scopeTypeWithScopes scopes = flip evalState scopes . scopeType
219+
212220
class ScopePath k where
213221
toTiers :: Scopes a -> k -> [Tier]
214222

0 commit comments

Comments
 (0)