[113] | 1 | /* |
---|
| 2 | * $Id: top.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/SelfTest/include/top.h" |
---|
| 9 | #include "Behavioural/include/Selftest.h" |
---|
| 10 | |
---|
| 11 | #define NB_PARAMS 7 |
---|
| 12 | |
---|
| 13 | #ifdef MTI_SYSTEMC |
---|
| 14 | SC_MODULE_EXPORT(top); |
---|
| 15 | #endif |
---|
| 16 | |
---|
| 17 | #ifdef MTI_SYSTEMC |
---|
| 18 | SC_CTOR(top::top) |
---|
| 19 | #else |
---|
| 20 | top::top (sc_module_name module_name, int argc, char * argv[]) |
---|
| 21 | #endif |
---|
| 22 | { |
---|
| 23 | #ifdef MTI_SYSTEMC |
---|
| 24 | // accessing command-line arguments with modelsim |
---|
| 25 | int argc; |
---|
| 26 | const char * const * argv; |
---|
| 27 | |
---|
| 28 | argc = sc_argc (); |
---|
| 29 | argv = sc_argv (); |
---|
| 30 | #endif |
---|
| 31 | |
---|
| 32 | if (argc != 2+NB_PARAMS) |
---|
| 33 | usage (argc, argv); |
---|
| 34 | |
---|
| 35 | uint32_t x=1; |
---|
| 36 | |
---|
| 37 | uint32_t size_queue ; |
---|
| 38 | uint32_t nb_context ; |
---|
| 39 | uint32_t nb_front_end ; |
---|
| 40 | uint32_t nb_ooo_engine ; |
---|
| 41 | uint32_t nb_packet ; |
---|
| 42 | uint32_t size_general_data; |
---|
| 43 | uint32_t size_special_data; |
---|
| 44 | |
---|
| 45 | SELFTEST0(name,string,argv,x); |
---|
| 46 | SELFTEST0(size_queue ,uint32_t,argv,x); |
---|
| 47 | SELFTEST0(nb_context ,uint32_t,argv,x); |
---|
| 48 | SELFTEST0(nb_front_end ,uint32_t,argv,x); |
---|
| 49 | SELFTEST0(nb_ooo_engine ,uint32_t,argv,x); |
---|
| 50 | SELFTEST0(nb_packet ,uint32_t,argv,x); |
---|
| 51 | SELFTEST0(size_general_data,uint32_t,argv,x); |
---|
| 52 | SELFTEST0(size_special_data,uint32_t,argv,x); |
---|
| 53 | |
---|
| 54 | _param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters |
---|
| 55 | (size_queue , |
---|
| 56 | nb_context , |
---|
| 57 | nb_front_end , |
---|
| 58 | nb_ooo_engine , |
---|
| 59 | nb_packet , |
---|
| 60 | size_general_data , |
---|
| 61 | size_special_data , |
---|
| 62 | true |
---|
| 63 | ); |
---|
| 64 | |
---|
| 65 | // msg(_("%s"),_param.print(0).c_str()); |
---|
| 66 | |
---|
| 67 | // Allocation component |
---|
| 68 | allocation (); |
---|
| 69 | |
---|
| 70 | #ifdef MTI_SYSTEMC |
---|
| 71 | SC_THREAD(test); |
---|
| 72 | #endif |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | top::~top (void) |
---|
| 76 | { |
---|
| 77 | deallocation (); |
---|
| 78 | delete _param; |
---|
| 79 | } |
---|