317cb64d9ec9e8b9147441b76023fee14cdb6aad
[matthijs/master-project/cλash.git] / cλash / CLasH / VHDL / Constants.hs
1 module CLasH.VHDL.Constants where
2   
3 import qualified Language.VHDL.AST as AST
4
5 --------------
6 -- Identifiers
7 --------------
8
9 -- | reset and clock signal identifiers in String form
10 resetStr, clockStr :: String
11 resetStr = "resetn"
12 clockStr = "clock"
13
14 -- | reset and clock signal identifiers in basic AST.VHDLId form
15 resetId, clockId :: AST.VHDLId
16 resetId = AST.unsafeVHDLBasicId resetStr
17 clockId = AST.unsafeVHDLBasicId clockStr
18
19
20 -- | \"types\" identifier
21 typesId :: AST.VHDLId
22 typesId = AST.unsafeVHDLBasicId "types"
23
24 -- | work identifier
25 workId :: AST.VHDLId
26 workId = AST.unsafeVHDLBasicId "work"
27
28 -- | std identifier
29 stdId :: AST.VHDLId
30 stdId = AST.unsafeVHDLBasicId "std"
31
32
33 -- | textio identifier
34 textioId :: AST.VHDLId
35 textioId = AST.unsafeVHDLBasicId "textio"
36
37 -- | range attribute identifier
38 rangeId :: AST.VHDLId
39 rangeId = AST.unsafeVHDLBasicId "range"
40
41
42 -- | high attribute identifier
43 highId :: AST.VHDLId
44 highId = AST.unsafeVHDLBasicId "high"
45
46 -- | range attribute identifier
47 imageId :: AST.VHDLId
48 imageId = AST.unsafeVHDLBasicId "image"
49
50 -- | event attribute identifie
51 eventId :: AST.VHDLId
52 eventId = AST.unsafeVHDLBasicId "event"
53
54
55 -- | default function identifier
56 defaultId :: AST.VHDLId
57 defaultId = AST.unsafeVHDLBasicId "default"
58
59 -- FSVec function identifiers
60
61 -- | ex (operator ! in original Haskell source) function identifier
62 exId :: String
63 exId = "!"
64
65 -- | sel (function select in original Haskell source) function identifier
66 selId :: String
67 selId = "select"
68
69
70 -- | ltplus (function (<+) in original Haskell source) function identifier
71 ltplusId :: String
72 ltplusId = "<+"
73
74
75 -- | plusplus (function (++) in original Haskell source) function identifier
76 plusplusId :: String
77 plusplusId = "++"
78
79
80 -- | empty function identifier
81 emptyId :: String
82 emptyId = "empty"
83
84 -- | plusgt (function (+>) in original Haskell source) function identifier
85 plusgtId :: String
86 plusgtId = "+>"
87
88 -- | singleton function identifier
89 singletonId :: String
90 singletonId = "singleton"
91
92 -- | length function identifier
93 lengthId :: String
94 lengthId = "length"
95
96
97 -- | isnull (function null in original Haskell source) function identifier
98 nullId :: String
99 nullId = "null"
100
101
102 -- | replace function identifier
103 replaceId :: String
104 replaceId = "replace"
105
106
107 -- | head function identifier
108 headId :: String
109 headId = "head"
110
111
112 -- | last function identifier
113 lastId :: String
114 lastId = "last"
115
116
117 -- | init function identifier
118 initId :: String
119 initId = "init"
120
121
122 -- | tail function identifier
123 tailId :: String
124 tailId = "tail"
125
126
127 -- | take function identifier
128 takeId :: String
129 takeId = "take"
130
131
132 -- | drop function identifier
133 dropId :: String
134 dropId = "drop"
135
136 -- | shiftl function identifier
137 shiftlId :: String
138 shiftlId = "shiftl"
139
140 -- | shiftr function identifier
141 shiftrId :: String
142 shiftrId = "shiftr"
143
144 -- | rotl function identifier
145 rotlId :: String
146 rotlId = "rotl"
147
148 -- | reverse function identifier
149 rotrId :: String
150 rotrId = "rotr"
151
152 -- | concatenate the vectors in a vector
153 concatId :: String
154 concatId = "concat"
155
156 -- | reverse function identifier
157 reverseId :: String
158 reverseId = "reverse"
159
160 -- | iterate function identifier
161 iterateId :: String
162 iterateId = "iterate"
163
164 -- | iteraten function identifier
165 iteratenId :: String
166 iteratenId = "iteraten"
167
168 -- | iterate function identifier
169 generateId :: String
170 generateId = "generate"
171
172 -- | iteraten function identifier
173 generatenId :: String
174 generatenId = "generaten"
175
176 -- | copy function identifier
177 copyId :: String
178 copyId = "copy"
179
180 -- | copyn function identifier
181 copynId :: String
182 copynId = "copyn"
183
184 -- | map function identifier
185 mapId :: String
186 mapId = "map"
187
188 -- | zipwith function identifier
189 zipWithId :: String
190 zipWithId = "zipWith"
191
192 -- | foldl function identifier
193 foldlId :: String
194 foldlId = "foldl"
195
196 -- | foldr function identifier
197 foldrId :: String
198 foldrId = "foldr"
199
200 -- | zip function identifier
201 zipId :: String
202 zipId = "zip"
203
204 -- | unzip function identifier
205 unzipId :: String
206 unzipId = "unzip"
207
208 -- | hwxor function identifier
209 hwxorId :: String
210 hwxorId = "hwxor"
211
212 -- | hwor function identifier
213 hworId :: String
214 hworId = "hwor"
215
216 -- | hwnot function identifier
217 hwnotId :: String
218 hwnotId = "hwnot"
219
220 -- | hwand function identifier
221 hwandId :: String
222 hwandId = "hwand"
223
224 lengthTId :: String
225 lengthTId = "lengthT"
226
227 -- Numeric Operations
228
229 -- | plus operation identifier
230 plusId :: String
231 plusId = "+"
232
233 -- | times operation identifier
234 timesId :: String
235 timesId = "*"
236
237 -- | negate operation identifier
238 negateId :: String
239 negateId = "negate"
240
241 -- | minus operation identifier
242 minusId :: String
243 minusId = "-"
244
245 -- | convert sizedword to ranged
246 fromSizedWordId :: String
247 fromSizedWordId = "fromSizedWord"
248
249 toIntegerId :: String
250 toIntegerId = "to_integer"
251
252 fromIntegerId :: String
253 fromIntegerId = "fromInteger"
254
255 toSignedId :: String
256 toSignedId = "to_signed"
257
258 toUnsignedId :: String
259 toUnsignedId = "to_unsigned"
260
261 resizeId :: String
262 resizeId = "resize"
263
264 ------------------
265 -- VHDL type marks
266 ------------------
267
268 -- | The Bit type mark
269 bitTM :: AST.TypeMark
270 bitTM = AST.unsafeVHDLBasicId "Bit"
271
272 -- | Stardard logic type mark
273 std_logicTM :: AST.TypeMark
274 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
275
276 -- | boolean type mark
277 booleanTM :: AST.TypeMark
278 booleanTM = AST.unsafeVHDLBasicId "boolean"
279
280 -- | fsvec_index AST. TypeMark
281 tfvec_indexTM :: AST.TypeMark
282 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
283
284 -- | natural AST. TypeMark
285 naturalTM :: AST.TypeMark
286 naturalTM = AST.unsafeVHDLBasicId "natural"
287
288 -- | integer TypeMark
289 integerTM :: AST.TypeMark
290 integerTM = AST.unsafeVHDLBasicId "integer"
291
292 -- | signed TypeMark
293 signedTM :: AST.TypeMark
294 signedTM = AST.unsafeVHDLBasicId "signed"
295
296 -- | unsigned TypeMark
297 unsignedTM :: AST.TypeMark
298 unsignedTM = AST.unsafeVHDLBasicId "unsigned"