From dd355769ad22332547b51b145659043522c2e4f8 Mon Sep 17 00:00:00 2001 From: gullahmed1 Date: Tue, 12 Sep 2023 17:57:00 +0500 Subject: [PATCH] experimenting on alu --- core/alu.sv | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/alu.sv b/core/alu.sv index 6c4c40819f1..8658c581494 100644 --- a/core/alu.sv +++ b/core/alu.sv @@ -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]}; @@ -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