Skip to content

Commit 03dcdbf

Browse files
committed
Add memory port related keywords.
1 parent 77b9613 commit 03dcdbf

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

examples/memory.uir

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
%0:1 = input "clk"
2+
%1:5 = input "waddr"
3+
%2:32 = input "wdata"
4+
%3:5 = input "raddr"
5+
%4:1 = input "ren"
6+
%5:32 = memory depth=#32 width=#32 {
7+
init 00000000000000000000000000000000
8+
init 00000000000000000000000000000000
9+
init 00000000000000000000000000000000
10+
init 00000000000000000000000000000000
11+
init 00000000000000000000000000000000
12+
init 00000000000000000000000000000000
13+
init 00000000000000000000000000000000
14+
init 00000000000000000000000000000000
15+
init 00000000000000000000000000000000
16+
init 00000000000000000000000000000000
17+
init 00000000000000000000000000000000
18+
init 00000000000000000000000000000000
19+
init 00000000000000000000000000000000
20+
init 00000000000000000000000000000000
21+
init 00000000000000000000000000000000
22+
init 00000000000000000000000000000000
23+
init 00000000000000000000000000000000
24+
init 00000000000000000000000000000000
25+
init 00000000000000000000000000000000
26+
init 00000000000000000000000000000000
27+
init 00000000000000000000000000000000
28+
init 00000000000000000000000000000000
29+
init 00000000000000000000000000000000
30+
init 00000000000000000000000000000000
31+
init 00000000000000000000000000000000
32+
init 00000000000000000000000000000000
33+
init 00000000000000000000000000000000
34+
init 00000000000000000000000000000000
35+
init 00000000000000000000000000000000
36+
init 00000000000000000000000000000000
37+
init 00000000000000000000000000000000
38+
init 00000000000000000000000000000000
39+
write addr=%1:5 data=%2:32 mask=11111111111111111111111111111111 clk=%0
40+
read addr=%3:5 width=#32 clk=%0 en=%4 [rdfirst]
41+
}
42+
%6:32 = dff %5:32 clk=%0 init=00000000000000000000000000000000
43+
%7:0 = output "rdata" %6:32

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"author": "Catherine <[email protected]>",
77
"license": "BSD-0-Clause",
88
"homepage": "https://github.com/prjunnamed/",
9-
"version": "0.2.1",
9+
"version": "0.2.2",
1010
"repository": {
1111
"type": "git",
1212
"url": "https://github.com/prjunnamed/vscode-syntax.git"

syntaxes/prjunnamed.tmLanguage.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
{"include": "#cell-ref"},
1313
{"include": "#cell-ref-added"},
1414
{"include": "#cell-name"},
15+
{"include": "#memory-cell"},
1516
{"include": "#diff-added"},
1617
{"include": "#diff-removed"}
1718
]
@@ -53,9 +54,31 @@
5354
"name": "markup.inserted.prjunnamed"
5455
},
5556
"cell-name": {
56-
"match": "buf|not|and|or|xor|mux|adc|eq|ult|slt|shl|ushr|sshr|xshr|mul|udiv|umod|sdiv_trunc|sdiv_floor|smod_trunc|smod_floor|match|assign|dff|memory|iobuf|target|input|output|name",
57+
"match": "buf|not|and|or|xor|mux|adc|eq|ult|slt|shl|ushr|sshr|xshr|mul|udiv|umod|sdiv_trunc|sdiv_floor|smod_trunc|smod_floor|match|assign|dff|iobuf|target|input|output|name",
5758
"name": "keyword.other.cell.prjunnamed"
5859
},
60+
"memory-cell": {
61+
"begin": "memory",
62+
"end": "^\\s*}",
63+
"beginCaptures": {"0": {"name": "keyword.other.cell.prjunnamed"}},
64+
"patterns": [
65+
{"include": "#comment"},
66+
{"include": "#decimal"},
67+
{"include": "#ternary"},
68+
{"include": "#cell-ref"},
69+
{"include": "#cell-ref-added"},
70+
{"include": "#memory-clause"},
71+
{"include": "#memory-port-relation"}
72+
]
73+
},
74+
"memory-clause": {
75+
"match": "init|write|read",
76+
"name": "keyword.other.memory-clause.prjunnamed"
77+
},
78+
"memory-port-relation": {
79+
"match": "undef|rdfirst|trans",
80+
"name": "keyword.other.memory-port-relation.prjunnamed"
81+
},
5982
"diff-added": {
6083
"begin": "^\\+%_?\\d+(:\\d+)?(\\+\\d+)?",
6184
"end": "\n",

0 commit comments

Comments
 (0)