Changeset 46 for trunk/platforms/caba-xxx-ccxcachemulti-mipsel/top.cpp
- Timestamp:
- Jun 8, 2010, 5:38:47 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/caba-xxx-ccxcachemulti-mipsel/top.cpp
r3 r46 44 44 maptabp.add(Segment("mc_r" , MC_R_BASE , MC_R_SIZE , IntTab(2), false, true, IntTab(0))); 45 45 maptabp.add(Segment("mc_m" , MC_M_BASE , MC_M_SIZE , IntTab(2), true )); 46 maptabp.add(Segment("ptba" , PTD_ADDR , TAB_SIZE, IntTab(2), true));46 maptabp.add(Segment("ptba" , PTD_ADDR , TAB_SIZE , IntTab(2), true)); 47 47 48 48 std::cout << maptabp << std::endl; … … 105 105 soclib::caba::VciSignals<vci_param> signal_vci_ini_d_proc0("vci_ini_d_proc0"); 106 106 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc0("vci_ini_c_proc0"); 107 soclib::caba::VciSignals<vci_param> signal_vci_tgt_ proc0("vci_tgt_proc0");107 soclib::caba::VciSignals<vci_param> signal_vci_tgt_c_proc0("vci_tgt_proc0"); 108 108 109 109 soclib::caba::VciSignals<vci_param> signal_vci_ini_d_proc1("vci_ini_d_proc1"); 110 110 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc1("vci_ini_c_proc1"); 111 soclib::caba::VciSignals<vci_param> signal_vci_tgt_ proc1("vci_tgt_proc1");111 soclib::caba::VciSignals<vci_param> signal_vci_tgt_c_proc1("vci_tgt_proc1"); 112 112 113 113 soclib::caba::VciSignals<vci_param> signal_vci_ini_d_proc2("vci_ini_d_proc2"); 114 114 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc2("vci_ini_c_proc2"); 115 soclib::caba::VciSignals<vci_param> signal_vci_tgt_ proc2("vci_tgt_proc2");115 soclib::caba::VciSignals<vci_param> signal_vci_tgt_c_proc2("vci_tgt_proc2"); 116 116 117 117 soclib::caba::VciSignals<vci_param> signal_vci_ini_d_proc3("vci_ini_d_proc3"); 118 118 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc3("vci_ini_c_proc3"); 119 soclib::caba::VciSignals<vci_param> signal_vci_tgt_ proc3("vci_tgt_proc3");119 soclib::caba::VciSignals<vci_param> signal_vci_tgt_c_proc3("vci_tgt_proc3"); 120 120 121 121 soclib::caba::VciSignals<vci_param> signal_vci_tgt_tty("vci_tgt_tty"); … … 127 127 soclib::caba::VciSignals<vci_param> signal_vci_ixr_memc("vci_ixr_memc"); 128 128 soclib::caba::VciSignals<vci_param> signal_vci_ini_memc("vci_ini_memc"); 129 soclib::caba::VciSignals<vci_param> signal_vci_tgt_ memc("vci_tgt_memc");130 soclib::caba::VciSignals<vci_param> signal_vci_tgt_c leanup_memc("vci_tgt_cleanup_memc");129 soclib::caba::VciSignals<vci_param> signal_vci_tgt_d_memc("vci_tgt_memc"); 130 soclib::caba::VciSignals<vci_param> signal_vci_tgt_c_memc("vci_tgt_cleanup_memc"); 131 131 132 132 sc_signal<bool> signal_tty_irq0("signal_tty_irq0"); … … 141 141 // Components 142 142 soclib::caba::VciCcXCacheWrapperMulti<vci_param, proc_iss > 143 proc0("proc0", 0, maptabp, maptabc, IntTab(0),IntTab(0),IntTab(0),1,8,16,1,8,16,4,8 );143 proc0("proc0", 0, maptabp, maptabc, IntTab(0),IntTab(0),IntTab(0),1,8,16,1,8,16,4,8,16); 144 144 145 145 soclib::caba::VciCcXCacheWrapperMulti<vci_param, proc_iss > 146 proc1("proc1", 1, maptabp, maptabc, IntTab(1),IntTab(1),IntTab(1),1,8,16,1,8,16,4,8 );146 proc1("proc1", 1, maptabp, maptabc, IntTab(1),IntTab(1),IntTab(1),1,8,16,1,8,16,4,8,16); 147 147 148 148 soclib::caba::VciCcXCacheWrapperMulti<vci_param, proc_iss > 149 proc2("proc2", 2, maptabp, maptabc, IntTab(2),IntTab(2),IntTab(2),1,8,16,1,8,16,4,8 );149 proc2("proc2", 2, maptabp, maptabc, IntTab(2),IntTab(2),IntTab(2),1,8,16,1,8,16,4,8,16); 150 150 151 151 soclib::caba::VciCcXCacheWrapperMulti<vci_param, proc_iss > 152 proc3("proc3", 3, maptabp, maptabc, IntTab(3),IntTab(3),IntTab(3),1,8,16,1,8,16,4,8 );152 proc3("proc3", 3, maptabp, maptabc, IntTab(3),IntTab(3),IntTab(3),1,8,16,1,8,16,4,8,16); 153 153 154 154 soclib::caba::VciSimpleRam<vci_param> … … 203 203 proc0.p_vci_ini_d(signal_vci_ini_d_proc0); 204 204 proc0.p_vci_ini_c(signal_vci_ini_c_proc0); 205 proc0.p_vci_tgt_c(signal_vci_tgt_ proc0);205 proc0.p_vci_tgt_c(signal_vci_tgt_c_proc0); 206 206 207 207 proc1.p_clk(signal_clk); … … 215 215 proc1.p_vci_ini_d(signal_vci_ini_d_proc1); 216 216 proc1.p_vci_ini_c(signal_vci_ini_c_proc1); 217 proc1.p_vci_tgt_c(signal_vci_tgt_ proc1);217 proc1.p_vci_tgt_c(signal_vci_tgt_c_proc1); 218 218 219 219 proc2.p_clk(signal_clk); … … 227 227 proc2.p_vci_ini_d(signal_vci_ini_d_proc2); 228 228 proc2.p_vci_ini_c(signal_vci_ini_c_proc2); 229 proc2.p_vci_tgt_c(signal_vci_tgt_ proc2);229 proc2.p_vci_tgt_c(signal_vci_tgt_c_proc2); 230 230 231 231 proc3.p_clk(signal_clk); … … 239 239 proc3.p_vci_ini_d(signal_vci_ini_d_proc3); 240 240 proc3.p_vci_ini_c(signal_vci_ini_c_proc3); 241 proc3.p_vci_tgt_c(signal_vci_tgt_ proc3);241 proc3.p_vci_tgt_c(signal_vci_tgt_c_proc3); 242 242 243 243 rom.p_clk(signal_clk); 244 244 rom.p_resetn(signal_resetn); 245 245 rom.p_vci(signal_vci_tgt_rom); 246 247 // vci_logger_proc0.p_clk(signal_clk);248 // vci_logger_proc0.p_resetn(signal_resetn);249 // vci_logger_proc0.p_vci(signal_vci_ini_d_proc0);250 251 // vci_logger_proc1.p_clk(signal_clk);252 // vci_logger_proc1.p_resetn(signal_resetn);253 // vci_logger_proc1.p_vci(signal_vci_ini_d_proc2);254 255 // vci_logger_proc2.p_clk(signal_clk);256 // vci_logger_proc2.p_resetn(signal_resetn);257 // vci_logger_proc2.p_vci(signal_vci_ini_d_proc2);258 259 // vci_logger_proc3.p_clk(signal_clk);260 // vci_logger_proc3.p_resetn(signal_resetn);261 // vci_logger_proc3.p_vci(signal_vci_ini_d_proc3);262 263 // vci_logger_memc.p_clk(signal_clk);264 // vci_logger_memc.p_resetn(signal_resetn);265 // vci_logger_memc.p_vci(signal_vci_tgt_memc);266 246 267 247 tty.p_clk(signal_clk); … … 275 255 memc.p_clk(signal_clk); 276 256 memc.p_resetn(signal_resetn); 277 memc.p_vci_tgt(signal_vci_tgt_ memc);278 memc.p_vci_tgt_cleanup(signal_vci_tgt_c leanup_memc);257 memc.p_vci_tgt(signal_vci_tgt_d_memc); 258 memc.p_vci_tgt_cleanup(signal_vci_tgt_c_memc); 279 259 memc.p_vci_ini(signal_vci_ini_memc); 280 260 memc.p_vci_ixr(signal_vci_ixr_memc); … … 292 272 ringd.p_to_target[0](signal_vci_tgt_rom); 293 273 ringd.p_to_target[1](signal_vci_tgt_tty); 294 ringd.p_to_target[2](signal_vci_tgt_ memc);274 ringd.p_to_target[2](signal_vci_tgt_d_memc); 295 275 296 276 ringc.p_clk(signal_clk); … … 301 281 ringc.p_to_initiator[3](signal_vci_ini_c_proc3); 302 282 ringc.p_to_initiator[4](signal_vci_ini_memc); 303 ringc.p_to_target[0](signal_vci_tgt_ proc0);304 ringc.p_to_target[1](signal_vci_tgt_ proc1);305 ringc.p_to_target[2](signal_vci_tgt_ proc2);306 ringc.p_to_target[3](signal_vci_tgt_ proc3);307 ringc.p_to_target[4](signal_vci_tgt_c leanup_memc);283 ringc.p_to_target[0](signal_vci_tgt_c_proc0); 284 ringc.p_to_target[1](signal_vci_tgt_c_proc1); 285 ringc.p_to_target[2](signal_vci_tgt_c_proc2); 286 ringc.p_to_target[3](signal_vci_tgt_c_proc3); 287 ringc.p_to_target[4](signal_vci_tgt_c_memc); 308 288 309 289 ringx.p_clk(signal_clk); … … 312 292 ringx.p_to_target[0](signal_vci_tgt_xram); 313 293 314 int ncycles; 315 316 #ifndef SOCVIEW 294 int ncycles = 1000000000; 295 317 296 if (argc == 2) { 318 297 ncycles = std::atoi(argv[1]); 319 } else {320 std::cerr321 << std::endl322 << "The number of simulation cycles must "323 "be defined in the command line"324 << std::endl;325 exit(1);326 298 } 327 299 … … 335 307 for (int i = 0; i < ncycles ; i++) 336 308 { 337 sc_start(sc_core::sc_time(1, SC_NS));338 309 if ( i%10000 == 0 ) 339 310 { 340 proc0.print _stats();341 proc1.print _stats();342 proc2.print _stats();343 proc3.print _stats();311 proc0.printStatistics(); 312 proc1.printStatistics(); 313 proc2.printStatistics(); 314 proc3.printStatistics(); 344 315 memc.print_stats(); 345 316 } 317 /* 318 319 std::cout << "***************************************** cycle = " << std::dec << i 320 << " *************************************************" << std::endl; 321 proc0.printTrace(0); 322 proc1.printTrace(0); 323 proc2.printTrace(0); 324 proc3.printTrace(0); 325 std::cout << " proc0.cmdval = " << signal_vci_ini_c_proc0.cmdval << std::endl; 326 std::cout << " proc0.cmdack = " << signal_vci_ini_c_proc0.cmdack << std::endl; 327 std::cout << " proc0.address = " << signal_vci_ini_c_proc0.address << std::endl; 328 std::cout << " proc0.wdata = " << signal_vci_ini_c_proc0.wdata << std::endl; 329 std::cout << " proc0.eop = " << signal_vci_ini_c_proc0.eop << std::endl; 330 std::cout << " proc0.len = " << signal_vci_ini_c_proc0.plen << std::endl; 331 std::cout << " proc0.rspval = " << signal_vci_ini_c_proc0.rspval << std::endl; 332 std::cout << " proc0.rspack = " << signal_vci_ini_c_proc0.rspack << std::endl; 333 std::cout << " proc0.reop = " << signal_vci_ini_c_proc0.reop << std::endl; 334 std::cout << " proc0.rdata = " << signal_vci_ini_c_proc0.rdata << std::endl; 335 std::cout << " proc0.rerror = " << signal_vci_ini_c_proc0.rerror << std::endl; 336 std::cout << " memc.cmdval = " << signal_vci_tgt_c_memc.cmdval << std::endl; 337 std::cout << " memc.cmdack = " << signal_vci_tgt_c_memc.cmdack << std::endl; 338 std::cout << " memc.address = " << signal_vci_tgt_c_memc.address << std::endl; 339 std::cout << " memc.wdata = " << signal_vci_tgt_c_memc.wdata << std::endl; 340 std::cout << " memc.eop = " << signal_vci_tgt_c_memc.eop << std::endl; 341 std::cout << " memc.len = " << signal_vci_tgt_c_memc.plen << std::endl; 342 std::cout << " memc.rspval = " << signal_vci_tgt_c_memc.rspval << std::endl; 343 std::cout << " memc.rspack = " << signal_vci_tgt_c_memc.rspack << std::endl; 344 std::cout << " memc.reop = " << signal_vci_tgt_c_memc.reop << std::endl; 345 std::cout << " memc.rdata = " << signal_vci_tgt_c_memc.rdata << std::endl; 346 std::cout << " memc.rerror = " << signal_vci_tgt_c_memc.rerror << std::endl; 347 */ 348 349 sc_start(sc_core::sc_time(1, SC_NS)); 346 350 } 347 351 348 std::cout << "Hit ENTER to end simulation" << std::endl;349 char buf[1];350 std::cin.getline(buf,1);351 352 352 return EXIT_SUCCESS; 353 #else354 ncycles = 1;355 sc_start(sc_core::sc_time(0, SC_NS));356 signal_resetn = false;357 sc_start(sc_core::sc_time(1, SC_NS));358 signal_resetn = true;359 360 debug();361 return EXIT_SUCCESS;362 #endif363 353 } 364 354
Note: See TracChangeset
for help on using the changeset viewer.