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"
267 sizedIntId = "SizedInt"
272 -- | output file identifier (from std.textio)
273 showIdString :: String
274 showIdString = "show"
277 showId = AST.unsafeVHDLExtId showIdString
279 -- | write function identifier (from std.textio)
280 writeId :: AST.VHDLId
281 writeId = AST.unsafeVHDLBasicId "write"
283 -- | output file identifier (from std.textio)
284 outputId :: AST.VHDLId
285 outputId = AST.unsafeVHDLBasicId "output"
291 -- | The Bit type mark
292 bitTM :: AST.TypeMark
293 bitTM = AST.unsafeVHDLBasicId "Bit"
295 -- | Stardard logic type mark
296 std_logicTM :: AST.TypeMark
297 std_logicTM = AST.unsafeVHDLBasicId "std_logic"
299 -- | boolean type mark
300 booleanTM :: AST.TypeMark
301 booleanTM = AST.unsafeVHDLBasicId "boolean"
303 -- | fsvec_index AST. TypeMark
304 tfvec_indexTM :: AST.TypeMark
305 tfvec_indexTM = AST.unsafeVHDLBasicId "tfvec_index"
307 -- | natural AST. TypeMark
308 naturalTM :: AST.TypeMark
309 naturalTM = AST.unsafeVHDLBasicId "natural"
311 -- | integer TypeMark
312 integerTM :: AST.TypeMark
313 integerTM = AST.unsafeVHDLBasicId "integer"
316 signedTM :: AST.TypeMark
317 signedTM = AST.unsafeVHDLBasicId "signed"
319 -- | unsigned TypeMark
320 unsignedTM :: AST.TypeMark
321 unsignedTM = AST.unsafeVHDLBasicId "unsigned"
324 stringTM :: AST.TypeMark
325 stringTM = AST.unsafeVHDLBasicId "string"
327 -- | tup VHDLName suffix
328 tupVHDLSuffix :: AST.VHDLId -> AST.Suffix
329 tupVHDLSuffix id = AST.SSimple id