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
267 -- Numeric Operations
269 -- | plus operation identifier
273 -- | times operation identifier
277 -- | negate operation identifier
281 -- | minus operation identifier
285 -- | convert sizedword to ranged
286 fromSizedWordId :: String
287 fromSizedWordId = "fromSizedWord"
289 toIntegerId :: String
290 toIntegerId = "to_integer"
292 fromIntegerId :: String
293 fromIntegerId = "fromInteger"
296 toSignedId = "to_signed"
298 toUnsignedId :: String
299 toUnsignedId = "to_unsigned"
304 resizeWordId :: String
305 resizeWordId = "resizeWord"
307 resizeIntId :: String
308 resizeIntId = "resizeInt"
310 smallIntegerId :: String
311 smallIntegerId = "smallInteger"
314 sizedIntId = "SizedInt"
320 blockRAMId = "blockRAM"
322 -- | output file identifier (from std.textio)
323 showIdString :: String
324 showIdString = "show"
327 showId = AST.unsafeVHDLExtId showIdString
329 -- | write function identifier (from std.textio)
330 writeId :: AST.VHDLId
331 writeId = AST.unsafeVHDLBasicId "write"
333 -- | output file identifier (from std.textio)
334 outputId :: AST.VHDLId
335 outputId = AST.unsafeVHDLBasicId "output"
341 -- | The Bit type mark
342 bitTM :: AST.TypeMark
343 bitTM = AST.unsafeVHDLBasicId "Bit"
345 -- | Stardard logic type mark
346 std_logicTM :: AST.TypeMark
347 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
349 -- | boolean type mark
350 booleanTM :: AST.TypeMark
351 booleanTM = AST.unsafeVHDLBasicId "boolean"
353 -- | fsvec_index AST. TypeMark
354 tfvec_indexTM :: AST.TypeMark
355 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
357 -- | natural AST. TypeMark
358 naturalTM :: AST.TypeMark
359 naturalTM = AST.unsafeVHDLBasicId "natural"
361 -- | integer TypeMark
362 integerTM :: AST.TypeMark
363 integerTM = AST.unsafeVHDLBasicId "integer"
366 signedTM :: AST.TypeMark
367 signedTM = AST.unsafeVHDLBasicId "signed"
369 -- | unsigned TypeMark
370 unsignedTM :: AST.TypeMark
371 unsignedTM = AST.unsafeVHDLBasicId "unsigned"
374 stringTM :: AST.TypeMark
375 stringTM = AST.unsafeVHDLBasicId "string"
377 -- | tup VHDLName suffix
378 tupVHDLSuffix :: AST.VHDLId -> AST.Suffix
379 tupVHDLSuffix id = AST.SSimple id