-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcore.sus
37 lines (29 loc) · 1.07 KB
/
core.sus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Compiler Intrinsic
__builtin__ module LatencyOffset #(T, int OFFSET) {
interface LatencyOffset : T in'0 -> T out'OFFSET
}
// Compiler Intrinsic
__builtin__ module CrossDomain #(T) {
domain in_clk
interface in_domain : T in'0
domain out_clk
interface out_domain : -> T out'0
}
__builtin__ module IntToBits {
interface IntToBits : int value'0 -> bool[32] bits'0
}
__builtin__ module BitsToInt {
interface IntToBits : bool[32] bits'0 -> int value'0
}
// For now these builtin declarations must be in this order, because they're constants in the code.
// We'll get a better system for this at some point
// The decider of truth and falsity
__builtin__ struct bool {}
// An integer of variable size. Right now it's not implemented yet, so this is just a 32-bit int.
__builtin__ struct int {}
// For intentionally triggering an ICE for debugging. It is a constant that crashes the compiler when it is evaluated
__builtin__ const bool __crash_compiler {}
// True, as in '1'
__builtin__ const bool true {}
// False, as in '0'
__builtin__ const bool false {}