-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathguide.ucode
More file actions
13 lines (11 loc) · 738 Bytes
/
Copy pathguide.ucode
File metadata and controls
13 lines (11 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
// ========= FETCH =========
fetch0: a_sel=7, b_sel=7, alu_sel=AND, r6_write, mar_sel=LOAD;
fetch1: a_sel=6, c_in, alu_sel=ADDA, r7_write, ir0_sel=LOAD, read, if wait then goto fetch1 endif;
fetch2: a_sel=7, b_sel=7, alu_sel=AND, r6_write, mar_sel=LOAD;
fetch3: a_sel=6, c_in, alu_sel=ADDA, r7_write, ir1_sel=LOAD, read, if wait then goto fetch3 endif;
// ========= OPCODES =========
switch: goto opcode[IR_OPCODE];
opcode[0]: goto fetch0; // no_op
opcode[1]: ri_sel, rj_sel, rk_sel, alu_sel=ADD, goto fetch0; // add (ri <- rj + rk)
opcode[2]: result_sel=IR_CONST8, ri_sel, goto fetch0; // load immediate (ri <- ir_const8)
opcode[3]: goto opcode[3]; // halt