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

Add Lowering Convention to External, Public Modules #171

Open
seldridge opened this issue Feb 11, 2024 · 0 comments · May be fixed by #202
Open

Add Lowering Convention to External, Public Modules #171

seldridge opened this issue Feb 11, 2024 · 0 comments · May be fixed by #202

Comments

@seldridge
Copy link
Member

seldridge commented Feb 11, 2024

Both external and public modules need to specify their port lowering convention. Currently, this is underspecified and left up to a compiler to implement (with annotations or a global option).

Some constraints:

  • The syntax should be similar for both external and public modules.
  • This should by optional in the syntax with a default convention (v1) assumed if not defined. This provides backwards compatibility with the current behavior.
  • The syntax shouldn't cause problems or confusion when trying to implement parameters later.
  • enablelayer currently goes after the module name

The following are some syntax ideas:

String after "public"

public v2 module Foo:

This is slightly problematic as it is incongruent with external modules which don't have the public keyword. We could add the public keyword to them:

public v1 extmodule Bar:

Use a string that starts with v after the module name:

public module Foo v2 enablelayer A:
extmodule Bar v1:

Use brackets, parentheses, or something like that

public module<v2> Foo:
extmodule<v1> Bar:

I expect that parameters will eventually show up as Foo<x: Int> type syntax, so this may not conflict too badly.

Make the convention port-like

public module Foo:
  convention v2
extmodule Bar:
  convention v1

Use an attribute dictionary-like syntax

public module Foo enablelayer A {convention = v2}:
extmodule Bar {convention = v1}:
seldridge added a commit that referenced this issue Apr 10, 2024
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 linked a pull request Apr 10, 2024 that will close this issue
seldridge added a commit that referenced this issue Jun 24, 2024
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]>
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 a pull request may close this issue.

1 participant