[sw] Add spi_host_tx_rx_test
Add a basic spi host tx rx test.
This test uses the spi_agent's native "loopback" behavior.
The spi agent, when in device mode, by default just plays
back whatever data is sent to it by the host.
The test prepares a random payload, sends it to the device agent,
and just reads back to make sure the data is matched.
This test DOES NOT do any kind of flash protocol checking.
- Add a device value for high speed peripehral clock
- Add a minor fix for dif_spi_host clock divider setting
Signed-off-by: Timothy Chen <timothytim@google.com>
[sw] test updates
- update spi_host_tx_rx_test
- minor fix for spi_host clock divider
Signed-off-by: Timothy Chen <timothytim@google.com>
[dv] Add test sequence
- updates to testplan
- add if_mode setup into chip_base_test
Signed-off-by: Timothy Chen <timothytim@google.com>
[top/dv] Minor updates
Signed-off-by: Timothy Chen <timothytim@google.com>
[top/dv] spi_host configuration fix
spi host does not support outputting at 1:1 frequencies.
Signed-off-by: Timothy Chen <timothytim@google.com>
[top/dv] Various updates for spi_host testing
- integrate with latest chip_if
- add support for multiple spi_device agents
- add enum to access pad pull-up attributes
Signed-off-by: Timothy Chen <timothytim@google.com>
diff --git a/hw/top_earlgrey/dv/tests/chip_base_test.sv b/hw/top_earlgrey/dv/tests/chip_base_test.sv
index d1eeae7..07e75b1 100644
--- a/hw/top_earlgrey/dv/tests/chip_base_test.sv
+++ b/hw/top_earlgrey/dv/tests/chip_base_test.sv
@@ -45,6 +45,12 @@
cfg.m_uart_agent_cfgs[0].en_logger = cfg.en_uart_logger;
cfg.m_uart_agent_cfgs[0].write_logs_to_file = cfg.write_sw_logs_to_file;
+ // all the spi_agents talking to the host interface should be configured into
+ // device mode
+ foreach (cfg.m_spi_device_agent_cfgs[i]) begin
+ cfg.m_spi_device_agent_cfgs[i].if_mode = dv_utils_pkg::Device;
+ end
+
// Knob to set the sw_test_timeout_ns (set to 12ms by default).
void'($value$plusargs("sw_test_timeout_ns=%0d", cfg.sw_test_timeout_ns));