Skip to content

Commit

Permalink
[major] Add reference types. (#75)
Browse files Browse the repository at this point in the history
Introduce "reference types" for indirect access to FIRRTL constructs.
Add operations for generating probe references and using them to
remotely access data (via XMR's).
  • Loading branch information
dtzSiFive authored Mar 16, 2023
1 parent 42916db commit b53f533
Show file tree
Hide file tree
Showing 3 changed files with 769 additions and 13 deletions.
26 changes: 26 additions & 0 deletions include/firrtl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<item>of</item>
<item>wire</item>
<item>node</item>
<item>ref</item>
<item>define</item>
</list>
<list name="types">
<item>UInt</item>
Expand All @@ -28,6 +30,10 @@
<item>Reset</item>
<item>AsyncReset</item>
</list>
<list name="outertype">
<item>Probe</item>
<item>RWProbe</item>
</list>
<list name="typemodifiers">
<item>const</item>
</list>
Expand Down Expand Up @@ -81,11 +87,19 @@
<item>assert</item>
<item>assume</item>
<item>cover</item>
<item>read</item>
<item>probe</item>
<item>rwprobe</item>
<item>force</item>
<item>release</item>
<item>force_initial</item>
<item>release_initial</item>
</list>
<contexts>
<context name="Normal Text" attribute="ID" lineEndContext="#pop">
<keyword attribute="Keyword" context="#stay" String="keywords" />
<keyword attribute="Keyword" context="type" String="types" />
<keyword attribute="Keyword" context="outertype" String="outertype" />
<keyword attribute="Keyword" context="#stay" String="typemodifiers" />
<keyword attribute="Structure" context="#stay" String="structure" />
<keyword attribute="PrimOp" context="#stay" String="primops" />
Expand All @@ -108,6 +122,7 @@
<context name="memory" attribute="Keyword" lineEndContext="#stay">
<Detect2Chars char="=" char1="&gt;" attribute="Operator" context="memoryRHS"/>
<StringDetect String="read-under-write" attribute="Keyword" context="#pop!memoryLast"/>
<DetectChar char= ";" context="comment" attribute="Comment"/>
</context>
<context name="memoryRHS" attribute="ID" lineEndContext="#pop">
<keyword String="types" attribute="Keyword" context="type"/>
Expand All @@ -133,11 +148,21 @@
<context name="info" attribute="Info" lineEndContext="#stay">
<DetectChar char="]" context="#pop"/>
</context>
<context name="outertype" attribute="Keyword" lineEndContext="#pop">
<DetectChar char="&lt;" attribute="Operator" context="#stay"/>
<keyword String="types" attribute="Keyword" context="type"/>
<DetectChar char="{" context="field" attribute="Separator"/>
<DetectChar char="}" attribute="Separator" context="#pop#pop"/>
<DetectChar char= ";" context="comment" attribute="Comment"/>
<AnyChar String="&gt;," attribute="Operator" context="#pop"/>
<DetectChar char="[" attribute="Operator" context="widthOrDepthOrLit"/>
</context>
<context name="type" attribute="String" lineEndContext="#pop">
<AnyChar String="&lt;[(" attribute="Operator" context="widthOrDepthOrLit"/>
<AnyChar String="," attribute="Separator" context="#pop"/>
<AnyChar String="}" attribute="Separator" context="#pop#pop"/>
<DetectChar char= ";" context="comment" attribute="Comment"/>
<AnyChar String="&gt;" attribute="Operator" context="#pop"/>
</context>
<context name="widthOrDepthOrLit" attribute="String" lineEndContext="#stay">
<DetectChar char="&lt;" attribute="Operator" context="widthOrDepthOrLit"/>
Expand All @@ -146,6 +171,7 @@
<context name="field" attribute="ID" lineEndContext="#stay">
<StringDetect String="flip" attribute="Keyword" context="#stay"/>
<keyword String="types" attribute="Keyword" context="type"/>
<keyword String="outertype" attribute="Keyword" context="outertype"/>
<keyword String="typemodifiers" attribute="Keyword" context="#stay"/>
<DetectChar char="{" attribute="Separator" context="field"/>
<DetectChar char="}" attribute="Separator" context="#pop"/>
Expand Down
1 change: 1 addition & 0 deletions revision-history.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ revisionHistory:
- Render inline annotations as JSON, fix typo in example.
- Fix rendering of type modifiers (const) in document.
- Fix grammar for registers.
- Add reference types and related statements.
# Information about the old versions. This should be static.
oldVersions:
- version: 1.2.0
Expand Down
Loading

0 comments on commit b53f533

Please sign in to comment.