In reply to edcarstens:
Thank you very much for your answer.
There are still some questions:
First I did the same, in the driver I defined an unpacked array and the frame size I defined like this:
for standard frames : frame.size = dlc + constant_a;
for extended frames : frame.size = dlc + constant_b;
But with this scenario the problem was with assigning packed arrays from my seq_item (like dlc or id) to the unpacked array (frame)
the frame is : frame = {sof,id,ide,rtr,r0,dlc,data,crc,ack,eof}
I need to concatinate all these fields inthe driver, how can I use your soliution here:
For your data, I have found it easiest to use a queue of bits so the driver can easily pop each bit off the queue → can you explain more.
1- first problem: in the driver I have to decide which and hawmany of the frame bits are dedicated to data. ex. 8 bits of the frame or 16 bits or more(even zero)
2- second problem: id is another factor to decide which frame size(11bits id or 29 bits)
3- even if I use post randomize method crc calculation should be different for all possible cases (combination if 2 id possibilities + 8 dlc possibilities)what is difference if I implement a post_randomize method or implement the crc in the driver?
I use Questasim.
Thanks again for your support.