/* * $Id: top_allocation.cpp 113 2009-04-14 18:39:12Z rosiere $ * * [ Description ] * * Test */ #include "Behavioural/@DIRECTORY/SelfTest/include/top.h" #include "Behavioural/include/Allocation.h" void top::allocation (void) { if (setlocale (LC_ALL, "") == NULL) msgWarning(_("setlocale ko.\n")); try { _param->test(); } catch (morpheo::ErrorMorpheo & error) { msgError(_("<%s> : %s"),name.c_str(),error.what()); return; } catch (...) { msgError(_("<%s> : This test must generate a error"),name.c_str()); exit (EXIT_FAILURE); } _usage = USE_ALL; // _usage = usage_unset(_usage,USE_SYSTEMC ); // _usage = usage_unset(_usage,USE_VHDL ); // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH ); // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT); // _usage = usage_unset(_usage,USE_POSITION ); // _usage = usage_unset(_usage,USE_STATISTICS ); // _usage = usage_unset(_usage,USE_INFORMATION ); #ifdef STATISTICS if (usage_is_set(_usage,USE_STATISTICS)) _param_stat = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX); #endif component = new @COMPONENT (name.c_str(), #ifdef STATISTICS _param_stat, #endif _param, _usage ); #ifdef SYSTEMC if (usage_is_set(_usage,USE_SYSTEMC)) { /********************************************************************* * Déclarations des signaux *********************************************************************/ msgInformation(_("<%s> : Create signal.\n"),name.c_str()); in_CLOCK = new sc_clock ("clock", TIME_PERIOD, TIME_UNIT, 0.5); //name,period,time_unit,duty_cycle ALLOC0_SC_SIGNAL( in_NRESET ," in_NRESET ",Tcontrol_t); /******************************************************** * Instanciation ********************************************************/ msgInformation(_("<%s> : Instanciation of _@COMPONENT.\n"),name.c_str()); INSTANCE0_SC_SIGNAL(component, in_CLOCK ); INSTANCE0_SC_SIGNAL(component, in_NRESET ); } #endif }