Skip to content

Commit

Permalink
[major] Add reference types.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtzSiFive committed Mar 1, 2023
1 parent a30819d commit 621c2e5
Show file tree
Hide file tree
Showing 3 changed files with 483 additions and 13 deletions.
27 changes: 27 additions & 0 deletions include/firrtl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<item>of</item>
<item>wire</item>
<item>node</item>
<item>ref</item>
<item>as</item>
<item>export</item>
<item>forward</item>
</list>
<list name="types">
<item>UInt</item>
Expand All @@ -28,6 +32,10 @@
<item>Reset</item>
<item>AsyncReset</item>
</list>
<list name="outertype">
<item>Probe</item>
<item>RWProbe</item>
</list>
<list name="conditionals">
<item>when</item>
<item>else</item>
Expand Down Expand Up @@ -78,11 +86,18 @@
<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>deposit</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="Structure" context="#stay" String="structure" />
<keyword attribute="PrimOp" context="#stay" String="primops" />
<keyword attribute="Conditional" context="#stay" String="conditionals" />
Expand All @@ -103,6 +118,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 @@ -128,11 +144,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 @@ -141,6 +167,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"/>
<DetectChar char="{" attribute="Separator" context="field"/>
<DetectChar char="}" attribute="Separator" context="#pop"/>
<AnyChar String=":," attribute="Separator" context="#stay"/>
Expand Down
1 change: 1 addition & 0 deletions revision-history.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ revisionHistory:
- Remove stray language leftover from removing conditionally valid.
- Add intrinsics.
- Fix parameter grammar to include name of parameter.
- Add reference types and related statements.
# Information about the old versions. This should be static.
oldVersions:
- version: 1.1.0
Expand Down
Loading

0 comments on commit 621c2e5

Please sign in to comment.