|
| 1 | +import { makeShifter } from "@/logic/nodeTypes/shift" |
| 2 | +import type { SimulationTemplate } from "./types" |
| 3 | + |
| 4 | +export const Exams2021: Record<string, SimulationTemplate> = { |
| 5 | + "a-82": { |
| 6 | + PCAddr: 0x0000300c, |
| 7 | + code: "sw $10,-0x100(10$)\naddi $10,$10,4\nadd $9,$10,$8\nlw $5,-0x100($10)\nor $3,$5,$10", |
| 8 | + registerInit: [ |
| 9 | + 0, 1904, 3808, 5712, 7616, 9520, 11424, 13328, 15232, 17136, 19040, 20944, |
| 10 | + 22848, 24752, 26656, 28560, 30464, 32368, 34272, 36176, 38080, 39984, |
| 11 | + 41888, 43792, 45696, 47600, 49504, 51408, 53312, 55216, 57120, 59024, |
| 12 | + ], |
| 13 | + placedNodes: { |
| 14 | + "alu-in0": { |
| 15 | + x: 673, |
| 16 | + y: 406, |
| 17 | + nodeType: makeShifter("right", 1), |
| 18 | + }, |
| 19 | + }, |
| 20 | + lineExecution: 1, |
| 21 | + }, |
| 22 | + |
| 23 | + "a-62": { |
| 24 | + PCAddr: 0xad4aff00, |
| 25 | + code: "sw $10,-0x100(10$)\naddi $10,$10,4\nadd $9,$10,$8\nlw $5,-0x100(10$)\nor $3,$5,$10", |
| 26 | + registerInit: [ |
| 27 | + 0, 1904, 3808, 5712, 7616, 9520, 11424, 13328, 15232, 17136, 19040, 20944, |
| 28 | + 22848, 24752, 26656, 28560, 30464, 32368, 34272, 36176, 38080, 39984, |
| 29 | + 41888, 43792, 45696, 47600, 49504, 51408, 53312, 55216, 57120, 59024, |
| 30 | + ], |
| 31 | + lineExecution: 1, |
| 32 | + }, |
| 33 | + |
| 34 | + /** NOTE: Register Values Unknown. */ |
| 35 | + "a-75": { |
| 36 | + PCAddr: 0x00400000, |
| 37 | + code: "addi $16,$0,10\nlw $11,32(16$)\nor $7,$16,$11\nsub $9,$7,$11\nsw $9,4(16$)\n", |
| 38 | + registerInit: [ |
| 39 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 40 | + 0, 0, 0, 0, 0, 0, 0, |
| 41 | + ], |
| 42 | + placedNodes: { |
| 43 | + "muxMemToReg-in0": { |
| 44 | + x: 987, |
| 45 | + y: 644, |
| 46 | + nodeType: makeShifter("left", 5), |
| 47 | + }, |
| 48 | + }, |
| 49 | + memoryInit: (address) => (address < 125 ? 0x3d3d3d : 0), |
| 50 | + lineExecution: 3, |
| 51 | + }, |
| 52 | + |
| 53 | + "c-65": { |
| 54 | + PCAddr: 0x000020f4, |
| 55 | + code: "and $13,$7,$8\nlw $10,0x100($6)\nor $12,$6,$10\nbeq $6,$12,2,0xfffffffc", |
| 56 | + registerInit: [ |
| 57 | + 0, 1536, 3072, 4608, 6144, 7680, 9216, 10752, 12288, 13824, 15360, 16896, |
| 58 | + 18432, 19968, 21504, 23040, 24576, 26112, 27648, 29184, 30720, 32256, |
| 59 | + 33792, 35328, 36864, 38400, 39936, 41472, 43008, 44544, 46080, 47616, |
| 60 | + ], |
| 61 | + lineExecution: 2, |
| 62 | + }, |
| 63 | + "c-92": { |
| 64 | + /** |
| 65 | + * TODO: Modified PC to PC+8 + all shiftLeft2 replaced with shiftLeft3 |
| 66 | + * |
| 67 | + */ |
| 68 | + PCAddr: 0x00002000, |
| 69 | + code: "sub $9,$8,$9\naddi $8,$9,0x100\naddi $8,$9,0x100\nbeq $1,$2,0x00000005\nlw $9,0x100($8)\nslt $1,$2,$1\nadd $17,$15,$9\nor $2,$6,$11\nsub $10,$4,$9", |
| 70 | + registerInit: [ |
| 71 | + 0, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, 448, 464, 480, |
| 72 | + 496, 512, 528, 544, 560, 576, 592, 608, 624, 640, 656, 672, 688, 704, 720, |
| 73 | + 736, 752, |
| 74 | + ], |
| 75 | + memoryInit: (address) => (address < 0x1000 * 4 ? address / 4 : 0), |
| 76 | + lineExecution: 5, |
| 77 | + }, |
| 78 | +} |
0 commit comments