The mem_model_pkg checks write value matches with previous write value, but there are some limitations.
get_bkdr_val(mem_addr_t addr);
User must override this pure virtual function to return backdoor value from the memory based on the given address.
read_start(mem_addr_t addr, mem_mask_t mask)
This function should be called when a read request is latched by design. Predicted read value is calculated in this function:
read_finish(mem_data_t act_data, mem_addr_t addr, mem_mask_t mask, bit en_check_consistency)
This function should be called when a read transaction is done. It compares the read value with expected value calculated at read_start
.
write_start(mem_addr_t addr, mem_mask_t mask)
This function should be called when a write request is latched by design. Write items will be stored in the queue for checking RAW hazard and future comparison.
write_finish(mem_addr_t addr, mem_mask_t mask, bit en_check_consistency)
This function should be called once the write data is written into the memory. This function will read back the data from backdoor and compare with write value stored in write_item_q.