Skip to content

Commit

Permalink
experimenting on alu
Browse files Browse the repository at this point in the history
  • Loading branch information
gullahmed1 committed Sep 12, 2023
1 parent 0d52725 commit dd35576
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/alu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,10 @@ module alu import ariane_pkg::*; #(

// Count Leading/Trailing Zeros
CLZ, CTZ : result_o = (lz_tz_empty) ? ({{(riscv::XLEN-$bits(lz_tz_count)){1'b0}},lz_tz_count} + 1) : ({{(riscv::XLEN-$bits(lz_tz_count)){1'b0}},lz_tz_count});

CLZW, CTZW: result_o = (lz_tz_wempty) ? 32 : {{riscv::XLEN-5{1'b0}}, lz_tz_wcount};

// Count population
CPOP, CPOPW: result_o = {{(riscv::XLEN-($clog2(riscv::XLEN))){1'b0}}, cpop};
CPOP, CPOPW: result_o = {{(riscv::XLEN-($clog2(riscv::XLEN))-1){1'b0}}, cpop};

// Sign and Zero Extend
SEXTB: result_o = {{riscv::XLEN-8{fu_data_i.operand_a[7]}}, fu_data_i.operand_a[7:0]};
Expand All @@ -297,8 +296,8 @@ module alu import ariane_pkg::*; #(
ROLW: result_o = {{riscv::XLEN-32{rolw[31]}}, rolw};
ROR, RORI: result_o = (riscv::XLEN == 64) ? ((fu_data_i.operand_a >> fu_data_i.operand_b[5:0]) | (fu_data_i.operand_a << (riscv::XLEN-fu_data_i.operand_b[5:0]))) : ((fu_data_i.operand_a >> fu_data_i.operand_b[4:0]) | (fu_data_i.operand_a << (riscv::XLEN-fu_data_i.operand_b[4:0])));
RORW, RORIW: result_o = {{riscv::XLEN-32{rorw[31]}}, rorw};
ORCB: result_o = (riscv::XLEN == 64) ? ({{8{|fu_data_i.operand_a[63:56]}}, {8{|fu_data_i.operand_a[55:48]}}, {8{|fu_data_i.operand_a[47:40]}}, {8{|fu_data_i.operand_a[39:32]}}, orcbw}) : orcbw;
REV8: result_o = (riscv::XLEN == 64) ? ({rev8w , {fu_data_i.operand_a[39:32]}, {fu_data_i.operand_a[47:40]}, {fu_data_i.operand_a[55:48]}, {fu_data_i.operand_a[63:56]}}) : rev8w;
ORCB: result_o = (riscv::XLEN == 64) ? ({{((riscv::XLEN/4)-8){|fu_data_i.operand_a[63:56]}}, {((riscv::XLEN/4)-8){|fu_data_i.operand_a[55:48]}}, {((riscv::XLEN/4)-8){|fu_data_i.operand_a[47:40]}}, {((riscv::XLEN/4)-8){|fu_data_i.operand_a[39:32]}}, orcbw}) : orcbw;
REV8: result_o = (riscv::XLEN == 64) ? ({rev8w , {((riscv::XLEN/4)-8){|fu_data_i.operand_a[39:32]}}, {((riscv::XLEN/4)-8){|fu_data_i.operand_a[47:40]}}, {((riscv::XLEN/4)-8){|fu_data_i.operand_a[55:48]}}, {((riscv::XLEN/4)-8){|fu_data_i.operand_a[63:56]}}}) : rev8w;

default: ; // default case to suppress unique warning
endcase
Expand Down

0 comments on commit dd35576

Please sign in to comment.