Skip to content

Conversation

hcallahan-lowrisc
Copy link
Contributor

Builds on #28491 (ignore first 5 commits shared from this PR) with formatting changes and cleanups to existing testbench code.

Review commit-by-commit. The changes on top should not break existing functionality.
There is some very minor behavioural changes, such as the addition of long timeouts during the bootstrap tasks, but these are inconsequential to existing tests. Most of the diff is improving formatting and adding comments where they were previously missing or incomplete.

This task can be forked into the background to capture UART console traffic into
the test logs. This is useful for observation and sequencing inside logfiles.

Signed-off-by: Harry Callahan <[email protected]>
This is in support of future tests which will invoke the bootstrapping routine
multiple times within a single simulation.

Signed-off-by: Harry Callahan <[email protected]>
… tweaks.

This contains no functional change within the simulation environment, however
noise in the logfile outputs is reduced for developers. Readability is
improved significantly by improving formatting and adding full prose comments.

Signed-off-by: Harry Callahan <[email protected]>
Improve readability by reformatting nested if-else statements into a case
expression. Add comments where needed, while removing unnecessary ones.

Signed-off-by: Harry Callahan <[email protected]>
…ulus routines

Allow for invoking the bootstrap routine multiple times in a single test

Signed-off-by: Harry Callahan <[email protected]>
// TODO: support bootstrapping entire flash address space, not just slot A.
`DV_CHECK_FATAL(cfg.sw_images.exists(SwTypeTestSlotA))

`uvm_info(`gfn, "SPI-Bootstrapping Flash SlotA...", UVM_MEDIUM)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd probably put a space in "slot A" here and in the next message.

// (Optionally) Backdoor load memories with pre-built binary images.

if (!cfg.skip_rom_bkdr_load) begin
`uvm_info(`gfn, "Initializing ROM via backdoor with binary image: cfg.sw_images[SwTypeRom]", UVM_MEDIUM)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is triggering a line length warning. Also, wouldn't it be better to give the path, replacing cfg.sw_images[SwTypeRom] with %0s ?

virtual task spi_device_load_bootstrap(string sw_image);
// Drive the spi_host agent connected to the DUT spi_device according to the ROM Bootstrap
// procedure.
virtual task spi_agent_drive_bootstrap(byte byte_q[$]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this doesn't get overridden or used anywhere else, maybe drop the "virtual" and make it "local"?

// presented by the ROM. Afterwards, bring the software straps back to 0,
// and issue a power-on reset.
// The `sw_image` path should point to an image usable by the `read_sw_frames` task.
virtual task spi_device_load_bootstrap(string sw_image);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this doesn't get overridden, I'd drop the virtual. It's also only used from extension classes, so maybe make it protected?

cfg.chip_vif.sw_straps_if.drive(3'h7);

`uvm_info(`gfn, "Waiting for DUT ROM to configure spi_device ready for bootstrap...", UVM_LOW)
csr_spinwait(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these stages supposed to be serialized? If not, maybe it would be better to triple the timeout and run the waits in parallel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants