According to the riscv manual, ret and call are two pseudo instructions respectively.
ret is jalr, x0, x1, 0.
call is {auipc x1, offset[31:12]; jalr x1, x1, offset[11:0]}.
In this link boom decode, use the following codes to judge ret and call instruction.
io.out.is_call := (cs_is_jal || cs_is_jalr) && GetRd(io.inst) === RA
io.out.is_ret := cs_is_jalr && GetRs1(io.inst) === BitPat(“b00?01”) && GetRd(io.inst) === X0
Why not judge the instruction like this
io.out.is_call := (cs_is_jalr) && GetRd(io.inst) === RA
io.out.is_ret := cs_is_jalr && GetRs1(io.inst) === BitPat(“b00001”) && GetRd(io.inst) === X0