firrtl-spec icon indicating copy to clipboard operation
firrtl-spec copied to clipboard

[minor] Add ABI to public module, extmodule

Open seldridge opened this issue 10 months ago • 3 comments

Add a way to specify the port lowering ABI of a public module or an external module. This uses syntax like the following:

public module<v1> Foo:

extmodule<v2> Bar:

This includes language that indicates that the "v1" ABI is used if no ABI is specified. This makes this change fully backwards compatible with older FIRRTL versions (and thereby a "minor" change).

Fixes #171.

seldridge avatar Apr 10 '24 20:04 seldridge

Also, note that this is intended to not conflict with a future syntax for parameters or type parameters which would look similar, but would be located after the module name and not placed on the module keyword. Spitballing:

public module<v2> Foo<x: Int, y: String>:

seldridge avatar Apr 10 '24 21:04 seldridge

Do instances need to specify this?

They do not. It would also create some complications if they did as a single public module could then have different conventions requiring using the convention as part of the resulting module's name (this would affect the ABI of the module name and not just expectations around its ports).

seldridge avatar Jun 24 '24 17:06 seldridge

Absolute bikeshed: For the syntax, could we add a Java/Scala-style annotation syntax?

Eg:

@abi("v1")
public module Foo:

@abi("v2")
extmodule Bar:

mmaloney-sf avatar Jun 26 '24 16:06 mmaloney-sf