Ignore:
Timestamp:
May 12, 2010, 7:34:01 PM (14 years ago)
Author:
rosiere
Message:

1) add counters_t type for interface
2) fix in check load in load_store_unit
3) add parameters (but not yet implemented)
4) change environment and add script (distcc_env.sh ...)
5) add warning if an unser change rename flag with l.mtspr instruction
6) ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Platforms/Test/src/test.cpp

    r132 r138  
    4444  if (setlocale (LC_ALL, "") == NULL)
    4545    {
    46       cerr << "Error setlocale." << endl;
     46      msgError("Error setlocale.\n");
    4747      exit (EXIT_FAILURE);
    4848    }
    4949 
    5050  // 2) Morpheo Construction
    51   Morpheo * morpheo = new Morpheo
    52     ("morpheo",
    53      filename_simulator,
    54      filename_generator,
    55      filename_instance ,
    56      get_custom_information
    57      );
     51  Morpheo * morpheo;
     52  try
     53    {
     54      morpheo = new Morpheo
     55        ("morpheo",
     56         filename_simulator,
     57         filename_generator,
     58         filename_instance ,
     59         get_custom_information
     60         );
     61    }
     62  catch (morpheo::ErrorMorpheo & error)
     63    {
     64      std::cerr << error.what() << std::endl;
     65
     66      msgError("%s\n",STR_KO);
     67     
     68      return EXIT_FAILURE;
     69    }
    5870
    5971  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    91103      daccess_size_address   [i] = morpheo->_size_dcache_address;
    92104      daccess_size_data      [i] = morpheo->_size_dcache_data;
    93      
     105
    94106      buffer_irsp_size       [i] =  8;
    95107      buffer_drsp_size       [i] =  8;
     
    129141      if (cache_size<(cache_size_line*cache_size_word))
    130142        {
    131           cerr << "cache is too small" << endl;
     143          msgError("cache is too small\n");
    132144          exit(EXIT_FAILURE);
    133145        }
     
    308320//   cout << param_environment->print(0) << endl;
    309321
    310   segtable->print();
    311  
    312322  Environment * environment = new Environment ("environment",param_environment);
    313323 
    314324  const char * sections_text [] = {".text",NULL};
    315325  const char * sections_data [] = {".data",".rodata",".bss",".sdata",".sbss", NULL};
    316  
    317   if (environment->init("text"   , filename_software.c_str(), sections_text) == false) exit (EXIT_FAILURE);
    318   if (environment->init("data"   , filename_software.c_str(), sections_data) == false) exit (EXIT_FAILURE);
     326
     327  if (environment->init("text", filename_software.c_str(), sections_text) == false) exit (EXIT_FAILURE);
     328  if (environment->init("data", filename_software.c_str(), sections_data) == false) exit (EXIT_FAILURE);
     329
     330  // segtable->print();
    319331
    320332  //==============================================================================
     
    322334  //==============================================================================
    323335#ifdef SYSTEMCASS_SPECIFIC
    324   sc_clock              *  CLOCK  = new sc_clock ("clock", 1.0, 0.5); 
     336  sc_clock              *  CLOCK  = new sc_clock ("CLOCK__________________", 1.0, 0.5);
    325337#else
    326338  sc_time period (TIME_PERIOD, TIME_UNIT);
    327   sc_clock              *  CLOCK  = new sc_clock ("clock", period);     
     339  sc_clock              *  CLOCK  = new sc_clock ("CLOCK__________________", period);   
    328340#endif
    329   sc_signal<Tcontrol_t> *  NRESET = new sc_signal<Tcontrol_t> ("NRESET");
     341  sc_signal<Tcontrol_t> *  NRESET = new sc_signal<Tcontrol_t> ("NRESET_________________");
    330342
    331343  sc_signal<Tcontrol_t           >  ** ICACHE_REQ_VAL        ;
     
    360372  sc_signal<Tcontrol_t           >  ** INTERRUPT_ENABLE      ;
    361373
    362   ALLOC1_SC_SIGNAL(ICACHE_REQ_VAL         ,"ICACHE_REQ_VAL        ",Tcontrol_t           ,morpheo->_nb_icache_port);
    363   ALLOC1_SC_SIGNAL(ICACHE_REQ_ACK         ,"ICACHE_REQ_ACK        ",Tcontrol_t           ,morpheo->_nb_icache_port);
    364   ALLOC1_SC_SIGNAL(ICACHE_REQ_THREAD_ID   ,"ICACHE_REQ_THREAD_ID  ",Ticache_context_t    ,morpheo->_nb_icache_port);
    365   ALLOC1_SC_SIGNAL(ICACHE_REQ_PACKET_ID   ,"ICACHE_REQ_PACKET_ID  ",Ticache_packet_t     ,morpheo->_nb_icache_port);
    366   ALLOC1_SC_SIGNAL(ICACHE_REQ_ADDRESS     ,"ICACHE_REQ_ADDRESS    ",Ticache_address_t    ,morpheo->_nb_icache_port);
    367   ALLOC1_SC_SIGNAL(ICACHE_REQ_TYPE        ,"ICACHE_REQ_TYPE       ",Ticache_type_t       ,morpheo->_nb_icache_port);
    368 
    369   ALLOC1_SC_SIGNAL(ICACHE_RSP_VAL         ,"ICACHE_RSP_VAL        ",Tcontrol_t           ,morpheo->_nb_icache_port);
    370   ALLOC1_SC_SIGNAL(ICACHE_RSP_ACK         ,"ICACHE_RSP_ACK        ",Tcontrol_t           ,morpheo->_nb_icache_port);
    371   ALLOC1_SC_SIGNAL(ICACHE_RSP_THREAD_ID   ,"ICACHE_RSP_THREAD_ID  ",Ticache_context_t    ,morpheo->_nb_icache_port);
    372   ALLOC1_SC_SIGNAL(ICACHE_RSP_PACKET_ID   ,"ICACHE_RSP_PACKET_ID  ",Ticache_packet_t     ,morpheo->_nb_icache_port);
    373   ALLOC2_SC_SIGNAL(ICACHE_RSP_INSTRUCTION ,"ICACHE_RSP_INSTRUCTION",Ticache_instruction_t,morpheo->_nb_icache_port,morpheo->_icache_nb_instruction[it1]);
    374   ALLOC1_SC_SIGNAL(ICACHE_RSP_ERROR       ,"ICACHE_RSP_ERROR      ",Ticache_error_t      ,morpheo->_nb_icache_port);
    375 
    376   ALLOC1_SC_SIGNAL(DCACHE_REQ_VAL         ,"DCACHE_REQ_VAL        ",Tcontrol_t           ,morpheo->_nb_dcache_port);
    377   ALLOC1_SC_SIGNAL(DCACHE_REQ_ACK         ,"DCACHE_REQ_ACK        ",Tcontrol_t           ,morpheo->_nb_dcache_port);
    378   ALLOC1_SC_SIGNAL(DCACHE_REQ_THREAD_ID   ,"DCACHE_REQ_THREAD_ID  ",Tdcache_context_t    ,morpheo->_nb_dcache_port);
    379   ALLOC1_SC_SIGNAL(DCACHE_REQ_PACKET_ID   ,"DCACHE_REQ_PACKET_ID  ",Tdcache_packet_t     ,morpheo->_nb_dcache_port);
    380   ALLOC1_SC_SIGNAL(DCACHE_REQ_ADDRESS     ,"DCACHE_REQ_ADDRESS    ",Tdcache_address_t    ,morpheo->_nb_dcache_port);
    381   ALLOC1_SC_SIGNAL(DCACHE_REQ_WDATA       ,"DCACHE_REQ_WDATA      ",Tdcache_data_t       ,morpheo->_nb_dcache_port);
    382   ALLOC1_SC_SIGNAL(DCACHE_REQ_TYPE        ,"DCACHE_REQ_TYPE       ",Tdcache_type_t       ,morpheo->_nb_dcache_port);
    383                                                                                          
    384   ALLOC1_SC_SIGNAL(DCACHE_RSP_VAL         ,"DCACHE_RSP_VAL        ",Tcontrol_t           ,morpheo->_nb_dcache_port);
    385   ALLOC1_SC_SIGNAL(DCACHE_RSP_ACK         ,"DCACHE_RSP_ACK        ",Tcontrol_t           ,morpheo->_nb_dcache_port);
    386   ALLOC1_SC_SIGNAL(DCACHE_RSP_THREAD_ID   ,"DCACHE_RSP_THREAD_ID  ",Tdcache_context_t    ,morpheo->_nb_dcache_port);
    387   ALLOC1_SC_SIGNAL(DCACHE_RSP_PACKET_ID   ,"DCACHE_RSP_PACKET_ID  ",Tdcache_packet_t     ,morpheo->_nb_dcache_port);
    388   ALLOC1_SC_SIGNAL(DCACHE_RSP_RDATA       ,"DCACHE_RSP_RDATA      ",Tdcache_data_t       ,morpheo->_nb_dcache_port);
    389   ALLOC1_SC_SIGNAL(DCACHE_RSP_ERROR       ,"DCACHE_RSP_ERROR      ",Tdcache_error_t      ,morpheo->_nb_dcache_port);
    390                                                                                          
    391   ALLOC1_SC_SIGNAL(INTERRUPT_ENABLE       ,"INTERRUPT_ENABLE      ",Tcontrol_t           ,morpheo->_nb_thread);
     374  ALLOC1_SC_SIGNAL(ICACHE_REQ_VAL         ,"ICACHE_REQ_VAL_________",Tcontrol_t           ,morpheo->_nb_icache_port);
     375  ALLOC1_SC_SIGNAL(ICACHE_REQ_ACK         ,"ICACHE_REQ_ACK_________",Tcontrol_t           ,morpheo->_nb_icache_port);
     376  ALLOC1_SC_SIGNAL(ICACHE_REQ_THREAD_ID   ,"ICACHE_REQ_THREAD_ID___",Ticache_context_t    ,morpheo->_nb_icache_port);
     377  ALLOC1_SC_SIGNAL(ICACHE_REQ_PACKET_ID   ,"ICACHE_REQ_PACKET_ID___",Ticache_packet_t     ,morpheo->_nb_icache_port);
     378  ALLOC1_SC_SIGNAL(ICACHE_REQ_ADDRESS     ,"ICACHE_REQ_ADDRESS_____",Ticache_address_t    ,morpheo->_nb_icache_port);
     379  ALLOC1_SC_SIGNAL(ICACHE_REQ_TYPE        ,"ICACHE_REQ_TYPE________",Ticache_type_t       ,morpheo->_nb_icache_port);
     380
     381  ALLOC1_SC_SIGNAL(ICACHE_RSP_VAL         ,"ICACHE_RSP_VAL_________",Tcontrol_t           ,morpheo->_nb_icache_port);
     382  ALLOC1_SC_SIGNAL(ICACHE_RSP_ACK         ,"ICACHE_RSP_ACK_________",Tcontrol_t           ,morpheo->_nb_icache_port);
     383  ALLOC1_SC_SIGNAL(ICACHE_RSP_THREAD_ID   ,"ICACHE_RSP_THREAD_ID___",Ticache_context_t    ,morpheo->_nb_icache_port);
     384  ALLOC1_SC_SIGNAL(ICACHE_RSP_PACKET_ID   ,"ICACHE_RSP_PACKET_ID___",Ticache_packet_t     ,morpheo->_nb_icache_port);
     385  ALLOC2_SC_SIGNAL(ICACHE_RSP_INSTRUCTION ,"ICACHE_RSP_INSTRUCTION_",Ticache_instruction_t,morpheo->_nb_icache_port,morpheo->_icache_nb_instruction[it1]);
     386  ALLOC1_SC_SIGNAL(ICACHE_RSP_ERROR       ,"ICACHE_RSP_ERROR_______",Ticache_error_t      ,morpheo->_nb_icache_port);
     387
     388  ALLOC1_SC_SIGNAL(DCACHE_REQ_VAL         ,"DCACHE_REQ_VAL_________",Tcontrol_t           ,morpheo->_nb_dcache_port);
     389  ALLOC1_SC_SIGNAL(DCACHE_REQ_ACK         ,"DCACHE_REQ_ACK_________",Tcontrol_t           ,morpheo->_nb_dcache_port);
     390  ALLOC1_SC_SIGNAL(DCACHE_REQ_THREAD_ID   ,"DCACHE_REQ_THREAD_ID___",Tdcache_context_t    ,morpheo->_nb_dcache_port);
     391  ALLOC1_SC_SIGNAL(DCACHE_REQ_PACKET_ID   ,"DCACHE_REQ_PACKET_ID___",Tdcache_packet_t     ,morpheo->_nb_dcache_port);
     392  ALLOC1_SC_SIGNAL(DCACHE_REQ_ADDRESS     ,"DCACHE_REQ_ADDRESS_____",Tdcache_address_t    ,morpheo->_nb_dcache_port);
     393  ALLOC1_SC_SIGNAL(DCACHE_REQ_WDATA       ,"DCACHE_REQ_WDATA_______",Tdcache_data_t       ,morpheo->_nb_dcache_port);
     394  ALLOC1_SC_SIGNAL(DCACHE_REQ_TYPE        ,"DCACHE_REQ_TYPE________",Tdcache_type_t       ,morpheo->_nb_dcache_port);
     395
     396  ALLOC1_SC_SIGNAL(DCACHE_RSP_VAL         ,"DCACHE_RSP_VAL_________",Tcontrol_t           ,morpheo->_nb_dcache_port);
     397  ALLOC1_SC_SIGNAL(DCACHE_RSP_ACK         ,"DCACHE_RSP_ACK_________",Tcontrol_t           ,morpheo->_nb_dcache_port);
     398  ALLOC1_SC_SIGNAL(DCACHE_RSP_THREAD_ID   ,"DCACHE_RSP_THREAD_ID___",Tdcache_context_t    ,morpheo->_nb_dcache_port);
     399  ALLOC1_SC_SIGNAL(DCACHE_RSP_PACKET_ID   ,"DCACHE_RSP_PACKET_ID___",Tdcache_packet_t     ,morpheo->_nb_dcache_port);
     400  ALLOC1_SC_SIGNAL(DCACHE_RSP_RDATA       ,"DCACHE_RSP_RDATA_______",Tdcache_data_t       ,morpheo->_nb_dcache_port);
     401  ALLOC1_SC_SIGNAL(DCACHE_RSP_ERROR       ,"DCACHE_RSP_ERROR_______",Tdcache_error_t      ,morpheo->_nb_dcache_port);
     402
     403  ALLOC1_SC_SIGNAL(INTERRUPT_ENABLE       ,"INTERRUPT_ENABLE_______",Tcontrol_t           ,morpheo->_nb_thread);
    392404
    393405  //==============================================================================
     
    492504  // initialisation
    493505 
    494   cerr << "<test> Simulation Init" << endl;
     506  msgInformation("<test> Simulation Init\n");
    495507
    496508  sc_time t (0, TIME_UNIT);
    497509  sc_start(t);
    498510
    499   cerr << "<test> Simulation Start" << endl;
     511  msgInformation("<test> Simulation Start\n");
    500512
    501513  bool morpheo_error = false;
     
    523535  catch (morpheo::ErrorMorpheo & error)
    524536    {
    525       std::cerr << error.what() << std::endl
    526                 << STR_KO << std::endl;
     537      std::cerr << error.what() << std::endl;
     538
     539      msgError("%s\n",STR_KO);
    527540
    528541      morpheo_error = true;
     
    647660      if (not morpheo_end and not environment_end)
    648661        {
    649           cerr << "<test> Simulation End : Unknow" << endl;
     662          msgError("<test> Simulation End : Unknow\n");
    650663        }
    651664      else
     
    653666          if (morpheo_end)
    654667            {
    655               cout << "<test> Simulation End : MORPHEO" << endl;
     668              msgInformation("<test> Simulation End : MORPHEO\n");
    656669              test_ok = true;
    657670            }
    658671          if (environment_end)
    659672            {
    660               cout << "<test> Simulation End : ENVIRONMENT" << endl;
     673              msgInformation("<test> Simulation End : ENVIRONMENT\n");
    661674              test_ok = true;
    662675            }
     
    666679  if (test_ok)
    667680    {
    668       cout << STR_OK << endl;
     681      msgInformation("%s\n",STR_OK);
    669682      return EXIT_SUCCESS;
    670683    }
    671684  else
    672685    {
    673       cout << STR_KO << endl;
     686      msgInformation("%s\n",STR_KO);
    674687      return EXIT_FAILURE;
    675688    }
Note: See TracChangeset for help on using the changeset viewer.