#ifdef VHDL_TESTBENCH /* * $Id$ * * [ Description ] * */ #include "Behavioural/include/Signal.h" namespace morpheo { namespace behavioural { void Signal::testbench_body (Vhdl * & vhdl, string counter_name) { log_printf(FUNC,Behavioural,"testbench_body","Begin"); // _list_value is empty if we don't trace if (_list_value->empty()== false) { string separator; if (_size == 1) separator = "\'"; else separator = "\""; string signame = (_direction==OUT)?(_name+"_test"):_name; vhdl->set_body (""); vhdl->set_body ("with "+counter_name+" select"); vhdl->set_body ("\t"+signame+" <="); uint32_t cpt = 0; list::iterator i = _list_value->begin(); while (i != _list_value->end()) { list::iterator j = i; ++i; if (i != _list_value->end()) vhdl->set_body ("\t"+separator+*j+separator+" when "+toString(cpt++)+","); else vhdl->set_body ("\t"+separator+*j+separator+" when others;"); } } log_printf(FUNC,Behavioural,"testbench_body","End"); }; }; // end namespace behavioural }; // end namespace morpheo #endif