📄 main_net_8x8.cpp
字号:
/* * TU Eindhoven * Eindhoven, The Netherlands * * Name : * * Author : A.S.Slusarczyk@tue.nl * * Date : * * Function : * *///#define NOVCD//#define CACHE//#define MIPSVCD//#define MEMVCD//#define ROUTERVCD#include "netmips.h"#include "router.h"//#include "_network2x2.h"#include "_network8x8.h"#include "mips_trace.h"#ifdef MEM_DBG#include "dbg_mem.h"#endif#include <time.h>sc_signal<bool> clk;unsigned sim_time = 0, period = 10;int sc_main(int argc, char *argv[]){ char stbuf[1024]; sc_signal< bool > rst, en; sc_trace_file *tf; tf = sc_create_vcd_trace_file("mips"); //#include "_network2x2.cpp"#include "_network8x8.cpp"#ifdef MEM_DBG // dbg_mem_init( dp_x0y0.mips, dp_x0y1.mips, dp_x1y0.mips, dp_x1y1.mips ); dbg_mem_init( dp_x0y0.mips, dp_x0y1.mips, dp_x0y2.mips, dp_x0y3.mips, dp_x0y4.mips, dp_x0y5.mips, dp_x0y6.mips, dp_x0y7.mips, dp_x1y0.mips, dp_x1y1.mips, dp_x1y2.mips, dp_x1y3.mips, dp_x1y4.mips, dp_x1y5.mips, dp_x1y6.mips, dp_x1y7.mips, dp_x2y0.mips, dp_x2y1.mips, dp_x2y2.mips, dp_x2y3.mips, dp_x2y4.mips, dp_x2y5.mips, dp_x2y6.mips, dp_x2y7.mips, dp_x3y0.mips, dp_x3y1.mips, dp_x3y2.mips, dp_x3y3.mips, dp_x3y4.mips, dp_x3y5.mips, dp_x3y6.mips, dp_x3y7.mips, dp_x4y0.mips, dp_x4y1.mips, dp_x4y2.mips, dp_x4y3.mips, dp_x4y4.mips, dp_x4y5.mips, dp_x4y6.mips, dp_x4y7.mips, dp_x5y0.mips, dp_x5y1.mips, dp_x5y2.mips, dp_x5y3.mips, dp_x5y4.mips, dp_x5y5.mips, dp_x5y6.mips, dp_x5y7.mips, dp_x6y0.mips, dp_x6y1.mips, dp_x6y2.mips, dp_x6y3.mips, dp_x6y4.mips, dp_x6y5.mips, dp_x6y6.mips, dp_x6y7.mips, dp_x7y0.mips, dp_x7y1.mips, dp_x7y2.mips, dp_x7y3.mips, dp_x7y4.mips, dp_x7y5.mips, dp_x7y6.mips, dp_x7y7.mips);#endif sc_initialize(); clk = 0; rst = 1; en = 0; sc_cycle(period/2); clk = 1; sc_cycle(period/2); rst = 0; clk = 0; sc_cycle(period/2); en = 1; /* * Simulate program execution */ int max_time = 0; if (argc == 2) max_time = atoi(argv[1]); if (max_time == 0) max_time = 500; bool e00=false,e01=false,e02=false,e03=false,e04=false,e05=false,e06=false,e07=false, e10=false,e11=false,e12=false,e13=false,e14=false,e15=false,e16=false,e17=false, e20=false,e21=false,e22=false,e23=false,e24=false,e25=false,e26=false,e27=false, e30=false,e31=false,e32=false,e33=false,e34=false,e35=false,e36=false,e37=false, e40=false,e41=false,e42=false,e43=false,e44=false,e45=false,e46=false,e47=false, e50=false,e51=false,e52=false,e53=false,e54=false,e55=false,e56=false,e57=false, e60=false,e61=false,e62=false,e63=false,e64=false,e65=false,e66=false,e67=false, e70=false,e71=false,e72=false,e73=false,e74=false,e75=false,e76=false,e77=false; int dump_time = time(0); while( max_time < 0 || sim_time < (unsigned)max_time ) { clk = 0; sc_cycle(period/2); clk = 1; sc_cycle(period/2); sim_time += period; if( sim_time % 10000 == 0 ){ cout << dec << sim_time << '/' << max_time << " @ " << sc_time_stamp() << " PC:"; hack_pc(); } if(!e00 && dp_x0y0_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x0y0 @ " << sc_time_stamp() << endl; e00 = true; } if(!e01 && dp_x0y1_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x0y1 @ " << sc_time_stamp() << endl; e01 = true; } if(!e02 && dp_x0y2_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x0y2 @ " << sc_time_stamp() << endl; e02 = true; } if(!e03 && dp_x0y3_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x0y3 @ " << sc_time_stamp() << endl; e03 = true; } if(!e04 && dp_x0y4_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x0y4 @ " << sc_time_stamp() << endl; e04 = true; } if(!e05 && dp_x0y5_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x0y5 @ " << sc_time_stamp() << endl; e05 = true; } if(!e06 && dp_x0y6_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x0y6 @ " << sc_time_stamp() << endl; e06 = true; } if(!e07 && dp_x0y7_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x0y7 @ " << sc_time_stamp() << endl; e07 = true; } if(!e10 && dp_x1y0_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x1y0 @ " << sc_time_stamp() << endl; e10 = true; } if(!e11 && dp_x1y1_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x1y1 @ " << sc_time_stamp() << endl; e11 = true; } if(!e12 && dp_x1y2_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x1y2 @ " << sc_time_stamp() << endl; e12 = true; } if(!e13 && dp_x1y3_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x1y3 @ " << sc_time_stamp() << endl; e13 = true; } if(!e14 && dp_x1y4_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x1y4 @ " << sc_time_stamp() << endl; e14 = true; } if(!e15 && dp_x1y5_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x1y5 @ " << sc_time_stamp() << endl; e15 = true; } if(!e16 && dp_x1y6_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x1y6 @ " << sc_time_stamp() << endl; e16 = true; } if(!e17 && dp_x1y7_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x1y7 @ " << sc_time_stamp() << endl; e17 = true; } if(!e20 && dp_x2y0_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x2y0 @ " << sc_time_stamp() << endl; e20 = true; } if(!e21 && dp_x2y1_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x2y1 @ " << sc_time_stamp() << endl; e21 = true; } if(!e22 && dp_x2y2_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x2y2 @ " << sc_time_stamp() << endl; e22 = true; } if(!e23 && dp_x2y3_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x2y3 @ " << sc_time_stamp() << endl; e23 = true; } if(!e24 && dp_x2y4_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x2y4 @ " << sc_time_stamp() << endl; e24 = true; } if(!e25 && dp_x2y5_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x2y5 @ " << sc_time_stamp() << endl; e25 = true; } if(!e26 && dp_x2y6_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x2y6 @ " << sc_time_stamp() << endl; e26 = true; } if(!e27 && dp_x2y7_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x2y7 @ " << sc_time_stamp() << endl; e27 = true; } if(!e30 && dp_x3y0_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x3y0 @ " << sc_time_stamp() << endl; e30 = true; } if(!e31 && dp_x3y1_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x3y1 @ " << sc_time_stamp() << endl; e31 = true; } if(!e32 && dp_x3y2_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x3y2 @ " << sc_time_stamp() << endl; e32 = true; } if(!e33 && dp_x3y3_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x3y3 @ " << sc_time_stamp() << endl; e33 = true; } if(!e34 && dp_x3y4_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x3y4 @ " << sc_time_stamp() << endl; e34 = true; } if(!e35 && dp_x3y5_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x3y5 @ " << sc_time_stamp() << endl; e35 = true; } if(!e36 && dp_x3y6_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x3y6 @ " << sc_time_stamp() << endl; e36 = true; } if(!e37 && dp_x3y7_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x3y7 @ " << sc_time_stamp() << endl; e37 = true; } if(!e40 && dp_x4y0_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x4y0 @ " << sc_time_stamp() << endl; e40 = true; } if(!e41 && dp_x4y1_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x4y1 @ " << sc_time_stamp() << endl; e41 = true; } if(!e42 && dp_x4y2_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x4y2 @ " << sc_time_stamp() << endl; e42 = true; } if(!e43 && dp_x4y3_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x4y3 @ " << sc_time_stamp() << endl; e43 = true; } if(!e44 && dp_x4y4_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x4y4 @ " << sc_time_stamp() << endl; e44 = true; } if(!e45 && dp_x4y5_pc.read().to_unit() == 0x28 ) { cout << "FINISHED x4y5 @ " << sc_time_stamp() << endl;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -