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 / gsp / sec2sim.om

89 lines · 1408 bytes Raw Blame History
1note GB20B register-model extension. Pure simulator, not device evidence.
2note s2sc: secure-delay,response-delay,missing-response,bad-header,error,bad-pointer,short-response,reply-head.
3global s2sc ulong 8
4global s2ss ulong 8
5fn s2simrd off ulong to ulong
6put s2ss 7 add get s2ss 7 1
7if eq off S2SCR
8if eq get s2sc 0 0
9ret 255
10end
11put s2sc 0 sub get s2sc 0 1
12ret 0
13end
14if eq off S2MH
15if eq get s2ss 0 1
16v = srmb0
17if and eq v 0 eq get s2sc 2 0
18if eq get s2sc 1 0
19put s2ss 1 1
20else
21put s2sc 1 sub get s2sc 1 1
22end
23end
24end
25ret and get s2sc 7 M32
26end
27if eq off S2MT
28h = and get s2sc 7 M32
29if eq get s2ss 1 0
30ret h
31end
32if ne get s2sc 6 0
33ret and add h 12 M32
34end
35ret and add h 16 M32
36end
37if and eq off S2EMC eq get s2ss 2 1
38dw = and add add get s2ss 4 get s2ss 3 get s2sc 5 S2DWMSK
39ret mul dw 4
40end
41if and eq off S2EMD eq get s2ss 2 1
42i = get s2ss 3
43put s2ss 3 add i 1
44if eq i 0
45ret 3221225472
46end
47if eq i 1
48ret add 353427070 get s2sc 3
49end
50if eq i 2
51ret 7
52end
53if eq i 3
54ret 20
55end
56if eq i 4
57ret get s2sc 4
58end
59ret 0
60end
61ret simrd off
62end
63fn s2simwr off ulong v ulong to void
64put s2ss 7 add get s2ss 7 1
65h = and get s2sc 7 M32
66if eq off S2MH
67if and eq v h eq get s2ss 5 1
68put s2ss 6 1
69end
70ret
71end
72if eq off S2MT
73if eq v h
74put s2ss 5 1
75end
76put s2ss 1 0
77ret
78end
79if and eq off S2EMC eq v or S2AINCR and h S2OFFMSK
80put s2ss 2 1
81put s2ss 3 0
82put s2ss 4 ememdw v
83ret
84end
85simwr off v
86if eq off S2QH
87put s2ss 0 1
88end
89end