interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / gpu / driver / tests / sec2_trace.om

175 lines · 2115 bytes Raw Blame History
1fn main to int
2b = new uchar 1 0
3if ne read 0 b 0 1 1
4ret 99
5end
6m = ulong get b 0
7atsetup 0
8put arcfg 0 2
9put arcfg 6 61440
10put arcfg 7 2560
11put arcfg 8 0
12put arslen 1 4096
13put arslen 2 212992
14put arslen 3 212296
15pos = ulong 0
16for s ulong 7
17put arsrc s pos
18tfill s pos
19pos = add pos get arslen s
20end
21for i ulong 3
22put arpkg i 2
23end
24if and ge m 11 le m 13
25put arpkg sub m 11 1
26end
27r = arbuild
28if and ge m 11 le m 13
29if ne r -1
30ret 31
31end
32ret 0
33end
34if ne r 0
35ret 32
36end
37if or ne get arcot 3 192 ne get arcot 8 2
38ret 33
39end
40for i ulong 24
41if ne get arcot add 20 i 0
42ret 34
43end
44end
45for i ulong 1024
46put gpkt i get arcot i
47end
48put gin 0 get arclen 0
49put gin 1 araddr 15
50put gin 2 1
51for i ulong 4
52put gin add i 3 3
53end
54for i ulong 7
55put s2cfg i 1
56put s2sc i 0
57end
58put s2sc 7 0
59put s2cfg 0 2
60put s2cfg 1 2
61put s2cfg 2 3
62put s2cfg 3 3
63put sprof 0 2
64put scfg 8 get gin 1
65siminit
66chip = uint 464519168
67expected = long 0
68if eq m 1
69put s2cfg 1 1
70expected = -1
71end
72if eq m 2
73chip = uint 447741952
74expected = -1
75end
76if eq m 3
77put s2sc 0 8
78expected = -10
79end
80if eq m 4
81put s2sc 2 1
82expected = -11
83end
84if eq m 5
85put s2sc 3 1
86expected = -12
87end
88if eq m 6
89put s2sc 4 1
90expected = -13
91end
92if eq m 7
93put s2sc 5 1
94expected = -12
95end
96if eq m 8
97put s2sc 6 1
98expected = -12
99end
100if eq m 9
101put gpkt 0 1
102put gpkt 3 0
103expected = -1
104end
105if eq m 10
106put gpkt 8 1
107expected = -1
108end
109if eq m 14
110put s2sc 0 3
111put s2sc 1 3
112end
113if eq m 15
114put s2sc 7 64
115end
116if eq m 16
117put s2sc 3 128
118end
119if eq m 17
120put s2sc 7 4294967288
121end
122if eq m 18
123put s2sc 7 4294967288
124put s2sc 3 128
125put s2sc 5 1
126expected = -12
127end
128if eq m 19
129put s2sc 7 64
130put s2sc 6 1
131expected = -12
132end
133if eq m 20
134sp SHWCFG2 3135193344
135sp SGMB0 3135193344
136if lockdone
137ret 44
138end
139sp SGMB0 0
140if lockdone
141ret 45
142end
143sp SHWCFG2 8197
144sp SGMB0 3135193344
145if lockdone
146ret 46
147end
148sp SHWCFG2 5
149sp SGMB0 0
150if not lockdone
151ret 47
152end
153ret 0
154end
155r = s2boot chip
156if ne r expected
157ret 40
158end
159if eq r 0
160if or ne get s2ss 6 1 ne get ss SVIOL 0
161ret 41
162end
163end
164if or or eq m 1 eq m 2 or eq m 9 eq m 10
165if ne get s2ss 7 0
166ret 42
167end
168end
169if or and ge m 5 le m 7 eq m 18
170if ne get s2ss 6 1
171ret 43
172end
173end
174ret 0
175end