Skip to content

Commit

Permalink
fixup! [major] Add public modules
Browse files Browse the repository at this point in the history
  • Loading branch information
seldridge committed Sep 28, 2023
1 parent 9da0d2b commit 1d75ba5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions revision-history.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ revisionHistory:
# additions to the specification should append entries here.
thisVersion:
spec:
- Add public modules. Change circuits to support any number of public
modules which may have disjoint instance hierarchies.
abi:
- Add ABI for public modules and filelist output.
# Information about the old versions. This should be static.
oldVersions:
- version: 3.2.0
Expand Down
11 changes: 6 additions & 5 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ instance statement for details on how to instantiate a module
### Public Modules

A public module is a module that is marked with the `public`{.firrtl} keyword.
This means that this is a module that is usable external to this circuit. A
public module thereby has a defined ABI---knowing the FIRRTL representation is
sufficient to know its compiled representation.
A public module has a defined ABI---knowing the FIRRTL representation is
sufficient to know its compiled representation. This means that a public module
is available external to this circuit.

The example below shows a public module `Foo`:

Expand All @@ -250,7 +250,8 @@ The last point requires clarification. A public module may or may not be
instantiated by other modules in a circuit. Regardless of whether or not it is
instantiated, a public module is always compiled as if it was never
instantiated. However, modules which instantiate public modules are allowed to
optimize _through_ a public module.
be compiled using full knowledge of the internals of the public modules they
instantiate.

For more information on the lowering of public modules, see the FIRRTL ABI
Specification.
Expand Down Expand Up @@ -4067,7 +4068,7 @@ statement =
(* Module definitions *)
port = ( "input" | "output" ) , id , ":" , (type | type_property) , [ info ] ;
module = "module" , id , ":" , [ info ] , newline , indent ,
module = [ "public" ] , "module" , id , ":" , [ info ] , newline , indent ,
{ port , newline } ,
{ statement , newline } ,
dedent ;
Expand Down

0 comments on commit 1d75ba5

Please sign in to comment.