aboutsummaryrefslogtreecommitdiffstats
path: root/ee4363/mp1/mp12/mipspipe.v
diff options
context:
space:
mode:
authorRossTheRoss <mstrapp@protonmail.com>2020-12-03 09:50:18 -0600
committerRossTheRoss <mstrapp@protonmail.com>2020-12-03 09:50:18 -0600
commit8486478a788896848fd1d90448d41bb5ebbbe059 (patch)
tree382e16fac6ad1dbaaf12929891efd5255cbce02d /ee4363/mp1/mp12/mipspipe.v
parentaaaaaaaaaaaaaaaa (diff)
downloadhomework-8486478a788896848fd1d90448d41bb5ebbbe059.tar
homework-8486478a788896848fd1d90448d41bb5ebbbe059.tar.gz
homework-8486478a788896848fd1d90448d41bb5ebbbe059.tar.bz2
homework-8486478a788896848fd1d90448d41bb5ebbbe059.tar.lz
homework-8486478a788896848fd1d90448d41bb5ebbbe059.tar.xz
homework-8486478a788896848fd1d90448d41bb5ebbbe059.tar.zst
homework-8486478a788896848fd1d90448d41bb5ebbbe059.zip
do machine problem
Diffstat (limited to '')
-rw-r--r--ee4363/mp1/mp12/mipspipe.v (renamed from ee4363/mp1/mipspipe.v)11
1 files changed, 7 insertions, 4 deletions
diff --git a/ee4363/mp1/mipspipe.v b/ee4363/mp1/mp12/mipspipe.v
index 951bde0..62b4e8b 100644
--- a/ee4363/mp1/mipspipe.v
+++ b/ee4363/mp1/mp12/mipspipe.v
@@ -40,10 +40,12 @@ module mipspipe(clock);
MEMWBIR = nop; // no-ops placed in pipeline latches
// test some instructions
for (i=0;i<=31;i=i+1) Regs[i] = i; // initialize registers
- IMemory[0] = 32'h8c210003;
- IMemory[1] = 32'hac020000;
- IMemory[2] = 32'h00642820;
- for (j=3;j<=1023;j=j+1) IMemory[j] = nop;
+IMemory[0] = 32'h00412820; // ADD OPCODE: 000000 00010 00001 00101 00000 100000
+ IMemory[1] = 32'h8CA30004; // First LW: 100011 00101 00011 00000 00000 00 0100
+ IMemory[2] = 32'h8C420000; // Second LW: 100011 00010 00010 00000 00000 000000
+ IMemory[3] = 32'h00A31825; // OR OPCODE: 000000 00101 00011 00011 00000 100101
+ IMemory[4] = 32'hACA30000; // SW: 101011 00101 00011 00000 00000 000000
+ for (j=5;j<=1023;j=j+1) IMemory[j] = nop;
DMemory[0] = 32'h00000000;
DMemory[1] = 32'hffffffff;
for (k=2;k<=1023;k=k+1) DMemory[k] = 0;
@@ -67,6 +69,7 @@ module mipspipe(clock);
else if (IDEXop==ALUop) begin // ALU operation
case (IDEXIR[5:0]) // R-type instruction
32: EXMEMALUOut <= Ain + Bin; // add operation
+ 37: EXMEMALUOut <= Ain | Bin; //or
default: ; // other R-type operations [to be implemented]
endcase
end