aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-09-08 20:08:48 +0900
committernsfisis <nsfisis@gmail.com>2024-09-08 20:08:48 +0900
commitd5708373d89d0a5a0eaccba17d0c1444cef4ed63 (patch)
treec76ebf781cc3ff1d85b048a5d8370e4f9c45f7bc
parent1b546741a26416ae9cc9815660bdfa7bfb1c311d (diff)
downloadmncore-challenge-d5708373d89d0a5a0eaccba17d0c1444cef4ed63.tar.gz
mncore-challenge-d5708373d89d0a5a0eaccba17d0c1444cef4ed63.tar.zst
mncore-challenge-d5708373d89d0a5a0eaccba17d0c1444cef4ed63.zip
16-Count-Up (incomplete)
-rw-r--r--problems/16-Count-Up/01.vsm213
1 files changed, 213 insertions, 0 deletions
diff --git a/problems/16-Count-Up/01.vsm b/problems/16-Count-Up/01.vsm
new file mode 100644
index 0000000..8f8d716
--- /dev/null
+++ b/problems/16-Count-Up/01.vsm
@@ -0,0 +1,213 @@
+imm i"4" $s0/1000
+imm i"0b111" $s1/1000
+imm i"0b1110" $s2/1000
+imm i"6" $s3/1000
+
+imm i"1" $r0/1000
+imm i"2" $r1/1000
+
+# + l1bid x 16
+ilsl $l1bid $s0 $nowrite
+iadd $aluf $r0v $r0v
+# + (peid & 0b111) x 2
+iand $peid $s1 $nowrite
+ipackbit $aluf $n0 $nowrite
+iadd $aluf $r0v $r0v
+# + (mabid & 0b10) x 64
+iand $mabid $s2 $nowrite
+ilsl $aluf $s3 $nowrite
+iadd $aluf $r0v $r0v
+
+nop/2
+
+# 1 LW / pe / cycle
+# 64 LW / cycle
+# 256 LW / step
+# (4096/256).times { |i| puts "l1bmd $lr#{4*i}v $lb#{256*i}" }
+l1bmd $lr0v $lb0
+l1bmd $lr4v $lb256
+l1bmd $lr8v $lb512
+l1bmd $lr12v $lb768
+l1bmd $lr16v $lb1024
+l1bmd $lr20v $lb1280
+l1bmd $lr24v $lb1536
+l1bmd $lr28v $lb1792
+l1bmd $lr32v $lb2048
+l1bmd $lr36v $lb2304
+l1bmd $lr40v $lb2560
+l1bmd $lr44v $lb2816
+l1bmd $lr48v $lb3072
+l1bmd $lr52v $lb3328
+l1bmd $lr56v $lb3584
+l1bmd $lr60v $lb3840
+
+# 8 LW / l1b / cycle
+# 64 LW / cycle
+# 256 LW / step
+# (32768/256).times { |i| puts "l2bmd $lb#{32*i} $lc#{256*i}" }
+l2bmd $lb0 $lc0 # OK
+l2bmd $lb32 $lc256 # OK
+l2bmd $lb64 $lc512 # OK
+l2bmd $lb96 $lc768 # OK
+l2bmd $lb128 $lc1024
+l2bmd $lb160 $lc1280
+l2bmd $lb192 $lc1536
+l2bmd $lb224 $lc1792
+l2bmd $lb256 $lc2048
+l2bmd $lb288 $lc2304
+l2bmd $lb320 $lc2560
+l2bmd $lb352 $lc2816
+l2bmd $lb384 $lc3072
+l2bmd $lb416 $lc3328
+l2bmd $lb448 $lc3584
+l2bmd $lb480 $lc3840
+l2bmd $lb512 $lc4096
+l2bmd $lb544 $lc4352
+l2bmd $lb576 $lc4608
+l2bmd $lb608 $lc4864
+l2bmd $lb640 $lc5120
+l2bmd $lb672 $lc5376
+l2bmd $lb704 $lc5632
+l2bmd $lb736 $lc5888
+l2bmd $lb768 $lc6144
+l2bmd $lb800 $lc6400
+l2bmd $lb832 $lc6656
+l2bmd $lb864 $lc6912
+l2bmd $lb896 $lc7168
+l2bmd $lb928 $lc7424
+l2bmd $lb960 $lc7680
+l2bmd $lb992 $lc7936
+l2bmd $lb1024 $lc8192
+l2bmd $lb1056 $lc8448
+l2bmd $lb1088 $lc8704
+l2bmd $lb1120 $lc8960
+l2bmd $lb1152 $lc9216
+l2bmd $lb1184 $lc9472
+l2bmd $lb1216 $lc9728
+l2bmd $lb1248 $lc9984
+l2bmd $lb1280 $lc10240
+l2bmd $lb1312 $lc10496
+l2bmd $lb1344 $lc10752
+l2bmd $lb1376 $lc11008
+l2bmd $lb1408 $lc11264
+l2bmd $lb1440 $lc11520
+l2bmd $lb1472 $lc11776
+l2bmd $lb1504 $lc12032
+l2bmd $lb1536 $lc12288
+l2bmd $lb1568 $lc12544
+l2bmd $lb1600 $lc12800
+l2bmd $lb1632 $lc13056
+l2bmd $lb1664 $lc13312
+l2bmd $lb1696 $lc13568
+l2bmd $lb1728 $lc13824
+l2bmd $lb1760 $lc14080
+l2bmd $lb1792 $lc14336
+l2bmd $lb1824 $lc14592
+l2bmd $lb1856 $lc14848
+l2bmd $lb1888 $lc15104
+l2bmd $lb1920 $lc15360
+l2bmd $lb1952 $lc15616
+l2bmd $lb1984 $lc15872
+l2bmd $lb2016 $lc16128
+l2bmd $lb2048 $lc16384
+l2bmd $lb2080 $lc16640
+l2bmd $lb2112 $lc16896
+l2bmd $lb2144 $lc17152
+l2bmd $lb2176 $lc17408
+l2bmd $lb2208 $lc17664
+l2bmd $lb2240 $lc17920
+l2bmd $lb2272 $lc18176
+l2bmd $lb2304 $lc18432
+l2bmd $lb2336 $lc18688
+l2bmd $lb2368 $lc18944
+l2bmd $lb2400 $lc19200
+l2bmd $lb2432 $lc19456
+l2bmd $lb2464 $lc19712
+l2bmd $lb2496 $lc19968
+l2bmd $lb2528 $lc20224
+l2bmd $lb2560 $lc20480
+l2bmd $lb2592 $lc20736
+l2bmd $lb2624 $lc20992
+l2bmd $lb2656 $lc21248
+l2bmd $lb2688 $lc21504
+l2bmd $lb2720 $lc21760
+l2bmd $lb2752 $lc22016
+l2bmd $lb2784 $lc22272
+l2bmd $lb2816 $lc22528
+l2bmd $lb2848 $lc22784
+l2bmd $lb2880 $lc23040
+l2bmd $lb2912 $lc23296
+l2bmd $lb2944 $lc23552
+l2bmd $lb2976 $lc23808
+l2bmd $lb3008 $lc24064
+l2bmd $lb3040 $lc24320
+l2bmd $lb3072 $lc24576
+l2bmd $lb3104 $lc24832
+l2bmd $lb3136 $lc25088
+l2bmd $lb3168 $lc25344
+l2bmd $lb3200 $lc25600
+l2bmd $lb3232 $lc25856
+l2bmd $lb3264 $lc26112
+l2bmd $lb3296 $lc26368
+l2bmd $lb3328 $lc26624
+l2bmd $lb3360 $lc26880
+l2bmd $lb3392 $lc27136
+l2bmd $lb3424 $lc27392
+l2bmd $lb3456 $lc27648
+l2bmd $lb3488 $lc27904
+l2bmd $lb3520 $lc28160
+l2bmd $lb3552 $lc28416
+l2bmd $lb3584 $lc28672
+l2bmd $lb3616 $lc28928
+l2bmd $lb3648 $lc29184
+l2bmd $lb3680 $lc29440
+l2bmd $lb3712 $lc29696
+l2bmd $lb3744 $lc29952
+l2bmd $lb3776 $lc30208
+l2bmd $lb3808 $lc30464
+l2bmd $lb3840 $lc30720
+l2bmd $lb3872 $lc30976
+l2bmd $lb3904 $lc31232
+l2bmd $lb3936 $lc31488
+l2bmd $lb3968 $lc31744
+l2bmd $lb4000 $lc32000
+l2bmd $lb4032 $lc32256
+l2bmd $lb4064 $lc32512
+
+# 16 LW / cycle
+# 64 LW / step
+# 2^15 W = 2^14 LW
+mvp/n16384 $lc0@.0 $d0
+
+# L1B 0 = 1 ... 16 129 ... 144 257 ... 272 385 ... 400
+# L1B 1 = 17 ... 32 145 ... 160 273 ... 288 401 ... 416
+# L1B 2 = 33 ... 48 161 ... 176 289 ... 304 417 ... 432
+# L1B 3 = 49 ... 64 177 ... 192 305 ... 320 433 ... 448
+# L1B 4 = 65 ... 80 193 ... 208 321 ... 336 449 ... 464
+# L1B 5 = 81 ... 96 209 ... 224 337 ... 352 465 ... 480
+# L1B 6 = 97 ... 112 225 ... 240 353 ... 368 481 ... 496
+# L1B 7 = 113 ... 128 241 ... 256 369 ... 384 497 ... 512
+#
+# L1B 0
+# PE 0.0 (0) = 1 2 | 1 + ($peid & 0b111)<<1
+# PE 0.1 (1) = 3 4 |
+# PE 0.2 (2) = 5 6 |
+# PE 0.3 (3) = 7 8 |
+# PE 1.0 (4) = 9 10 |
+# PE 1.1 (5) = 11 12 |
+# PE 1.2 (6) = 13 14 |
+# PE 1.3 (7) = 15 16 |
+# PE 2.0 (0) = 129 130 | 1 + ($peid & 0b111)<<1 + ($mabid & 0b10)<<6
+# PE 2.1 (1) = 131 132 |
+# PE 2.2 (2) = 133 134 |
+# PE 2.3 (3) = 135 136 |
+# PE 3.0 (4) = 137 138 |
+# PE 3.1 (5) = 139 140 |
+# PE 3.2 (6) = 141 142 |
+# PE 3.3 (7) = 143 144 |
+# PE 4.0 (0) = 257 258 | 1 + ($peid & 0b111)<<1 + ($mabid & 0b10)<<6
+# ...
+# PE 5.3 (7) = 271 272 |
+# PE 6.0 (0) = 385 386 | 1 + ($peid & 0b111)<<1 + ($mabid & 0b10)<<6
+# ...
+# PE 7.3 (7) = 399 400 |