Skip to content

Commit

Permalink
Fix(PA/mips): support SB instruction.
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
Triple-Z committed Jun 22, 2017
1 parent d15bd2c commit 3245a3c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
13 changes: 4 additions & 9 deletions Project_Assignment/code.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
012c4026
012c4027
00094080
000c4082
000c4043
01694004
016c4006
000d4022
01684007
ae080000
a20b0001
810c0003
91090001
14 changes: 9 additions & 5 deletions Project_Assignment/datapath/dm.v
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ module dm_4k (addr, din, byteExt, wEn, clk, dout);
);

always @ ( posedge clk ) begin// Write;
if (wEn) begin
if (wEn == 2'b01) begin
if (byteExt == 2'b10) begin// Store byte.
tmpReg = dm[gpAddr][31:0];
case (byteSel)
2'b11: tmpReg[7:0] = din[7:0];
2'b10: tmpReg[15:8] = din[7:0];
2'b01: tmpReg[23:16] = din[7:0];
2'b00: tmpReg[31:24] = din[7:0];
2'b00: tmpReg[7:0] = din[7:0];
2'b01: tmpReg[15:8] = din[7:0];
2'b10: tmpReg[23:16] = din[7:0];
2'b11: tmpReg[31:24] = din[7:0];
// 2'b00: dm[gpAddr][7:0] <= din[7:0];
// 2'b01: dm[gpAddr][15:8] <= din[7:0];
// 2'b10: dm[gpAddr][23:16] <= din[7:0];
// 2'b11: dm[gpAddr][31:24] <= din[7:0];
endcase
dm[gpAddr][31:0] = tmpReg[31:0];
end else begin// Store word.
Expand Down
1 change: 1 addition & 0 deletions Project_Assignment/mips.v
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ module mips (clk, rst);
dm_4k dm(
.addr(alu_out[11:0]),
.din(routb),
.byteExt(byteExt),
.wEn(memWr),
.clk(clk),
.dout(dm_out)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[TOC]

> Last Revised: `6/20/2017`
> Last Revised: `6/22/2017`
## Project Assignment

Expand Down Expand Up @@ -39,9 +39,9 @@
|`supported` | lui |001111 |x |0110 |0 |0 |00 |01 |10 |00 |01 |00 |00 |00 |x |x |0x00000010 |
|`supported` | lw |100011 |x |0000 |0 |0 |00 |01 |00 |01 |01 |00 |01 |00 |11 |
|`supported` | sw |101011 |x |0000 |0 |0 |x |01 |00 |x |00 |01 |01 |00 |11 |
|`untested` | lb |100000 |x |0000 |0 |0 |01 |01 |00 |01 |01 |00 |01 |00 |01 |
|`untested` | lbu |100100 |x |0000 |0 |0 |01 |01 |00 |01 |01 |00 |01 |00 |00 |
|`untested` | sb |101000 |x |0000 |0 |0 |00 |01 |00 |x |00 |01 |01 |00 |10 |
|`error` | lb |100000 |x |0000 |0 |0 |01 |01 |00 |01 |01 |00 |01 |00 |01 |
|`error` | lbu |100100 |x |0000 |0 |0 |01 |01 |00 |01 |01 |00 |01 |00 |00 |
|`supported` | sb |101000 |x |0000 |0 |0 |00 |01 |00 |x |00 |01 |01 |00 |10 |
|`supported` | beq |000100 |x |x |1 |0 |x |00 |00 |x |00 |00 |x |00 |x |
|`untested` | bne |000101 |x |x |1 |0 |x |00 |00 |x |00 |00 |x |00 |x |
|`untested` | bgez |000001 |x |x |1 |0 |x |00 |00 |x |00 |00 |x |00 |x |
Expand Down

0 comments on commit 3245a3c

Please sign in to comment.