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
129 -- | take function identifier
134 -- | drop function identifier
138 -- | shiftl function identifier
142 -- | shiftr function identifier
146 -- | rotl function identifier
150 -- | reverse function identifier
154 -- | concatenate the vectors in a vector
158 -- | reverse function identifier
160 reverseId = "reverse"
162 -- | iterate function identifier
164 iterateId = "iterate"
166 -- | iteraten function identifier
168 iteratenId = "iteraten"
170 -- | iterate function identifier
172 generateId = "generate"
174 -- | iteraten function identifier
175 generatenId :: String
176 generatenId = "generaten"
178 -- | copy function identifier
182 -- | copyn function identifier
186 -- | map function identifier
190 -- | zipwith function identifier
192 zipWithId = "zipWith"
194 -- | foldl function identifier
198 -- | foldr function identifier
202 -- | zip function identifier
206 -- | unzip function identifier
210 -- | hwxor function identifier
214 -- | hwor function identifier
218 -- | hwnot function identifier
222 -- | hwand function identifier
227 lengthTId = "lengthT"
229 -- Numeric Operations
231 -- | plus operation identifier
235 -- | times operation identifier
239 -- | negate operation identifier
243 -- | minus operation identifier
247 -- | convert sizedword to ranged
248 fromSizedWordId :: String
249 fromSizedWordId = "fromSizedWord"
251 toIntegerId :: String
252 toIntegerId = "to_integer"
254 fromIntegerId :: String
255 fromIntegerId = "fromInteger"
258 toSignedId = "to_signed"
260 toUnsignedId :: String
261 toUnsignedId = "to_unsigned"
266 -- | output file identifier (from std.textio)
267 showIdString :: String
268 showIdString = "show"
271 showId = AST.unsafeVHDLExtId showIdString
273 -- | write function identifier (from std.textio)
274 writeId :: AST.VHDLId
275 writeId = AST.unsafeVHDLBasicId "write"
277 -- | output file identifier (from std.textio)
278 outputId :: AST.VHDLId
279 outputId = AST.unsafeVHDLBasicId "output"
285 -- | The Bit type mark
286 bitTM :: AST.TypeMark
287 bitTM = AST.unsafeVHDLBasicId "Bit"
289 -- | Stardard logic type mark
290 std_logicTM :: AST.TypeMark
291 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
293 -- | boolean type mark
294 booleanTM :: AST.TypeMark
295 booleanTM = AST.unsafeVHDLBasicId "boolean"
297 -- | fsvec_index AST. TypeMark
298 tfvec_indexTM :: AST.TypeMark
299 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
301 -- | natural AST. TypeMark
302 naturalTM :: AST.TypeMark
303 naturalTM = AST.unsafeVHDLBasicId "natural"
305 -- | integer TypeMark
306 integerTM :: AST.TypeMark
307 integerTM = AST.unsafeVHDLBasicId "integer"
310 signedTM :: AST.TypeMark
311 signedTM = AST.unsafeVHDLBasicId "signed"
313 -- | unsigned TypeMark
314 unsignedTM :: AST.TypeMark
315 unsignedTM = AST.unsafeVHDLBasicId "unsigned"
318 stringTM :: AST.TypeMark
319 stringTM = AST.unsafeVHDLBasicId "string"
321 -- | tup VHDLName suffix
322 tupVHDLSuffix :: AST.VHDLId -> AST.Suffix
323 tupVHDLSuffix id = AST.SSimple id