uvm_reg has a mirror: ask a field what it should read, and the register layer answers from tracked state. uvm_mem has none. Each access moves data across the bus and nothing remembers what any address was last set to; to check reads, you build that state yourself, by address.
uvm_mem’s hooks for it: post_write(uvm_reg_item rw) and post_read(uvm_reg_item rw) run from the base class’s do_write()/do_read() after every access, frontdoor or back, through any map. rw.get_offset() is the address; rw.get_value(0) is the data written or read back.
RequirementsOverriding both on tracked_mem with whatever member state you need
match_count if it returns the value last written to its address, and mismatch_count if it doesn’t.Right nowmatch_count=0, want 4. The stub tracks nothing.
Done whenAfter the access sequence in the test, match_count is 4 and mismatch_count is
your override is what catches it.
One working answer: brokenbench's own fix for this exercise. Try a few runs first.
What changes, against the code you started with:
docker run --pull always --rm -p 127.0.0.1:8787:8787 ghcr.io/adibis/brokenbench-runnerLooking for a runner on this computer…
The first start downloads about 250 MB; after that it starts in seconds and only downloads again when there's an update. Your code goes to the runner on your computer, not to chipdv.io.