omega-gpu-driver
aien-dev/omega-gpu-driver
Brought by drakestapleton
omega-gpu-driver / tests / sec2_trace.om
| 1 | fn main to int |
| 2 | b = new uchar 1 0 |
| 3 | if ne read 0 b 0 1 1 |
| 4 | ret 99 |
| 5 | end |
| 6 | m = ulong get b 0 |
| 7 | atsetup 0 |
| 8 | put arcfg 0 2 |
| 9 | for i ulong 3 |
| 10 | put arpkg i 2 |
| 11 | end |
| 12 | if and ge m 11 le m 13 |
| 13 | put arpkg sub m 11 1 |
| 14 | end |
| 15 | r = arbuild |
| 16 | if and ge m 11 le m 13 |
| 17 | if ne r -1 |
| 18 | ret 31 |
| 19 | end |
| 20 | ret 0 |
| 21 | end |
| 22 | if ne r 0 |
| 23 | ret 32 |
| 24 | end |
| 25 | if or ne get arcot 3 192 ne get arcot 8 2 |
| 26 | ret 33 |
| 27 | end |
| 28 | for i ulong 24 |
| 29 | if ne get arcot add 20 i 0 |
| 30 | ret 34 |
| 31 | end |
| 32 | end |
| 33 | for i ulong 1024 |
| 34 | put gpkt i get arcot i |
| 35 | end |
| 36 | put gin 0 get arclen 0 |
| 37 | put gin 1 araddr 15 |
| 38 | put gin 2 1 |
| 39 | for i ulong 4 |
| 40 | put gin add i 3 3 |
| 41 | end |
| 42 | for i ulong 7 |
| 43 | put s2cfg i 1 |
| 44 | put s2sc i 0 |
| 45 | end |
| 46 | put s2cfg 0 2 |
| 47 | put s2cfg 1 2 |
| 48 | put s2cfg 2 3 |
| 49 | put s2cfg 3 3 |
| 50 | put sprof 0 2 |
| 51 | put scfg 8 get gin 1 |
| 52 | siminit |
| 53 | chip = uint 464519168 |
| 54 | expected = long 0 |
| 55 | if eq m 1 |
| 56 | put s2cfg 1 1 |
| 57 | expected = -1 |
| 58 | end |
| 59 | if eq m 2 |
| 60 | chip = uint 447741952 |
| 61 | expected = -1 |
| 62 | end |
| 63 | if eq m 3 |
| 64 | put s2sc 0 8 |
| 65 | expected = -10 |
| 66 | end |
| 67 | if eq m 4 |
| 68 | put s2sc 2 1 |
| 69 | expected = -11 |
| 70 | end |
| 71 | if eq m 5 |
| 72 | put s2sc 3 1 |
| 73 | expected = -12 |
| 74 | end |
| 75 | if eq m 6 |
| 76 | put s2sc 4 1 |
| 77 | expected = -13 |
| 78 | end |
| 79 | if eq m 7 |
| 80 | put s2sc 5 1 |
| 81 | expected = -12 |
| 82 | end |
| 83 | if eq m 8 |
| 84 | put s2sc 6 1 |
| 85 | expected = -12 |
| 86 | end |
| 87 | if eq m 9 |
| 88 | put gpkt 0 1 |
| 89 | put gpkt 3 0 |
| 90 | expected = -1 |
| 91 | end |
| 92 | if eq m 10 |
| 93 | put gpkt 8 1 |
| 94 | expected = -1 |
| 95 | end |
| 96 | if eq m 14 |
| 97 | put s2sc 0 3 |
| 98 | put s2sc 1 3 |
| 99 | end |
| 100 | r = s2boot chip |
| 101 | if ne r expected |
| 102 | ret 40 |
| 103 | end |
| 104 | if eq r 0 |
| 105 | if or ne get s2ss 6 1 ne get ss SVIOL 0 |
| 106 | ret 41 |
| 107 | end |
| 108 | end |
| 109 | if or or eq m 1 eq m 2 or eq m 9 eq m 10 |
| 110 | if ne get s2ss 7 0 |
| 111 | ret 42 |
| 112 | end |
| 113 | end |
| 114 | if and ge m 5 le m 7 |
| 115 | if ne get s2ss 6 1 |
| 116 | ret 43 |
| 117 | end |
| 118 | end |
| 119 | ret 0 |
| 120 | end |