Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spi_device/dv] Update scoreboard to track dynamically-updated status registers #21111

Closed
a-will opened this issue Jan 30, 2024 · 1 comment
Closed
Assignees
Labels
Component:DV DV issue: testbench, test case, etc. IP:spi_device

Comments

@a-will
Copy link
Contributor

a-will commented Jan 30, 2024

Description

This is a DV companion issue to #20754. When the SPI domain begins updating status registers at every byte beat (8th posedge of SPI clock), the Read Status command will no longer return a static value. Consequently, validation of Read Status commands will need to be updated to support tracking changes that occur at every byte beat.

The design PR will initially disable this section of the code:

foreach (item.payload_q[i]) begin
// status has 3 bytes, if read OOB, it will wrap
int offset = (start_addr + i) % 3;
`DV_CHECK_CASE_EQ(item.payload_q[i], status[offset * 8 +: 8],
$sformatf("status mismatch, offset %0d, act: 0x%0h, exp: 0x%0h",
offset, item.payload_q[i], status[offset * 8 +: 8]))
end

In addition, the core clock (sys_clk) domain will continue to update its view only at CSB de-assertion time. As a result, the scoreboard's current strategy of using csr_rd() to determine the resolved value (of software and hardware updates at commit time) will no longer work. latch_flash_status() currently represents what happens to both the SPI domain source-of-truth and the sys_clk domain's view, but the update rate for these two domains is no longer the same.

Note that the passthrough gate's "view" of the BUSY bit also continues to only update at CSB de-assertion time.

Here's a list of timings to keep in mind:

  • (byte beat) SPI domain commits a newly-resolved flash status register value.
  • (byte beat) The latest committed value of the flash status register is prepared for the next response byte for any ongoing Read Status command.
  • (CSB posedge) The current value of the BUSY bit becomes the committed value for the passthrough gate enable.
  • (CSB posedge) Delayed by a synchronizer, the core clock domain picks up the current value of the flash status register.
@antmarzam
Copy link
Contributor

This ticket can now be closed since the flash_status TB changes have now been merged in master in PR #22763

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:DV DV issue: testbench, test case, etc. IP:spi_device
Projects
None yet
Development

No branches or pull requests

3 participants