Skip to content

Verilog: arrays of interface ports - #2079

Draft
kroening wants to merge 1 commit into
mainfrom
kroening/frontend-issue3
Draft

Verilog: arrays of interface ports#2079
kroening wants to merge 1 commit into
mainfrom
kroening/frontend-issue3

Conversation

@kroening

@kroening kroening commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

This implements SystemVerilog unpacked dimensions for interface ports (IEEE 1800-2017 section 25.4, and ansi_port_declaration in A.1.3).

Minimal example

interface ifc;
  logic x;
  modport mp (input x);
endinterface

module m(ifc.mp a[0:3]);
endmodule

@tautschnig

Copy link
Copy Markdown
Collaborator

This needs git conflict resolution.

@kroening
kroening force-pushed the kroening/frontend-issue3 branch 2 times, most recently from 2cec063 to a1f05db Compare August 11, 2026 20:30
@kroening
kroening marked this pull request as draft August 11, 2026 21:27
SystemVerilog allows an interface port to have unpacked dimensions, i.e.,
an array of interface ports (IEEE 1800-2017 section 25.4, and
ansi_port_declaration in A.1.3). The parser rejected the dimension:

  interface ifc;
    logic x;
    modport mp (input x);
  endinterface

  module m(ifc.mp a[0:3]);   // syntax error, unexpected '['
  endmodule

Each element of the array yields an interface instance of its own, named
bus[0], bus[1], and so on, and each of those is bound to the interface
instance that the port connection gives for that element.  Selecting an
element of such an array, e.g. bus[0].some_signal, resolves to the member
of the interface instance for that element.  Any number of dimensions is
supported.

The array elements may be given as an assignment pattern, one interface
instance per element, or by the name of another array of interfaces, which
is how a module passes on an array of interface ports that it has itself
been given.
@kroening
kroening force-pushed the kroening/frontend-issue3 branch from a1f05db to 0376c43 Compare August 12, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants