You need to create this struct. The comments should guide you in making the need code. I am giving the last part of the code.

<'


struct packet_s {


//control the error creation


// the address field of the packet


// the length field of the packet


// the payload field of the packet
// it's size is controlled be the length field

// set the address to respond to address errors


// the parity field

// set the parity to respond to parity errors


// set a variable with the true parity value.


// compute the parity


// define the env unit
unit env_u {
// attach the clock of the due to an e event
event clock is rise('clock') @sim;
};

// create an instance of env under sys and set direct it
// to the verilog entity
extend sys {
env: env_u is instance;
keep env.hdl_path() == "top";
};


'>