Clean up source files:
[matthijs/master-project/cλash.git] / cλash / CLasH / VHDL / Constants.hs
1 module CLasH.VHDL.Constants where
2
3 -- VHDL Imports  
4 import qualified Language.VHDL.AST as AST
5
6 --------------
7 -- Identifiers
8 --------------
9
10 -- | reset and clock signal identifiers in String form
11 resetStr, clockStr :: String
12 resetStr = "resetn"
13 clockStr = "clock"
14
15 -- | reset and clock signal identifiers in basic AST.VHDLId form
16 resetId, clockId :: AST.VHDLId
17 resetId = AST.unsafeVHDLBasicId resetStr
18 clockId = AST.unsafeVHDLBasicId clockStr
19
20 integerId :: AST.VHDLId
21 integerId = AST.unsafeVHDLBasicId "integer"
22
23 -- | \"types\" identifier
24 typesId :: AST.VHDLId
25 typesId = AST.unsafeVHDLBasicId "types"
26
27 -- | work identifier
28 workId :: AST.VHDLId
29 workId = AST.unsafeVHDLBasicId "work"
30
31 -- | std identifier
32 stdId :: AST.VHDLId
33 stdId = AST.unsafeVHDLBasicId "std"
34
35
36 -- | textio identifier
37 textioId :: AST.VHDLId
38 textioId = AST.unsafeVHDLBasicId "textio"
39
40 -- | range attribute identifier
41 rangeId :: AST.VHDLId
42 rangeId = AST.unsafeVHDLBasicId "range"
43
44
45 -- | high attribute identifier
46 highId :: AST.VHDLId
47 highId = AST.unsafeVHDLBasicId "high"
48
49 -- | range attribute identifier
50 imageId :: AST.VHDLId
51 imageId = AST.unsafeVHDLBasicId "image"
52
53 -- | event attribute identifie
54 eventId :: AST.VHDLId
55 eventId = AST.unsafeVHDLBasicId "event"
56
57
58 -- | default function identifier
59 defaultId :: AST.VHDLId
60 defaultId = AST.unsafeVHDLBasicId "default"
61
62 -- FSVec function identifiers
63
64 -- | ex (operator ! in original Haskell source) function identifier
65 exId :: String
66 exId = "!"
67
68 -- | sel (function select in original Haskell source) function identifier
69 selId :: String
70 selId = "select"
71
72
73 -- | ltplus (function (<+) in original Haskell source) function identifier
74 ltplusId :: String
75 ltplusId = "<+"
76
77
78 -- | plusplus (function (++) in original Haskell source) function identifier
79 plusplusId :: String
80 plusplusId = "++"
81
82
83 -- | empty function identifier
84 emptyId :: String
85 emptyId = "empty"
86
87 -- | plusgt (function (+>) in original Haskell source) function identifier
88 plusgtId :: String
89 plusgtId = "+>"
90
91 -- | singleton function identifier
92 singletonId :: String
93 singletonId = "singleton"
94
95 -- | length function identifier
96 lengthId :: String
97 lengthId = "length"
98
99
100 -- | isnull (function null in original Haskell source) function identifier
101 nullId :: String
102 nullId = "null"
103
104
105 -- | replace function identifier
106 replaceId :: String
107 replaceId = "replace"
108
109
110 -- | head function identifier
111 headId :: String
112 headId = "head"
113
114
115 -- | last function identifier
116 lastId :: String
117 lastId = "last"
118
119
120 -- | init function identifier
121 initId :: String
122 initId = "init"
123
124
125 -- | tail function identifier
126 tailId :: String
127 tailId = "tail"
128
129 -- | minimum ftp function identifier
130 minimumId :: String
131 minimumId = "minimum"
132
133 -- | take function identifier
134 takeId :: String
135 takeId = "take"
136
137
138 -- | drop function identifier
139 dropId :: String
140 dropId = "drop"
141
142 -- | shiftl function identifier
143 shiftlId :: String
144 shiftlId = "shiftl"
145
146 -- | shiftr function identifier
147 shiftrId :: String
148 shiftrId = "shiftr"
149
150 -- | rotl function identifier
151 rotlId :: String
152 rotlId = "rotl"
153
154 -- | reverse function identifier
155 rotrId :: String
156 rotrId = "rotr"
157
158 -- | concatenate the vectors in a vector
159 concatId :: String
160 concatId = "concat"
161
162 -- | reverse function identifier
163 reverseId :: String
164 reverseId = "reverse"
165
166 -- | iterate function identifier
167 iterateId :: String
168 iterateId = "iterate"
169
170 -- | iteraten function identifier
171 iteratenId :: String
172 iteratenId = "iteraten"
173
174 -- | iterate function identifier
175 generateId :: String
176 generateId = "generate"
177
178 -- | iteraten function identifier
179 generatenId :: String
180 generatenId = "generaten"
181
182 -- | copy function identifier
183 copyId :: String
184 copyId = "copy"
185
186 -- | copyn function identifier
187 copynId :: String
188 copynId = "copyn"
189
190 -- | map function identifier
191 mapId :: String
192 mapId = "map"
193
194 -- | zipwith function identifier
195 zipWithId :: String
196 zipWithId = "zipWith"
197
198 -- | foldl function identifier
199 foldlId :: String
200 foldlId = "foldl"
201
202 -- | foldr function identifier
203 foldrId :: String
204 foldrId = "foldr"
205
206 -- | zip function identifier
207 zipId :: String
208 zipId = "zip"
209
210 -- | unzip function identifier
211 unzipId :: String
212 unzipId = "unzip"
213
214 -- | hwxor function identifier
215 hwxorId :: String
216 hwxorId = "hwxor"
217
218 -- | hwor function identifier
219 hworId :: String
220 hworId = "hwor"
221
222 -- | hwnot function identifier
223 hwnotId :: String
224 hwnotId = "hwnot"
225
226 -- | hwand function identifier
227 hwandId :: String
228 hwandId = "hwand"
229
230 lengthTId :: String
231 lengthTId = "lengthT"
232
233 fstId :: String
234 fstId = "fst"
235
236 sndId :: String
237 sndId = "snd"
238
239 splitId :: String
240 splitId = "split"
241
242 -- Equality Operations
243 equalityId :: String
244 equalityId = "=="
245
246 inEqualityId :: String
247 inEqualityId = "/="
248
249 gtId :: String
250 gtId = ">"
251
252 ltId :: String
253 ltId = "<"
254
255 gteqId :: String
256 gteqId = ">="
257
258 lteqId :: String
259 lteqId = "<="
260
261 boolOrId :: String
262 boolOrId = "||"
263
264 boolAndId :: String
265 boolAndId = "&&"
266
267 -- Numeric Operations
268
269 -- | plus operation identifier
270 plusId :: String
271 plusId = "+"
272
273 -- | times operation identifier
274 timesId :: String
275 timesId = "*"
276
277 -- | negate operation identifier
278 negateId :: String
279 negateId = "negate"
280
281 -- | minus operation identifier
282 minusId :: String
283 minusId = "-"
284
285 -- | convert sizedword to ranged
286 fromSizedWordId :: String
287 fromSizedWordId = "fromSizedWord"
288
289 toIntegerId :: String
290 toIntegerId = "to_integer"
291
292 fromIntegerId :: String
293 fromIntegerId = "fromInteger"
294
295 toSignedId :: String
296 toSignedId = "to_signed"
297
298 toUnsignedId :: String
299 toUnsignedId = "to_unsigned"
300
301 resizeId :: String
302 resizeId = "resize"
303
304 resizeWordId :: String
305 resizeWordId = "resizeWord"
306
307 resizeIntId :: String
308 resizeIntId = "resizeInt"
309
310 smallIntegerId :: String
311 smallIntegerId = "smallInteger"
312
313 sizedIntId :: String
314 sizedIntId = "SizedInt"
315
316 tfvecId :: String
317 tfvecId = "TFVec"
318
319 blockRAMId :: String
320 blockRAMId = "blockRAM"
321
322 -- | output file identifier (from std.textio)
323 showIdString :: String
324 showIdString = "show"
325
326 showId :: AST.VHDLId
327 showId = AST.unsafeVHDLExtId showIdString
328
329 -- | write function identifier (from std.textio)
330 writeId :: AST.VHDLId
331 writeId = AST.unsafeVHDLBasicId "write"
332
333 -- | output file identifier (from std.textio)
334 outputId :: AST.VHDLId
335 outputId = AST.unsafeVHDLBasicId "output"
336
337 ------------------
338 -- VHDL type marks
339 ------------------
340
341 -- | The Bit type mark
342 bitTM :: AST.TypeMark
343 bitTM = AST.unsafeVHDLBasicId "Bit"
344
345 -- | Stardard logic type mark
346 std_logicTM :: AST.TypeMark
347 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
348
349 -- | boolean type mark
350 booleanTM :: AST.TypeMark
351 booleanTM = AST.unsafeVHDLBasicId "boolean"
352
353 -- | fsvec_index AST. TypeMark
354 tfvec_indexTM :: AST.TypeMark
355 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
356
357 -- | natural AST. TypeMark
358 naturalTM :: AST.TypeMark
359 naturalTM = AST.unsafeVHDLBasicId "natural"
360
361 -- | integer TypeMark
362 integerTM :: AST.TypeMark
363 integerTM = AST.unsafeVHDLBasicId "integer"
364
365 -- | signed TypeMark
366 signedTM :: AST.TypeMark
367 signedTM = AST.unsafeVHDLBasicId "signed"
368
369 -- | unsigned TypeMark
370 unsignedTM :: AST.TypeMark
371 unsignedTM = AST.unsafeVHDLBasicId "unsigned"
372
373 -- | string TypeMark
374 stringTM :: AST.TypeMark
375 stringTM = AST.unsafeVHDLBasicId "string"
376
377 -- | tup VHDLName suffix
378 tupVHDLSuffix :: AST.VHDLId -> AST.Suffix
379 tupVHDLSuffix id = AST.SSimple id