Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (15 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/SelfTest/include/test.h

    r81 r88  
    1616
    1717#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/include/Register_unit.h"
     18#include "Common/include/Time.h"
    1819
    1920using namespace std;
     
    2829void test    (string name,
    2930              morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::Parameters * param);
    30 
    31 class Time
    32 {
    33 private : timeval time_begin;
    34 // private : timeval time_end;
    35  
    36 public  : Time ()
    37   {
    38     gettimeofday(&time_begin     ,NULL);
    39   };
    40 
    41 public  : ~Time ()
    42   {
    43     cout << *this;
    44   };
    45 
    46 public  : friend ostream& operator<< (ostream& output_stream,
    47                                       const Time & x)
    48   {
    49     timeval time_end;
    50    
    51     gettimeofday(&time_end       ,NULL);
    52    
    53     uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time());
    54 
    55     double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec);
    56    
    57     output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << endl;
    58 
    59     return output_stream;
    60   }
    61 };
Note: See TracChangeset for help on using the changeset viewer.