Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor] Add ABI to public module, extmodule #202

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

seldridge
Copy link
Member

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
Copy link
Member Author

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>:

Copy link
Collaborator

@darthscsi darthscsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do instances need to specify this? I don't think so, the module declarations should be enough.

@seldridge
Copy link
Member Author

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).

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.

Signed-off-by: Schuyler Eldridge <[email protected]>
@seldridge seldridge force-pushed the dev/seldridge/issue-171 branch from 8e4a4c5 to d38aee1 Compare June 24, 2024 17:21
@mmaloney-sf
Copy link
Collaborator

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

Eg:

@abi("v1")
public module Foo:

@abi("v2")
extmodule Bar:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Lowering Convention to External, Public Modules
3 participants