diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-09-24 23:39:17 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-09-24 23:39:17 -0600 |
| commit | d4d9f5296b193f80ee7fc2e42e52d974249d09e0 (patch) | |
| tree | baa99636a2b40882af4cdd253162c9ac2f5f14d3 /tb/top | |
| parent | 15230c6cd2190a1efd61c2758bf56de37f3fe8da (diff) | |
tb: implement support for cache line-sized slaves
Diffstat (limited to '')
| -rw-r--r-- | tb/top/conspiracion.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tb/top/conspiracion.cpp b/tb/top/conspiracion.cpp index 0286cfc..ea71dbe 100644 --- a/tb/top/conspiracion.cpp +++ b/tb/top/conspiracion.cpp @@ -299,7 +299,7 @@ int main(int argc, char **argv) trace.open("trace.vcd"); } - mem<std::uint32_t> hps_ddr3(0x0000'0000, 512 << 20); + mem hps_ddr3(0x0000'0000, 512 << 20); jtag_uart ttyJ0(0x3000'0000); interval_timer timer(0x3002'0000); interrupt_controller intc(0x3007'0000); @@ -308,7 +308,7 @@ int main(int argc, char **argv) irq_lines.jtaguart = &ttyJ0; irq_lines.timer = &timer; - mem<std::uint32_t> vram(0x3800'0000, 64 << 20); + mem vram(0x3800'0000, 64 << 20); null vram_null(0x3800'0000, 64 << 20, 2); window vram_window(vram, 0x0000'0000); @@ -355,13 +355,13 @@ int main(int argc, char **argv) FILE *img_file = std::fopen(image->c_str(), "rb"); if(!img_file) { - std::perror("fopen()"); + std::fprintf(stderr, "fopen(\"%s\"): %m\n", image->c_str()); return EXIT_FAILURE; } - hps_ddr3.load([&](std::uint32_t *buffer, std::size_t words) + hps_ddr3.load([&](line *buffer, std::size_t lines) { - return std::fread(buffer, 4, words, img_file); + return std::fread(buffer, sizeof *buffer, lines, img_file); }); std::fclose(img_file); @@ -371,13 +371,13 @@ int main(int argc, char **argv) FILE *img_file = std::fopen(load.filename.c_str(), "rb"); if(!img_file) { - std::perror("fopen()"); + std::fprintf(stderr, "fopen(\"%s\"): %m\n", load.filename.c_str()); return EXIT_FAILURE; } - hps_ddr3.load([&](std::uint32_t *buffer, std::size_t words) + hps_ddr3.load([&](line *buffer, std::size_t lines) { - return std::fread(buffer, 4, words, img_file); + return std::fread(buffer, sizeof *buffer, lines, img_file); }, load.addr); std::fclose(img_file); |
