blob: 46235bd654a6b7eaadb0a4fbc5b7e09645bafaf2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
defpackage firrtl.ir2 :
import core
import verse
public definterface Direction
public val INPUT = new Direction
public val OUTPUT = new Direction
public definterface Gender
public val MALE = new Gender
public val FEMALE = new Gender
public val UNKNOWN-GENDER = new Gender
public val BI-GENDER = new Gender
public definterface Width
public defstruct UnknownWidth <: Width
public defstruct IntWidth <: Width :
width: Int
public defstruct PrimOp
public val ADD-OP = PrimOp()
public val ADD-UU-OP = PrimOp()
public val ADD-US-OP = PrimOp()
public val ADD-SU-OP = PrimOp()
public val ADD-SS-OP = PrimOp()
public val SUB-OP = PrimOp()
public val SUB-UU-OP = PrimOp()
public val SUB-US-OP = PrimOp()
public val SUB-SU-OP = PrimOp()
public val SUB-SS-OP = PrimOp()
public val MUL-OP = PrimOp()
public val MUL-UU-OP = PrimOp()
public val MUL-US-OP = PrimOp()
public val MUL-SU-OP = PrimOp()
public val MUL-SS-OP = PrimOp()
public val DIV-OP = PrimOp()
public val DIV-UU-OP = PrimOp()
public val DIV-US-OP = PrimOp()
public val DIV-SU-OP = PrimOp()
public val DIV-SS-OP = PrimOp()
public val MOD-OP = PrimOp()
public val MOD-UU-OP = PrimOp()
public val MOD-US-OP = PrimOp()
public val MOD-SU-OP = PrimOp()
public val MOD-SS-OP = PrimOp()
public val QUO-OP = PrimOp()
public val QUO-UU-OP = PrimOp()
public val QUO-US-OP = PrimOp()
public val QUO-SU-OP = PrimOp()
public val QUO-SS-OP = PrimOp()
public val REM-OP = PrimOp()
public val REM-UU-OP = PrimOp()
public val REM-US-OP = PrimOp()
public val REM-SU-OP = PrimOp()
public val REM-SS-OP = PrimOp()
public val ADD-WRAP-OP = PrimOp()
public val ADD-WRAP-UU-OP = PrimOp()
public val ADD-WRAP-US-OP = PrimOp()
public val ADD-WRAP-SU-OP = PrimOp()
public val ADD-WRAP-SS-OP = PrimOp()
public val SUB-WRAP-OP = PrimOp()
public val SUB-WRAP-UU-OP = PrimOp()
public val SUB-WRAP-US-OP = PrimOp()
public val SUB-WRAP-SU-OP = PrimOp()
public val SUB-WRAP-SS-OP = PrimOp()
public val LESS-OP = PrimOp()
public val LESS-UU-OP = PrimOp()
public val LESS-US-OP = PrimOp()
public val LESS-SU-OP = PrimOp()
public val LESS-SS-OP = PrimOp()
public val LESS-EQ-OP = PrimOp()
public val LESS-EQ-UU-OP = PrimOp()
public val LESS-EQ-US-OP = PrimOp()
public val LESS-EQ-SU-OP = PrimOp()
public val LESS-EQ-SS-OP = PrimOp()
public val GREATER-OP = PrimOp()
public val GREATER-UU-OP = PrimOp()
public val GREATER-US-OP = PrimOp()
public val GREATER-SU-OP = PrimOp()
public val GREATER-SS-OP = PrimOp()
public val GREATER-EQ-OP = PrimOp()
public val GREATER-EQ-UU-OP = PrimOp()
public val GREATER-EQ-US-OP = PrimOp()
public val GREATER-EQ-SU-OP = PrimOp()
public val GREATER-EQ-SS-OP = PrimOp()
public val EQUAL-OP = PrimOp()
public val EQUAL-UU-OP = PrimOp()
public val EQUAL-SS-OP = PrimOp()
public val MUX-OP = PrimOp()
public val MUX-UU-OP = PrimOp()
public val MUX-SS-OP = PrimOp()
public val PAD-OP = PrimOp()
public val PAD-U-OP = PrimOp()
public val PAD-S-OP = PrimOp()
public val AS-UINT-OP = PrimOp()
public val AS-UINT-U-OP = PrimOp()
public val AS-UINT-S-OP = PrimOp()
public val AS-SINT-OP = PrimOp()
public val AS-SINT-U-OP = PrimOp()
public val AS-SINT-S-OP = PrimOp()
public val SHIFT-LEFT-OP = PrimOp()
public val SHIFT-LEFT-U-OP = PrimOp()
public val SHIFT-LEFT-S-OP = PrimOp()
public val SHIFT-RIGHT-OP = PrimOp()
public val SHIFT-RIGHT-U-OP = PrimOp()
public val SHIFT-RIGHT-S-OP = PrimOp()
public val CONVERT-OP = PrimOp()
public val CONVERT-U-OP = PrimOp()
public val CONVERT-S-OP = PrimOp()
public val BIT-AND-OP = PrimOp()
public val BIT-OR-OP = PrimOp()
public val BIT-XOR-OP = PrimOp()
public val CONCAT-OP = PrimOp()
public val BIT-SELECT-OP = PrimOp()
public val BITS-SELECT-OP = PrimOp()
public definterface Expression
public defmulti type (e:Expression) -> Type
public defstruct Ref <: Expression :
name: Symbol
type: Type [multi => false]
public defstruct Subfield <: Expression :
exp: Expression
name: Symbol
type: Type [multi => false]
public defstruct Index <: Expression :
exp: Expression
value: Int
type: Type [multi => false]
public defstruct UIntValue <: Expression :
value: Int
width: Width
public defstruct SIntValue <: Expression :
value: Int
width: Width
public defstruct DoPrim <: Expression :
op: PrimOp
args: List<Expression>
consts: List<Int>
type: Type [multi => false]
public defstruct ReadPort <: Expression :
mem: Expression
index: Expression
type: Type [multi => false]
public defstruct Null <: Expression
public definterface Stmt
public defstruct LetRec <: Stmt :
entries: List<KeyValue<Symbol, Element>>
body: Stmt
public defstruct DefWire <: Stmt :
name: Symbol
type: Type
public defstruct DefRegister <: Stmt :
name: Symbol
type: Type
public defstruct DefInstance <: Stmt :
name: Symbol
module: Expression
public defstruct DefMemory <: Stmt :
name: Symbol
type: VectorType
public defstruct DefNode <: Stmt :
name: Symbol
value: Expression
public defstruct DefAccessor <: Stmt :
name: Symbol
source: Expression
index: Expression
public defstruct Conditionally <: Stmt :
pred: Expression
conseq: Stmt
alt: Stmt
public defstruct Begin <: Stmt :
body: List<Stmt>
public defstruct Connect <: Stmt :
loc: Expression
exp: Expression
public defstruct EmptyStmt <: Stmt
public definterface Element
public defmulti type (e:Element) -> Type
public defstruct Register <: Element :
type: Type [multi => false]
value: Expression
enable: Expression
public defstruct Memory <: Element :
type: Type [multi => false]
writers: List<WritePort>
public defstruct WritePort :
index: Expression
value: Expression
enable: Expression
public defstruct Node <: Element :
type: Type [multi => false]
value: Expression
public defstruct Instance <: Element :
type: Type [multi => false]
module: Expression
ports: List<KeyValue<Symbol,Expression>>
public definterface Type
public defstruct UIntType <: Type :
width: Width
public defstruct SIntType <: Type :
width: Width
public defstruct BundleType <: Type :
fields: List<Field>
public defstruct VectorType <: Type :
type: Type
size: Int
public defstruct UnknownType <: Type
public defstruct Field :
name: Symbol
gender: Gender
type: Type
public defstruct Port :
name: Symbol
direction: Direction
type: Type
public defstruct Module :
name: Symbol
ports: List<Port>
body: Stmt
public defstruct Circuit :
modules: List<Module>
main: Symbol
|