1 module CLasH.VHDL.Constants where
4 import qualified Language.VHDL.AST as AST
10 -- | reset and clock signal identifiers in String form
11 resetStr, clockStr :: String
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
20 integerId :: AST.VHDLId
21 integerId = AST.unsafeVHDLBasicId "integer"
23 -- | \"types\" identifier
25 typesId = AST.unsafeVHDLBasicId "types"
29 workId = AST.unsafeVHDLBasicId "work"
33 stdId = AST.unsafeVHDLBasicId "std"
36 -- | textio identifier
37 textioId :: AST.VHDLId
38 textioId = AST.unsafeVHDLBasicId "textio"
40 -- | range attribute identifier
42 rangeId = AST.unsafeVHDLBasicId "range"
45 -- | high attribute identifier
47 highId = AST.unsafeVHDLBasicId "high"
49 -- | range attribute identifier
51 imageId = AST.unsafeVHDLBasicId "image"
53 -- | event attribute identifie
55 eventId = AST.unsafeVHDLBasicId "event"
58 -- | default function identifier
59 defaultId :: AST.VHDLId
60 defaultId = AST.unsafeVHDLBasicId "default"
62 -- FSVec function identifiers
64 -- | ex (operator ! in original Haskell source) function identifier
68 -- | sel (function select in original Haskell source) function identifier
73 -- | ltplus (function (<+) in original Haskell source) function identifier
78 -- | plusplus (function (++) in original Haskell source) function identifier
83 -- | empty function identifier
87 -- | plusgt (function (+>) in original Haskell source) function identifier
91 -- | singleton function identifier
93 singletonId = "singleton"
95 -- | length function identifier
100 -- | isnull (function null in original Haskell source) function identifier
105 -- | replace function identifier
107 replaceId = "replace"
110 -- | head function identifier
115 -- | last function identifier
120 -- | init function identifier
125 -- | tail function identifier
129 -- | minimum ftp function identifier
131 minimumId = "minimum"
133 -- | take function identifier
138 -- | drop function identifier
142 -- | shiftl function identifier
146 -- | shiftr function identifier
150 -- | rotl function identifier
154 -- | reverse function identifier
158 -- | concatenate the vectors in a vector
162 -- | reverse function identifier
164 reverseId = "reverse"
166 -- | iterate function identifier
168 iterateId = "iterate"
170 -- | iteraten function identifier
172 iteratenId = "iteraten"
174 -- | iterate function identifier
176 generateId = "generate"
178 -- | iteraten function identifier
179 generatenId :: String
180 generatenId = "generaten"
182 -- | copy function identifier
186 -- | copyn function identifier
190 -- | map function identifier
194 -- | zipwith function identifier
196 zipWithId = "zipWith"
198 -- | foldl function identifier
202 -- | foldr function identifier
206 -- | zip function identifier
210 -- | unzip function identifier
214 -- | hwxor function identifier
218 -- | hwor function identifier
222 -- | hwnot function identifier
226 -- | hwand function identifier
231 lengthTId = "lengthT"
242 -- Equality Operations
246 inEqualityId :: String
270 -- Numeric Operations
272 -- | plus operation identifier
276 -- | times operation identifier
280 -- | negate operation identifier
284 -- | minus operation identifier
288 -- | convert sizedword to ranged
289 fromSizedWordId :: String
290 fromSizedWordId = "fromSizedWord"
292 toIntegerId :: String
293 toIntegerId = "to_integer"
295 fromIntegerId :: String
296 fromIntegerId = "fromInteger"
299 toSignedId = "to_signed"
301 toUnsignedId :: String
302 toUnsignedId = "to_unsigned"
307 resizeWordId :: String
308 resizeWordId = "resizeWord"
310 resizeIntId :: String
311 resizeIntId = "resizeInt"
313 smallIntegerId :: String
314 smallIntegerId = "smallInteger"
317 sizedIntId = "SizedInt"
323 blockRAMId = "blockRAM"
325 -- | output file identifier (from std.textio)
326 showIdString :: String
327 showIdString = "show"
330 showId = AST.unsafeVHDLExtId showIdString
332 -- | write function identifier (from std.textio)
333 writeId :: AST.VHDLId
334 writeId = AST.unsafeVHDLBasicId "write"
336 -- | output file identifier (from std.textio)
337 outputId :: AST.VHDLId
338 outputId = AST.unsafeVHDLBasicId "output"
344 -- | The Bit type mark
345 bitTM :: AST.TypeMark
346 bitTM = AST.unsafeVHDLBasicId "Bit"
348 -- | Stardard logic type mark
349 std_logicTM :: AST.TypeMark
350 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
352 -- | boolean type mark
353 booleanTM :: AST.TypeMark
354 booleanTM = AST.unsafeVHDLBasicId "boolean"
356 -- | fsvec_index AST. TypeMark
357 tfvec_indexTM :: AST.TypeMark
358 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
360 -- | natural AST. TypeMark
361 naturalTM :: AST.TypeMark
362 naturalTM = AST.unsafeVHDLBasicId "natural"
364 -- | integer TypeMark
365 integerTM :: AST.TypeMark
366 integerTM = AST.unsafeVHDLBasicId "integer"
369 signedTM :: AST.TypeMark
370 signedTM = AST.unsafeVHDLBasicId "signed"
372 -- | unsigned TypeMark
373 unsignedTM :: AST.TypeMark
374 unsignedTM = AST.unsafeVHDLBasicId "unsigned"
377 stringTM :: AST.TypeMark
378 stringTM = AST.unsafeVHDLBasicId "string"
380 -- | tup VHDLName suffix
381 tupVHDLSuffix :: AST.VHDLId -> AST.Suffix
382 tupVHDLSuffix id = AST.SSimple id