Add automated testbench generation according to supplied test input
[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 -- | output file identifier (from std.textio)
265 showIdString :: String
266 showIdString = "show"
267
268 showId :: AST.VHDLId
269 showId = AST.unsafeVHDLBasicId showIdString
270
271 -- | write function identifier (from std.textio)
272 writeId :: AST.VHDLId
273 writeId = AST.unsafeVHDLBasicId "write"
274
275 -- | output file identifier (from std.textio)
276 outputId :: AST.VHDLId
277 outputId = AST.unsafeVHDLBasicId "output"
278
279 ------------------
280 -- VHDL type marks
281 ------------------
282
283 -- | The Bit type mark
284 bitTM :: AST.TypeMark
285 bitTM = AST.unsafeVHDLBasicId "Bit"
286
287 -- | Stardard logic type mark
288 std_logicTM :: AST.TypeMark
289 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
290
291 -- | boolean type mark
292 booleanTM :: AST.TypeMark
293 booleanTM = AST.unsafeVHDLBasicId "boolean"
294
295 -- | fsvec_index AST. TypeMark
296 tfvec_indexTM :: AST.TypeMark
297 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
298
299 -- | natural AST. TypeMark
300 naturalTM :: AST.TypeMark
301 naturalTM = AST.unsafeVHDLBasicId "natural"
302
303 -- | integer TypeMark
304 integerTM :: AST.TypeMark
305 integerTM = AST.unsafeVHDLBasicId "integer"
306
307 -- | signed TypeMark
308 signedTM :: AST.TypeMark
309 signedTM = AST.unsafeVHDLBasicId "signed"
310
311 -- | unsigned TypeMark
312 unsignedTM :: AST.TypeMark
313 unsignedTM = AST.unsafeVHDLBasicId "unsigned"