I am trying SV code which involves both using priority
and casez
constructs together. What I want to achieve is based on the valid request available (sel
is a 4-bit register which will contain who has valid request at a time). An output will be generated based on the least significant bit who has valid request.
always @ (posedge clk or negedge rst)
begin
Priority casez(sel)
4'b0000: check = 4'b0;
4'b???1: check = 4'b1;
4'b??1?: check = 4'b2;
4'b?1??: check = 4'b4;
4'b1???: check = 4'b8;
default: check = 4'b0;
endcase
end
When I try to execute this code through emulation, I am facing an issue which states:
Non-synthesizable clocking style: only conditional operations or if statements are supported in sync-async always blocks
Does this mean that priority
casez
can't be synthesized?
If it's not possible, what's the best way to achieve this without defining each and every possible combination of sel
?