Modport method prototypes, unnamed DPI formals, and the const ref comment gap

TODO section 30 (coverage_gaps M13, corrected).
A modport port may be a method prototype - import task drive(int x),
export function int get() - parsed by Parser::parse_tf_header, the
one header parse parse_function_decl and parse_task_decl now
destructure, printed by Fmt::tf_header, bound as Target::InScope
(IEEE 1800-2017 25.5: a modport names a member of its own interface)
with the formals declared in a scope of their own; one prototype per
import/export group, the LRM's comma list still a clean error
(recorded narrowing). A DPI import's formals may be unnamed
(35.5.5) behind parse_tf_ports(allow_unnamed), the empty-name
convention documented on TfArg::name, every other caller unchanged
and a non-DPI unnamed formal still an error at its position. M13's
const half was misfiled - const ref already parsed - but the probe
found the unowned gap in const /*c*/ ref, now TfArg::after_const.
Proof: 3 223 tests / 48 binaries, corpus 814/820, 4 807 corpus +
opentitan files byte-identical to 0.33.0 (zero population), QA's
adversarial probes and consumer audit of the possibly-empty names.

docs/features/interface-dpi-arms/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5 committed 2026-09-03 02:27:24 -07:00
1 parent d1821ff859
commit ee0faa2e18
22 files changed
+1208 -156

No files matched your search

+13 -6
View File
@@ -42,10 +42,16 @@ At the start of this round `interface` was the corpus's top blocker at
- A modport port is a **direction keyword plus the names it governs**.
The source's grouping is preserved (`input valid, data` is one group,
not two ports), because regrouping it would be a token-order change
for no gain. The explicit modport port (`.name(expr)`) and the modport
method *prototype* (`import task drive(int x);` with a signature) are
not supported — a bare `import drive_task, check_task;` is. Neither
prototype form occurs in the corpus.
for no gain. The explicit modport port (`.name(expr)`) is not
supported. The modport method *prototype* (`import task drive(int x)`
with a signature) was not either; *amended 2026-09-02 by
`interface-dpi-arms`* it is — `ModportPort::prototype` holds the
header, printed through the same printer a real `task`/`function`
header uses, and its name resolves to the interface's own subroutine.
One narrowing survives: an `import`/`export` group carries **one**
prototype, not the LRM's comma-separated list of `modport_tf_port`s
(`import task t(), drive2` still errors). Neither form occurs in the
corpus.
- A clocking skew is kept as **text as written** (`#2`, `#1step`,
`negedge`), not as an expression: it is a delay or an edge and lucisv
never re-lays-out either. The `#(min:typ:max)` skew spelling is not
@@ -151,8 +157,9 @@ Requests to other owners (not done here):
plus 8 parser unit tests, covering every corpus shape cited above,
comments in every position, a `verilog_format: off` fence and the
line-length boundary
- [ ] Not done, and not planned here: explicit modport ports, modport
method prototypes, `#(min:typ:max)` skews (see Assumptions).
- [ ] Not done, and not planned here: explicit modport ports,
`#(min:typ:max)` skews (see Assumptions). Modport method
prototypes landed 2026-09-02 in `interface-dpi-arms`.
`program` and clocking `= expr` items landed in §11 round 2;
`interface class` landed 2026-09-02 in `vendor-formal-grammar` —
as a class, which is what it is