mirror of
https://github.com/stnolting/neorv32.git
synced 2025-04-23 13:47:33 -04:00
[sw/cpu_test] added test to estimate bus timeout latency
This commit is contained in:
parent
326444380a
commit
d0c5385d8a
1 changed files with 21 additions and 1 deletions
|
@ -240,7 +240,7 @@ int main() {
|
|||
#if (PROBING_MEM_TEST == 1)
|
||||
cnt_test++;
|
||||
|
||||
register uint32_t imem_probe_addr =SYSINFO_DSPACE_BASE;
|
||||
register uint32_t imem_probe_addr = SYSINFO_DSPACE_BASE;
|
||||
uint32_t imem_probe_cnt = 0;
|
||||
|
||||
while(1) {
|
||||
|
@ -265,6 +265,26 @@ int main() {
|
|||
#endif
|
||||
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// Bus timeout latency estimation
|
||||
// ----------------------------------------------------------
|
||||
exception_handler_answer = 0xFFFFFFFF;
|
||||
neorv32_uart_printf("BUS TIMEOUT: ");
|
||||
|
||||
// start timing
|
||||
tmp_a = neorv32_cpu_csr_read(CSR_CYCLE);
|
||||
|
||||
// this will timeout
|
||||
MMR_UNREACHABLE = 0;
|
||||
|
||||
// wait for timeout
|
||||
while (exception_handler_answer == 0xFFFFFFFF);
|
||||
|
||||
tmp_a = neorv32_cpu_csr_read(CSR_CYCLE) - tmp_a;
|
||||
tmp_a = tmp_a / 4; // divide by average CPI
|
||||
neorv32_uart_printf("~%u cycles\n", tmp_a);
|
||||
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// External memory interface test
|
||||
// ----------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue