Verification #52 · 2026-11-14 · UVM out-of-order scoreboard · Hard · about 40 min

Build the testbench for out-of-order responses

tagrsp.sv has four independent slots, one per id (0 to 3). A request is presented with req_valid, req_id and req_data, and it is accepted on a clock edge where req_valid = 1 and req_ready = 1. req_ready is 0 while the slot for req_id is still waiting for its response, so each id has at most one request outstanding. The unit answers a request with one response: rsp_valid = 1 for one clock, with rsp_id and rsp_data = req_data ^ id (the id zero-extended to 8 bits). The delay depends on the data, and when several slots are ready at once the lowest id goes first, so responses can come back in a different order from the requests. There is no rsp_ready: a response is taken in the clock where rsp_valid is 1.

Write the verification components in components.sv. The monitor and environment in env.sv are provided, and they use your four classes by name. The monitor sends one tag_item for every accepted request (is_rsp = 0) and one for every clock with rsp_valid = 1 (is_rsp = 1, with the response's id and data). When both happen in one clock, the request is sent first.

  • tag_item: random id, data, and gap (idle clocks before the request). Requests should often come back to back, so several ids are outstanding together and responses collide. Make data hit the corner values 0 and 255 often.
  • tag_seq: sends count random items.
  • tag_driver: waits out reset, then for each item waits gap clocks, presents the request, and holds it until req_ready is 1 at a clock edge. Then it drops req_valid and takes the next item.
  • tag_scoreboard: tracks which ids are outstanding and the data expected for each. Every item the monitor sends counts in checked. Every protocol or data error counts in errors; report the first few with uvm_error. In check_phase, a request that never got a response is an error too.

Run uses tb.sv: 60 random requests into the correct unit. Submit runs your testbench against the correct unit and against four faulty ones. Your scoreboard must stay quiet on the first and catch each of the others.

Write and run your answer in the browser. The hidden tests check it, and it’s free.