Skip to content

Commit 507d588

Browse files
committed
Better position for error when wrong number of ports are returned by portNames
1 parent 1013b89 commit 507d588

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Libraries/Base1/Prelude.bs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4590,7 +4590,8 @@ checkPortNames proxy base =
45904590
let pn = portNames proxy base
45914591
in
45924592
if listLength pn /= valueOf n
4593-
then error $ "SplitPorts: " +++ base +++ " has " +++ integerToString (valueOf n) +++
4593+
then primError (getEvalPosition proxy) $
4594+
"SplitPorts: " +++ base +++ " has " +++ integerToString (valueOf n) +++
45944595
" ports, but " +++ integerToString (listLength pn) +++ " port names were given"
45954596
else pn
45964597

testsuite/bsc.verilog/splitports/BadSplitInst_TooManyPortNames.bs.bsc-vcomp-out.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
checking package dependencies
22
compiling BadSplitInst_TooManyPortNames.bs
33
code generation for sysBadSplitInst_TooManyPortNames starts
4-
Error: "Prelude.bs", line 4593, column 61: (S0015)
4+
Error: "BadSplitInst_TooManyPortNames.bs", line 17, column 12: (S0015)
55
Bluespec evaluation-time error: SplitPorts: fooIn_1 has 2 ports, but 3 port
66
names were given
77
During elaboration of `sysBadSplitInst_TooManyPortNames' at

0 commit comments

Comments
 (0)