1 module CLasH.VHDL.Constants where
3 import qualified Language.VHDL.AST as AST
9 -- | reset and clock signal identifiers in String form
10 resetStr, clockStr :: String
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
19 integerId :: AST.VHDLId
20 integerId = AST.unsafeVHDLBasicId "integer"
22 -- | \"types\" identifier
24 typesId = AST.unsafeVHDLBasicId "types"
28 workId = AST.unsafeVHDLBasicId "work"
32 stdId = AST.unsafeVHDLBasicId "std"
35 -- | textio identifier
36 textioId :: AST.VHDLId
37 textioId = AST.unsafeVHDLBasicId "textio"
39 -- | range attribute identifier
41 rangeId = AST.unsafeVHDLBasicId "range"
44 -- | high attribute identifier
46 highId = AST.unsafeVHDLBasicId "high"
48 -- | range attribute identifier
50 imageId = AST.unsafeVHDLBasicId "image"
52 -- | event attribute identifie
54 eventId = AST.unsafeVHDLBasicId "event"
57 -- | default function identifier
58 defaultId :: AST.VHDLId
59 defaultId = AST.unsafeVHDLBasicId "default"
61 -- FSVec function identifiers
63 -- | ex (operator ! in original Haskell source) function identifier
67 -- | sel (function select in original Haskell source) function identifier
72 -- | ltplus (function (<+) in original Haskell source) function identifier
77 -- | plusplus (function (++) in original Haskell source) function identifier
82 -- | empty function identifier
86 -- | plusgt (function (+>) in original Haskell source) function identifier
90 -- | singleton function identifier
92 singletonId = "singleton"
94 -- | length function identifier
99 -- | isnull (function null in original Haskell source) function identifier
104 -- | replace function identifier
106 replaceId = "replace"
109 -- | head function identifier
114 -- | last function identifier
119 -- | init function identifier
124 -- | tail function identifier
128 -- | minimum ftp function identifier
130 minimumId = "minimum"
132 -- | take function identifier
137 -- | drop function identifier
141 -- | shiftl function identifier
145 -- | shiftr function identifier
149 -- | rotl function identifier
153 -- | reverse function identifier
157 -- | concatenate the vectors in a vector
161 -- | reverse function identifier
163 reverseId = "reverse"
165 -- | iterate function identifier
167 iterateId = "iterate"
169 -- | iteraten function identifier
171 iteratenId = "iteraten"
173 -- | iterate function identifier
175 generateId = "generate"
177 -- | iteraten function identifier
178 generatenId :: String
179 generatenId = "generaten"
181 -- | copy function identifier
185 -- | copyn function identifier
189 -- | map function identifier
193 -- | zipwith function identifier
195 zipWithId = "zipWith"
197 -- | foldl function identifier
201 -- | foldr function identifier
205 -- | zip function identifier
209 -- | unzip function identifier
213 -- | hwxor function identifier
217 -- | hwor function identifier
221 -- | hwnot function identifier
225 -- | hwand function identifier
230 lengthTId = "lengthT"
238 -- Equality Operations
242 inEqualityId :: String
263 -- Numeric Operations
265 -- | plus operation identifier
269 -- | times operation identifier
273 -- | negate operation identifier
277 -- | minus operation identifier
281 -- | convert sizedword to ranged
282 fromSizedWordId :: String
283 fromSizedWordId = "fromSizedWord"
285 toIntegerId :: String
286 toIntegerId = "to_integer"
288 fromIntegerId :: String
289 fromIntegerId = "fromInteger"
292 toSignedId = "to_signed"
294 toUnsignedId :: String
295 toUnsignedId = "to_unsigned"
300 smallIntegerId :: String
301 smallIntegerId = "smallInteger"
304 sizedIntId = "SizedInt"
310 blockRAMId = "blockRAM"
312 -- | output file identifier (from std.textio)
313 showIdString :: String
314 showIdString = "show"
317 showId = AST.unsafeVHDLExtId showIdString
319 -- | write function identifier (from std.textio)
320 writeId :: AST.VHDLId
321 writeId = AST.unsafeVHDLBasicId "write"
323 -- | output file identifier (from std.textio)
324 outputId :: AST.VHDLId
325 outputId = AST.unsafeVHDLBasicId "output"
331 -- | The Bit type mark
332 bitTM :: AST.TypeMark
333 bitTM = AST.unsafeVHDLBasicId "Bit"
335 -- | Stardard logic type mark
336 std_logicTM :: AST.TypeMark
337 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
339 -- | boolean type mark
340 booleanTM :: AST.TypeMark
341 booleanTM = AST.unsafeVHDLBasicId "boolean"
343 -- | fsvec_index AST. TypeMark
344 tfvec_indexTM :: AST.TypeMark
345 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
347 -- | natural AST. TypeMark
348 naturalTM :: AST.TypeMark
349 naturalTM = AST.unsafeVHDLBasicId "natural"
351 -- | integer TypeMark
352 integerTM :: AST.TypeMark
353 integerTM = AST.unsafeVHDLBasicId "integer"
356 signedTM :: AST.TypeMark
357 signedTM = AST.unsafeVHDLBasicId "signed"
359 -- | unsigned TypeMark
360 unsignedTM :: AST.TypeMark
361 unsignedTM = AST.unsafeVHDLBasicId "unsigned"
364 stringTM :: AST.TypeMark
365 stringTM = AST.unsafeVHDLBasicId "string"
367 -- | tup VHDLName suffix
368 tupVHDLSuffix :: AST.VHDLId -> AST.Suffix
369 tupVHDLSuffix id = AST.SSimple id