Hi,
In my current project I need to create a number of sequence items which are extended from one basic sequence item.
I am facing 2 difficulties here.
- I have a crc32 function implementation in basic sequence item. The payload which is an argument to the crc32 function need to be of variable width. I need to calculate the crc32 in the child sequence items by passing a different payload each time.
class basic_sequence_item extends uvm_sequence_item;
localparam payload_size = 'd24;
localparam divisor_size = 'd33;
`uvm_object_utils(basic_sequence_item)
.....
....
function bit[31:0] crc32rem(input bit[payload_size-1:0] payload,input bit[divisor_size-1:0] divisor);
............
...........
endfunction
endclass
class child_sequence_item extends basic_sequence_item;
............
...........
payload = {target_id_field,cmd};
crc32=crc32rem(payload,divisor);
enclass
Here how can I pass the new payload_size to the crc32rem function in base_sequence_item? divisor part is okay since its fixed every time.
2) The monitor is not able to collect the fields registered to factory from the child sequence item. It shows that field is not available in the scope of basic_sequence_item instance handle.