diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-11-14 21:10:40 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-11-14 21:10:40 -0600 |
| commit | 6fb3849e73b797d4610a2b782127f927dec0c9c9 (patch) | |
| tree | 9d17de8907d860b795761e0644f17d0fd33106de /tb/top/conspiracion.cpp | |
| parent | cad870295dfb741d5c24c25016c5bba878bc37e5 (diff) | |
Implement VGA simulation
Diffstat (limited to 'tb/top/conspiracion.cpp')
| -rw-r--r-- | tb/top/conspiracion.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/tb/top/conspiracion.cpp b/tb/top/conspiracion.cpp index ef9235d..2840b15 100644 --- a/tb/top/conspiracion.cpp +++ b/tb/top/conspiracion.cpp @@ -12,6 +12,7 @@ #include "Vconspiracion_arm810.h" #include "Vconspiracion_conspiracion.h" #include "Vconspiracion_platform.h" +#include "Vconspiracion_vga_domain.h" #include "Vconspiracion_core_control.h" #include "Vconspiracion_core_psr.h" #include "Vconspiracion_core_regs.h" @@ -21,6 +22,9 @@ #include "../avalon.hpp" #include "../mem.hpp" +#include "../null.hpp" +#include "../window.hpp" +#include "../vga.hpp" namespace { @@ -113,6 +117,7 @@ namespace int main(int argc, char **argv) { using namespace taller::avalon; + using namespace taller::vga; Verilated::commandArgs(argc, argv); @@ -138,6 +143,11 @@ int main(int argc, char **argv) parser, "dump-regs", "Dump all registers", {"dump-regs"} ); + args::Flag headless + ( + parser, "headless", "Disable video output", {"headless"} + ); + args::ValueFlag<unsigned> cycles ( parser, "cycles", "Number of core cycles to run", {"cycles"}, 256 @@ -184,10 +194,27 @@ int main(int argc, char **argv) } interconnect<Vconspiracion_platform> avl(*top.conspiracion->plat); - mem hps_ddr3(0x0000'0000, 512 << 20); + interconnect<Vconspiracion_vga_domain> avl_vga(*top.conspiracion->plat->vga); + + mem<std::uint32_t> hps_ddr3(0x0000'0000, 512 << 20); + mem<std::uint16_t> vram(0x3800'0000, 64 << 20); + null vram_null(0x3800'0000, 64 << 20, 2); + window vram_window(vram, 0x0000'0000); + display<Vconspiracion_vga_domain> vga(*top.conspiracion->plat->vga, 25'175'000); + + bool enable_video = !headless; avl.attach(hps_ddr3); + if(enable_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) { @@ -216,7 +243,13 @@ int main(int argc, char **argv) { top.clk_clk = !top.clk_clk; top.eval(); + avl.tick(top.clk_clk); + if(enable_video) + { + avl_vga.tick(top.clk_clk); + vga.tick(top.clk_clk); + } if(enable_trace) { |
