Skip to content

Commit

Permalink
[major] Remove intrinsic modules. (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtzSiFive authored May 19, 2024
1 parent a1e58db commit e9de74f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 38 deletions.
1 change: 0 additions & 1 deletion include/firrtl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<item>circuit</item>
<item>module</item>
<item>extmodule</item>
<item>intmodule</item>
<item>layer</item>
</list>
<list name="keywords">
Expand Down
1 change: 1 addition & 0 deletions revision-history.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ revisionHistory:
- Update intrinsic module example to use a real intrinsic.
- Restore id and info in printf grammar, add to verif commands.
- Add intrinsic expressions and statements.
- Remove intrinsic modules.
abi:
- Add ABI for public modules and filelist output.
- Changed ABI for group and ref generated files.
Expand Down
38 changes: 1 addition & 37 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,34 +225,6 @@ Foo #(
endmodule
```

## Implementation Defined Modules (Intrinsics)

Intrinsics ([@sec:intrinsics]) can be expressed as intrinsic modules but this is deprecated.

Intrinsic modules are modules which represent implementation-defined, compiler-provided functionality.
Intrinsics generally are used for functionality which requires knowledge of the implementation or circuit not available to a library writer.
Which intrinsics are supported by an implementation is defined by the implementation.
The particular intrinsic represented by an intrinsic module is encoded in *intrinsic*.
The name of the intmodule is only used to identify a specific instance.
An implementation shall type-check all ports and parameters.
Ports may be uninferred (either width or reset) if specified by the implementation (which is useful for inspecting and interacting with those inference features).

``` firrtl
FIRRTL version 4.0.0
circuit Foo :
public module Foo :
;; snippetbegin
intmodule LTLDelay:
input in: UInt<1>
output out: UInt<1>
intrinsic = circt_ltl_delay
parameter delay = 1
parameter length = 0
;; snippetend
```

The types of intrinsic module parameters may only be literal integers or string literals.

## Layers

Layers are collections of functionality which will not be present in all executions of a circuit.
Expand Down Expand Up @@ -451,7 +423,7 @@ circuit Foo:
;; snippetend
```

This assumes you have a `module`, `extmodule`, or `intmodule` named `Passthrough`{.firrtl} declared elsewhere in the current circuit.
This assumes you have a `module` or `extmodule` named `Passthrough`{.firrtl} declared elsewhere in the current circuit.
The keyword `of`{.firrtl} is used instead of a colon (`:`{.firrtl}).

The type of a submodule instance is bundle type determined by its ports.
Expand Down Expand Up @@ -4194,7 +4166,6 @@ circuit =
decl =
decl_module
| decl_extmodule
| decl_intmodule
| decl_layer
| decl_type_alias ;
Expand All @@ -4212,13 +4183,6 @@ decl_extmodule =
{ "parameter" , id , "=" , type_param , newline } ,
dedent ;
decl_intmodule =
"intmodule" , id , ":" , [ info ] , newline , indent ,
{ port , newline } ,
"intrinsic" , "=" , id , newline ,
{ "parameter" , id , "=" , ( int | string_dq ) , newline } ,
dedent ;
decl_layer =
"layer" , id , string , ":" , [ info ] , newline , indent ,
{ decl_layer , newline } ,
Expand Down

0 comments on commit e9de74f

Please sign in to comment.