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 -- Numeric Operations
234 -- | plus operation identifier
238 -- | times operation identifier
242 -- | negate operation identifier
246 -- | minus operation identifier
250 -- | convert sizedword to ranged
251 fromSizedWordId :: String
252 fromSizedWordId = "fromSizedWord"
254 toIntegerId :: String
255 toIntegerId = "to_integer"
257 fromIntegerId :: String
258 fromIntegerId = "fromInteger"
261 toSignedId = "to_signed"
263 toUnsignedId :: String
264 toUnsignedId = "to_unsigned"
269 smallIntegerId :: String
270 smallIntegerId = "smallInteger"
273 sizedIntId = "SizedInt"
278 -- | output file identifier (from std.textio)
279 showIdString :: String
280 showIdString = "show"
283 showId = AST.unsafeVHDLExtId showIdString
285 -- | write function identifier (from std.textio)
286 writeId :: AST.VHDLId
287 writeId = AST.unsafeVHDLBasicId "write"
289 -- | output file identifier (from std.textio)
290 outputId :: AST.VHDLId
291 outputId = AST.unsafeVHDLBasicId "output"
297 -- | The Bit type mark
298 bitTM :: AST.TypeMark
299 bitTM = AST.unsafeVHDLBasicId "Bit"
301 -- | Stardard logic type mark
302 std_logicTM :: AST.TypeMark
303 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
305 -- | boolean type mark
306 booleanTM :: AST.TypeMark
307 booleanTM = AST.unsafeVHDLBasicId "boolean"
309 -- | fsvec_index AST. TypeMark
310 tfvec_indexTM :: AST.TypeMark
311 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
313 -- | natural AST. TypeMark
314 naturalTM :: AST.TypeMark
315 naturalTM = AST.unsafeVHDLBasicId "natural"
317 -- | integer TypeMark
318 integerTM :: AST.TypeMark
319 integerTM = AST.unsafeVHDLBasicId "integer"
322 signedTM :: AST.TypeMark
323 signedTM = AST.unsafeVHDLBasicId "signed"
325 -- | unsigned TypeMark
326 unsignedTM :: AST.TypeMark
327 unsignedTM = AST.unsafeVHDLBasicId "unsigned"
330 stringTM :: AST.TypeMark
331 stringTM = AST.unsafeVHDLBasicId "string"
333 -- | tup VHDLName suffix
334 tupVHDLSuffix :: AST.VHDLId -> AST.Suffix
335 tupVHDLSuffix id = AST.SSimple id