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"
232 -- Equality Operations
236 -- Numeric Operations
238 -- | plus operation identifier
242 -- | times operation identifier
246 -- | negate operation identifier
250 -- | minus operation identifier
254 -- | convert sizedword to ranged
255 fromSizedWordId :: String
256 fromSizedWordId = "fromSizedWord"
258 toIntegerId :: String
259 toIntegerId = "to_integer"
261 fromIntegerId :: String
262 fromIntegerId = "fromInteger"
265 toSignedId = "to_signed"
267 toUnsignedId :: String
268 toUnsignedId = "to_unsigned"
273 smallIntegerId :: String
274 smallIntegerId = "smallInteger"
277 sizedIntId = "SizedInt"
282 -- | output file identifier (from std.textio)
283 showIdString :: String
284 showIdString = "show"
287 showId = AST.unsafeVHDLExtId showIdString
289 -- | write function identifier (from std.textio)
290 writeId :: AST.VHDLId
291 writeId = AST.unsafeVHDLBasicId "write"
293 -- | output file identifier (from std.textio)
294 outputId :: AST.VHDLId
295 outputId = AST.unsafeVHDLBasicId "output"
301 -- | The Bit type mark
302 bitTM :: AST.TypeMark
303 bitTM = AST.unsafeVHDLBasicId "Bit"
305 -- | Stardard logic type mark
306 std_logicTM :: AST.TypeMark
307 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
309 -- | boolean type mark
310 booleanTM :: AST.TypeMark
311 booleanTM = AST.unsafeVHDLBasicId "boolean"
313 -- | fsvec_index AST. TypeMark
314 tfvec_indexTM :: AST.TypeMark
315 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
317 -- | natural AST. TypeMark
318 naturalTM :: AST.TypeMark
319 naturalTM = AST.unsafeVHDLBasicId "natural"
321 -- | integer TypeMark
322 integerTM :: AST.TypeMark
323 integerTM = AST.unsafeVHDLBasicId "integer"
326 signedTM :: AST.TypeMark
327 signedTM = AST.unsafeVHDLBasicId "signed"
329 -- | unsigned TypeMark
330 unsignedTM :: AST.TypeMark
331 unsignedTM = AST.unsafeVHDLBasicId "unsigned"
334 stringTM :: AST.TypeMark
335 stringTM = AST.unsafeVHDLBasicId "string"
337 -- | tup VHDLName suffix
338 tupVHDLSuffix :: AST.VHDLId -> AST.Suffix
339 tupVHDLSuffix id = AST.SSimple id