Skip to content

Commit

Permalink
[hardware] Fix masku popc/vfirst tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mp-17 committed Jun 19, 2024
1 parent fb2d2b0 commit ae65e91
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions hardware/src/masku/masku.sv
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,23 @@ module masku import ara_pkg::*; import rvv_pkg::*; #(
// Remaining elements of the current instruction in the commit phase
vlen_t commit_cnt_d, commit_cnt_q;

// vpopc substitute
assign popcount = vcpop_operand[$clog2(DataWidth*NrLanes):0];
// Population count for vcpop.m instruction
popcount #(
.INPUT_WIDTH (DataWidth*NrLanes)
) i_popcount (
.data_i (vcpop_operand),
.popcount_o(popcount )
);

// vfirst substitute
assign vfirst_count = vcpop_operand[$clog2(DataWidth*NrLanes)-1:0];
assign vfirst_empty = vcpop_operand[0];
// Trailing zero counter
lzc #(
.WIDTH(DataWidth*NrLanes),
.MODE (0)
) i_clz (
.in_i (vcpop_operand),
.cnt_o (vfirst_count ),
.empty_o (vfirst_empty )
);

always_comb begin: p_mask_alu
alu_result = '0;
Expand Down

0 comments on commit ae65e91

Please sign in to comment.