[verilator] Minor verilator updates to reflect clock division - this change is temporary, need to split into different clocks Signed-off-by: Timothy Chen <timothytim@google.com> [sw] Minor updates to software to pass tests - Increase dif_rv_timer_sanity_test deadline since each tick now counts 4x. Without increasing the deadline, the interrupt fires in the middle of a uart print and the test never completes. Signed-off-by: Timothy Chen <timothytim@google.com> [verilator, sw] update for verilator frequency change Signed-off-by: Timothy Chen <timothytim@google.com>
diff --git a/hw/top_earlgrey/rtl/top_earlgrey_verilator.sv b/hw/top_earlgrey/rtl/top_earlgrey_verilator.sv index 8642694..6a1d940 100644 --- a/hw/top_earlgrey/rtl/top_earlgrey_verilator.sv +++ b/hw/top_earlgrey/rtl/top_earlgrey_verilator.sv
@@ -150,7 +150,7 @@ // Both baud rate and frequency must match the settings used in the on-chip // software. uartdpi #( - .BAUD('d9_600), + .BAUD('d7_200), .FREQ('d500_000) ) u_uart ( .clk_i (clk_i),
diff --git a/sw/device/lib/arch/device_sim_verilator.c b/sw/device/lib/arch/device_sim_verilator.c index c98f462..859d048 100644 --- a/sw/device/lib/arch/device_sim_verilator.c +++ b/sw/device/lib/arch/device_sim_verilator.c
@@ -13,11 +13,11 @@ const uint64_t kClockFreqCpuHz = 500 * 1000; // 500kHz -const uint64_t kClockFreqPeripheralHz = 500 * 1000; // 500kHz +const uint64_t kClockFreqPeripheralHz = 125 * 1000; // 125kHz const uint64_t kClockFreqUsbHz = 500 * 1000; // 500kHz -const uint64_t kUartBaudrate = 9600; +const uint64_t kUartBaudrate = 7200; // Defined in `hw/top_earlgrey/top_earlgrey_verilator.core` const uintptr_t kDeviceStopAddress = 0x10008000;
diff --git a/sw/device/tests/dif/dif_rv_timer_sanitytest.c b/sw/device/tests/dif/dif_rv_timer_sanitytest.c index 93d1cff..9bbe94a 100644 --- a/sw/device/tests/dif/dif_rv_timer_sanitytest.c +++ b/sw/device/tests/dif/dif_rv_timer_sanitytest.c
@@ -86,8 +86,8 @@ CHECK(dif_rv_timer_counter_set_enabled(&timer, kHart, kDifRvTimerEnabled) == kDifRvTimerOk); + LOG_INFO("Waiting..."); while (!irq_fired) { - LOG_INFO("Waiting..."); wait_for_interrupt(); }