Skip to content

Commit

Permalink
fix sra, srai
Browse files Browse the repository at this point in the history
  • Loading branch information
yttnn committed Apr 6, 2024
1 parent be15c3f commit 3e6a491
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/core.sv
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module core (
3'b010 : alu_out = ($signed(alu_in_1) < $signed(alu_in_2));
3'b011 : alu_out = (alu_in_1 < alu_in_2);
3'b100 : alu_out = (alu_in_1 ^ alu_in_2);
3'b101 : alu_out = funct7[5] ? ($signed(alu_in_1) >>> shift_amount) : (alu_in_1 >> shift_amount);
3'b101 : alu_out = funct7[5] ? ($signed(alu_in_1) >>> shift_amount) : ($signed(alu_in_1) >> shift_amount);
3'b110 : alu_out = (alu_in_1 | alu_in_2);
3'b111 : alu_out = (alu_in_1 & alu_in_2);
default: ;
Expand Down
4 changes: 2 additions & 2 deletions core/memory.sv
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ module memory (
// $readmemh("../riscv-tests/hex/rv32ui-p-slti.hex", ROM);
// $readmemh("../riscv-tests/hex/rv32ui-p-sltiu.hex", ROM);
// $readmemh("../riscv-tests/hex/rv32ui-p-sltu.hex", ROM);
// $readmemh("../riscv-tests/hex/rv32ui-p-sra.hex", ROM);
$readmemh("../riscv-tests/hex/rv32ui-p-sra.hex", ROM);
// $readmemh("../riscv-tests/hex/rv32ui-p-srai.hex", ROM);
// $readmemh("../riscv-tests/hex/rv32ui-p-srl.hex", ROM);
// $readmemh("../riscv-tests/hex/rv32ui-p-srli.hex", ROM);
// $readmemh("../riscv-tests/hex/rv32ui-p-sub.hex", ROM);
$readmemh("../riscv-tests/hex/rv32ui-p-sw.hex", ROM);
// $readmemh("../riscv-tests/hex/rv32ui-p-sw.hex", ROM);
// $readmemh("../riscv-tests/hex/rv32ui-p-xor.hex", ROM);
// $readmemh("../riscv-tests/hex/rv32ui-p-xori.hex", ROM);
end
Expand Down

0 comments on commit 3e6a491

Please sign in to comment.