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
251 -- Numeric Operations
253 -- | plus operation identifier
257 -- | times operation identifier
261 -- | negate operation identifier
265 -- | minus operation identifier
269 -- | convert sizedword to ranged
270 fromSizedWordId :: String
271 fromSizedWordId = "fromSizedWord"
273 toIntegerId :: String
274 toIntegerId = "to_integer"
276 fromIntegerId :: String
277 fromIntegerId = "fromInteger"
280 toSignedId = "to_signed"
282 toUnsignedId :: String
283 toUnsignedId = "to_unsigned"
288 smallIntegerId :: String
289 smallIntegerId = "smallInteger"
292 sizedIntId = "SizedInt"
298 blockRAMId = "blockRAM"
300 -- | output file identifier (from std.textio)
301 showIdString :: String
302 showIdString = "show"
305 showId = AST.unsafeVHDLExtId showIdString
307 -- | write function identifier (from std.textio)
308 writeId :: AST.VHDLId
309 writeId = AST.unsafeVHDLBasicId "write"
311 -- | output file identifier (from std.textio)
312 outputId :: AST.VHDLId
313 outputId = AST.unsafeVHDLBasicId "output"
319 -- | The Bit type mark
320 bitTM :: AST.TypeMark
321 bitTM = AST.unsafeVHDLBasicId "Bit"
323 -- | Stardard logic type mark
324 std_logicTM :: AST.TypeMark
325 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
327 -- | boolean type mark
328 booleanTM :: AST.TypeMark
329 booleanTM = AST.unsafeVHDLBasicId "boolean"
331 -- | fsvec_index AST. TypeMark
332 tfvec_indexTM :: AST.TypeMark
333 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
335 -- | natural AST. TypeMark
336 naturalTM :: AST.TypeMark
337 naturalTM = AST.unsafeVHDLBasicId "natural"
339 -- | integer TypeMark
340 integerTM :: AST.TypeMark
341 integerTM = AST.unsafeVHDLBasicId "integer"
344 signedTM :: AST.TypeMark
345 signedTM = AST.unsafeVHDLBasicId "signed"
347 -- | unsigned TypeMark
348 unsignedTM :: AST.TypeMark
349 unsignedTM = AST.unsafeVHDLBasicId "unsigned"
352 stringTM :: AST.TypeMark
353 stringTM = AST.unsafeVHDLBasicId "string"
355 -- | tup VHDLName suffix
356 tupVHDLSuffix :: AST.VHDLId -> AST.Suffix
357 tupVHDLSuffix id = AST.SSimple id