From 52ded96b6dfb47554be946f693059f6534dfe5fa Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 1 Jan 2022 17:03:31 +0000 Subject: [PATCH] move verilator tick() to correct location, and increase memory size --- verilator/microwatt-verilator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/verilator/microwatt-verilator.cpp b/verilator/microwatt-verilator.cpp index dbdee92..324dc52 100644 --- a/verilator/microwatt-verilator.cpp +++ b/verilator/microwatt-verilator.cpp @@ -119,8 +119,9 @@ int main(int argc, char **argv) close(fd); // allocate more memory than is in the file, copy it over - size_t sz = 0x2000000; + size_t sz = 0x20000000; mem = (unsigned char*)malloc(sz); + memset(mem, sz, 0); memcpy(mem, fmem, statbuf.st_size); munmap(fmem, statbuf.st_size); } @@ -155,7 +156,6 @@ int main(int argc, char **argv) unsigned long long bram_do = 0; while(!Verilated::gotFinish()) { - tick(top); // read/write the memory to/from the mmap'd file (if given) if (mem != NULL) { @@ -168,6 +168,8 @@ int main(int argc, char **argv) } } + tick(top); + uart_tx(top->uart0_txd); top->uart0_rxd = uart_rx(); -- 2.30.2