Fix beq problems
This commit is contained in:
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -58,6 +58,7 @@ module InstDecode (
|
||||
assign immediate = IFID_instruction[15:0];
|
||||
|
||||
// This output is directly derived from IFID regs
|
||||
assign PC_plus_4 = IFID_PC_plus_4;
|
||||
assign jump_target = {IFID_PC_plus_4[31:28], j_addr, 2'b00};
|
||||
assign rs_address = rs;
|
||||
assign rt_address = rt;
|
||||
|
||||
@@ -7,17 +7,16 @@ module InstructionMemory (
|
||||
|
||||
always @(*) begin
|
||||
case (address[31:2])
|
||||
20'd0: instruction <= 32'h3c1000ca; // lui $s0, 0xca
|
||||
20'd6: instruction <= 32'h221000fe; // addi $s0, $s0, 0xfe
|
||||
20'd11: instruction <= 32'h2011ffdf; // addi $s1, $zero, -0x21
|
||||
20'd16: instruction <= 32'h00109100; // sll $s2, $s0, 4
|
||||
20'd21: instruction <= 32'h00109082; // srl $s2, $s0, 2
|
||||
20'd26: instruction <= 32'h00119043; // sra $s2, $s1, 1
|
||||
20'd31: instruction <= 32'h0230902a; // slt $s2, $s1, $s0
|
||||
20'd36: instruction <= 32'h0211902a; // slt $s2, $s0, $s1
|
||||
20'd41: instruction <= 32'h0230882b; // sltu $s1, $s1, $s0
|
||||
20'd46: instruction <= 32'h2a120004; // slti $s2, $s0, 0x4
|
||||
20'd51: instruction <= 32'h2e12fffc; // sltiu $s2, $s0, -0x4
|
||||
20'd0: instruction <= 32'h20110001; // addi $s1, $zero, 1
|
||||
20'd6: instruction <= 32'h20120001; // addi $s2, $zero, 1
|
||||
20'd11: instruction <= 32'h12320009; // beq $s1, $s2, beq_target
|
||||
20'd16: instruction <= 32'h20130001; // addi $s3, $zero, 1
|
||||
// beq_target:
|
||||
20'd21: instruction <= 32'h22310001; // addi $s1, $s1, 1
|
||||
20'd26: instruction <= 32'h12320009; // beq $s1, $s2, beq_target2
|
||||
20'd31: instruction <= 32'h20130003; // addi $s3, $zero, 3
|
||||
// beq_target2:
|
||||
20'd36: instruction <= 32'h08100023; // j beq_target2
|
||||
default: instruction <= 32'h00000000;
|
||||
endcase
|
||||
end
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<Option Name="IPStaticSourceDir" Val="$PIPUSERFILESDIR/ipstatic"/>
|
||||
<Option Name="EnableBDX" Val="FALSE"/>
|
||||
<Option Name="FeatureSet" Val="FeatureSet_Classic"/>
|
||||
<Option Name="WTXSimLaunchSim" Val="174"/>
|
||||
<Option Name="WTXSimLaunchSim" Val="190"/>
|
||||
<Option Name="WTModelSimLaunchSim" Val="0"/>
|
||||
<Option Name="WTQuestaLaunchSim" Val="0"/>
|
||||
<Option Name="WTIesLaunchSim" Val="0"/>
|
||||
|
||||
Reference in New Issue
Block a user