diff options
Diffstat (limited to 'tb/top')
| -rw-r--r-- | tb/top/conspiracion.cpp | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/tb/top/conspiracion.cpp b/tb/top/conspiracion.cpp index e28fcfc..00a672e 100644 --- a/tb/top/conspiracion.cpp +++ b/tb/top/conspiracion.cpp @@ -17,6 +17,7 @@ #include "Vconspiracion_arm810.h" #include "Vconspiracion_conspiracion.h" #include "Vconspiracion_platform.h" +#include "Vconspiracion_sim_slave.h" #include "Vconspiracion_vga_domain.h" #include "Vconspiracion_core.h" #include "Vconspiracion_core_control.h" @@ -44,6 +45,7 @@ #include "../jtag_uart.hpp" #include "../interval_timer.hpp" #include "../null.hpp" +#include "../sim_slave.hpp" #include "../window.hpp" #include "../vga.hpp" @@ -331,6 +333,12 @@ int main(int argc, char **argv) *plat.vga, 0x3800'0000, 25'175'000, 50'000'000 ); + sim_slave dbg_0(*plat.smp_dbg_0, 0x3010'0000, 32); + sim_slave dbg_1(*plat.smp_dbg_1, 0x3011'0000, 32); + sim_slave dbg_2(*plat.smp_dbg_2, 0x3012'0000, 32); + sim_slave dbg_3(*plat.smp_dbg_3, 0x3013'0000, 32); + sim_slave smp_ctrl(*plat.smp_sim, 0x3014'0000, 4); + interconnect<Vconspiracion_platform> avl(plat); //interconnect<Vconspiracion_vga_domain> avl_vga(plat->vga); @@ -346,24 +354,23 @@ int main(int argc, char **argv) avl.attach(hps_ddr3); avl.attach(timer); avl.attach(ttyJ0); + avl.attach(dbg_0); + avl.attach(dbg_1); + avl.attach(dbg_2); + avl.attach(dbg_3); + avl.attach(smp_ctrl); avl.attach_intc(intc); - for(auto &slave : consts) - { + for (auto &slave : consts) avl.attach(slave); - } - if(enable_fast_video) - { + if (enable_fast_video) avl.attach(vga); - } else if(enable_accurate_video) - { + else if(enable_accurate_video) { avl.attach(vram); //avl_vga.attach(vram_window); } else - { avl.attach(vram_null); - } FILE *img_file = std::fopen(image->c_str(), "rb"); if(!img_file) @@ -464,11 +471,12 @@ int main(int argc, char **argv) core->step__VforceVal = 1; } - cores[0]->halt__VforceEn = start_halted; top.rst_n = 0; cycle(); top.rst_n = 1; + cores[0]->halt__VforceEn = static_cast<bool>(start_halted); + auto do_reg_dump = [&]() { std::fputs("=== dump-regs ===\n", ctrl); @@ -506,8 +514,8 @@ int main(int argc, char **argv) if (!ok || (ok >> 29)) return ok; - unsigned tag = (addr >> 11) & ((1 << 16) - 1); - unsigned index = (addr >> 2) & ((1 << 9) - 1); + unsigned tag = (addr >> 14) & ((1 << 13) - 1); + unsigned index = (addr >> 2) & ((1 << 12) - 1); for (std::size_t i = 0; i < sizeof caches / sizeof caches[0]; ++i) { const auto *cache = caches[i]; @@ -632,14 +640,16 @@ int main(int argc, char **argv) unsigned i = 0; auto loop_accurate = [&]() { + bool exit_loop = false; + do { cycle(); - maybe_halt(); - for (const auto *core : cores) - if (core->halted) - break; - } while (!failed && (*cycles == 0 || ++i < *cycles)); + if (maybe_halt()) + for (const auto *core : cores) + if (core->halted) + exit_loop = true; + } while (!exit_loop && !failed && (*cycles == 0 || ++i < *cycles)); }; const bool slow_path = *cycles > 0 || enable_accurate_video || enable_trace; |
