[verilator] Add verilator top module
#include <fstream>
#include <iostream>
-#include "ibex_pcounts.h"
#include "verilated_toplevel.h"
#include "verilator_memutil.h"
#include "verilator_sim_ctrl.h"
int main(int argc, char **argv) {
- ibex_simple_system top;
+ mempool_tb_verilator top;
VerilatorMemUtil memutil;
VerilatorSimCtrl &simctrl = VerilatorSimCtrl::GetInstance();
- simctrl.SetTop(&top, &top.IO_CLK, &top.IO_RST_N,
+ simctrl.SetTop(&top, &top.clk_i, &top.rst_ni,
VerilatorSimCtrlFlags::ResetPolarityNegative);
memutil.RegisterMemoryArea(
- "ram", "TOP.ibex_simple_system.u_ram.u_ram.gen_generic.u_impl_generic");
+ "ram", "TOP.mempool_tb_verilator.dut.l2_mem");
simctrl.RegisterExtension(&memutil);
bool exit_app = false;
@@ -27,8 +26,8 @@ int main(int argc, char **argv) {
return ret_code;
}
- std::cout << "Simulation of Ibex" << std::endl
- << "==================" << std::endl
+ std::cout << "Simulation of MemPool" << std::endl
+ << "=====================" << std::endl
<< std::endl;
simctrl.RunSimulation();
@@ -37,17 +36,5 @@ int main(int argc, char **argv) {
return 1;
}
- // Set the scope to the root scope, the ibex_pcount_string function otherwise
- // doesn't know the scope itself. Could be moved to ibex_pcount_string, but
- // would require a way to set the scope name from here, similar to MemUtil.
- svSetScope(svGetScopeFromName("TOP.ibex_simple_system"));
-
- std::cout << "\nPerformance Counters" << std::endl
- << "====================" << std::endl;
- std::cout << ibex_pcount_string(false);
-
- std::ofstream pcount_csv("ibex_simple_system_pcount.csv");
- pcount_csv << ibex_pcount_string(true);
-
return 0;
}
