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 / uvm / resident.om

100 lines · 2072 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note GB10-specific model: identical CPU/GPU physical backing; zero copied bytes.
3note Residency mask describes mappings, NOT proof of device coherence. GPU transition emits fence-required flags.
4note Per-page ledger: VA, mapping mask(1 CPU/2 GPU), last access counter. 128 slots.
5global spage ulong 384
6global scva ulong 1
7global scval ulong 1
8global sctyp ulong 1
9global sctag ulong 1
10fn spfind va ulong to ulong
11for j ulong 128
12if eq get spage mul j 3 va
13ret j
14end
15end
16ret 128
17end
18fn spfree to ulong
19for j ulong 128
20if eq get spage mul j 3 0
21ret j
22end
23end
24ret 128
25end
26fn sforget va ulong size ulong to void
27for j ulong 128
28v = get spage mul j 3
29if and ge v va lt v add va size
30for f ulong 3
31put spage add mul j 3 f 0
32end
33end
34end
35end
36fn smask i ulong acc ulong to ulong
37if or eq acc 1 eq acc 2
38ret 2
39end
40if eq sget i 5 1
41ret 3
42end
43if eq sget i 3 0
44ret 3
45end
46ret or ulong 2 and sget i 4 1
47end
48fn scdecode to ulong
49note NVIDIA580.173.02 class/clc365.h:36-41,59-79; 32B, GVA words2/3,
50note counter word6[15:0], tag word5[19:0], valid word7[31], type word0[0].
51if eq and shr uvpktlw 7 31 1 0
52ret UVIGN
53end
54if ne and shr uvpktlw 0 1 1 0
55ret UVEINVAL
56end
57if ne and shr uvpktlw 0 8 3 2
58ret UVEINVAL
59end
60put scva 0 and or uvpktlw 2 shl uvpktlw 3 32 not sub UV4K 1
61put scval 0 and uvpktlw 6 65535
62put sctyp 0 and uvpktlw 0 1
63put sctag 0 and uvpktlw 5 1048575
64ret UVOK
65end
66fn scnotify limit ulong to ulong
67if or eq limit 0 gt limit 65535
68ret UVEINVAL
69end
70r = scdecode
71if ne r UVOK
72ret r
73end
74i = sfind get scva 0
75if eq i 64
76ret UVENOENT
77end
78j = spfind get scva 0
79if eq j 128
80ret UVENOENT
81end
82put spage add mul j 3 2 get scval 0
83if lt get scval 0 limit
84ret UVIGN
85end
86note Threshold proposes remapping through the same fault pipeline, never data copy.
87put uvfva 0 get scva 0
88put uvfacc 0 0
89put uvftyp 0 1
90put uvfrep 0 1
91put uvfen 0 1
92put uvfval 0 1
93note CPU notifications request CPU-accessed mapping via range preference; GPU keeps preferred policy.
94if eq get sctyp 0 0
95if eq sget i 3 1
96ret UVIGN
97end
98end
99ret sservice
100end