Changeset 41 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- Jun 7, 2007, 9:13:47 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 21 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity.cpp
r38 r41 20 20 { 21 21 log_printf(FUNC,Behavioural,"Entity","Begin"); 22 _is_map = false; 22 _interfaces = new Interfaces (name); 23 _is_map = false; 23 24 log_printf(FUNC,Behavioural,"Entity","End"); 24 25 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_set_interfaces.cpp
r31 r41 14 14 Interfaces * Entity::set_interfaces (void) 15 15 { 16 Interfaces * interfaces = new Interfaces (); 17 18 _interfaces = interfaces; 19 20 return interfaces; 16 return _interfaces; 21 17 }; 22 18 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
r40 r41 30 30 31 31 #ifdef VHDL_TESTBENCH 32 _ list_cycle = new list<string>;32 _nb_cycle = 0; 33 33 #endif 34 34 … … 50 50 #endif 51 51 #ifdef VHDL_TESTBENCH 52 _ list_cycle = interface._list_cycle;52 _nb_cycle = interface._nb_cycle; 53 53 #endif 54 54 … … 73 73 delete _list_signal; 74 74 75 #ifdef VHDL_TESTBENCH76 delete _list_cycle ;77 #endif78 79 75 log_printf(FUNC,Behavioural,"~Interface","End"); 80 76 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo.cpp
r40 r41 25 25 #ifdef VHDL_TESTBENCH 26 26 _test_exhaustive = true; 27 _list_cycle = new list<uint32_t>; 27 28 #endif 28 29 … … 42 43 #ifdef VHDL_TESTBENCH 43 44 _test_exhaustive = interface_fifo._test_exhaustive; 45 _list_cycle = interface_fifo._list_cycle; 44 46 #endif 45 47 … … 54 56 delete _list_signal_ack; 55 57 58 #ifdef VHDL_TESTBENCH 59 delete _list_cycle; 60 #endif 61 56 62 log_printf(FUNC,Behavioural,"~Interface_fifo","End"); 57 63 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_save_ptr.cpp
r40 r41 16 16 log_printf(FUNC,Behavioural,"save_ptr","Begin"); 17 17 18 #ifdef VHDL_TESTBENCH 19 _test_exhaustive = false; 20 #endif 21 18 22 if (val_ack == VAL) 19 23 _list_signal_val->push_back (signal); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_set_signal.cpp
r40 r41 17 17 { 18 18 log_printf(FUNC,Behavioural,"set_signal_valack","Begin"); 19 19 20 20 Signal * sig = Interface::set_signal (name , 21 21 direction , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench.cpp
r40 r41 13 13 namespace behavioural { 14 14 15 void Interface_fifo::testbench ( Vhdl_Testbench * & vhdl_testbench)15 void Interface_fifo::testbench (void) 16 16 { 17 17 log_printf(FUNC,Behavioural,"testbench","Begin"); … … 20 20 testbench_cycle (); 21 21 22 Interface::testbench(vhdl_testbench); 22 Interface::testbench_cycle (); 23 Interface::testbench(); 23 24 24 25 log_printf(FUNC,Behavioural,"testbench","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_get_signal.cpp
r40 r41 51 51 }; 52 52 53 #ifdef VHDL 54 # ifdef VHDL_TESTBENCH 55 void Interface::get_signal (list<string> * & list_signal) 56 { 57 if (not _list_signal->empty()) 58 { 59 list<Signal*>::iterator i = _list_signal->begin(); 60 61 while (i != _list_signal->end()) 62 { 63 (*i)->get_name_vhdl (list_signal); 64 ++i; 65 } 66 } 67 }; 68 # endif 69 #endif 70 53 71 }; // end namespace behavioural 54 72 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_print.cpp
r40 r41 20 20 output_stream << x.get_signal () << endl; 21 21 22 #ifdef VHDL_TESTBENCH23 if (x._list_cycle->empty()== false)24 {25 list<string>::iterator i = x._list_cycle->begin();22 // #ifdef VHDL_TESTBENCH 23 // if (x._list_cycle->empty()== false) 24 // { 25 // list<string>::iterator i = x._list_cycle->begin(); 26 26 27 while (i != x._list_cycle->end())28 {29 output_stream << "\n\t" << *i ;30 ++i;31 }32 }33 #endif27 // while (i != x._list_cycle->end()) 28 // { 29 // output_stream << "\n\t" << *i ; 30 // ++i; 31 // } 32 // } 33 // #endif 34 34 35 35 log_printf(FUNC,Behavioural,"operator<<","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp
r40 r41 22 22 while (i != _list_signal->end()) 23 23 { 24 presence_port_t p = (*i)->_presence_port; 25 if ((p == PORT_VHDL_YES_TESTBENCH_YES) or 26 (p == PORT_VHDL_YES_TESTBENCH_NO ) ) 27 vhdl->set_port ((*i)->_name,(*i)->_direction,(*i)->_size); 24 (*i)->set_port (vhdl); 28 25 ++i; 29 26 } … … 33 30 #endif 34 31 35 #ifdef VHDL_TESTBENCH36 void Interface::set_port (Vhdl_Testbench * & vhdl_testbench)37 {38 log_printf(FUNC,Behavioural,"set_port (Testbench)","Begin");39 if (not _list_signal->empty())40 {41 list<Signal*>::iterator i = _list_signal->begin();42 43 while (i != _list_signal->end())44 {45 presence_port_t p = (*i)->_presence_port;46 if ((p == PORT_VHDL_YES_TESTBENCH_YES) or47 (p == PORT_VHDL_NO_TESTBENCH_YES ) )48 vhdl_testbench->set_port ((*i)->_name,(*i)->_direction,(*i)->_size);49 ++i;50 }51 }52 log_printf(FUNC,Behavioural,"set_port (Testbench)","End");53 };54 #endif55 32 }; // end namespace behavioural 56 33 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp
r40 r41 32 32 }; 33 33 34 #ifdef VHDL 35 # ifdef VHDL_TESTBENCH 36 void Interface::set_signal (Vhdl * & vhdl) 37 { 38 if (not _list_signal->empty()) 39 { 40 list<Signal*>::iterator i = _list_signal->begin(); 41 42 while (i != _list_signal->end()) 43 { 44 (*i)->set_signal (vhdl); 45 ++i; 46 } 47 } 48 }; 49 # endif 50 #endif 51 34 52 }; // end namespace behavioural 35 53 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_testbench.cpp
r40 r41 13 13 namespace behavioural { 14 14 15 void Interface::testbench_cycle (void) 16 { 17 // note : if defined(VHDL_TESTBENCH) then defined(SYSTEMC) 18 _list_cycle->push_back(toString(sc_simulation_time())); 19 } 20 21 void Interface::testbench (Vhdl_Testbench * & vhdl_testbench) 15 void Interface::testbench (void) 22 16 { 23 17 log_printf(FUNC,Behavioural,"testbench","Begin"); … … 29 23 while (i != _list_signal->end()) 30 24 { 31 (*i)->testbench( vhdl_testbench);25 (*i)->testbench(); 32 26 ++i; 33 27 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
r40 r41 11 11 namespace behavioural { 12 12 13 Interfaces::Interfaces (void) 13 Interfaces::Interfaces (string name): 14 _name (name) 14 15 { 15 16 log_printf(FUNC,Behavioural,"Interfaces","Begin"); … … 18 19 }; 19 20 20 Interfaces::Interfaces (const Interfaces & interfaces) 21 Interfaces::Interfaces (const Interfaces & interfaces) : 22 _name (interfaces._name) 21 23 { 22 24 log_printf(FUNC,Behavioural,"Interfaces (copy)","Begin"); … … 28 30 { 29 31 log_printf(FUNC,Behavioural,"~Interfaces","Begin"); 32 33 #ifdef VHDL_TESTBENCH 34 testbench_generate_file (); 35 #endif 30 36 31 37 if (_list_interface->empty()== false) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp
r40 r41 28 28 #endif 29 29 30 31 #ifdef VHDL_TESTBENCH32 void Interfaces::set_port (Vhdl_Testbench * & vhdl_testbench)33 {34 if (not _list_interface->empty())35 {36 list<Interface_fifo*>::iterator i = _list_interface->begin();37 38 while (i != _list_interface->end())39 {40 (*i)->set_port (vhdl_testbench);41 ++i;42 }43 }44 };45 #endif46 47 30 }; // end namespace behavioural 48 31 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench.cpp
r40 r41 13 13 namespace behavioural { 14 14 15 void Interfaces::testbench ( Vhdl_Testbench * & vhdl_testbench)15 void Interfaces::testbench (void) 16 16 { 17 17 log_printf(FUNC,Behavioural,"testbench","Begin"); … … 23 23 while (i != _list_interface->end()) 24 24 { 25 (*i)->testbench( vhdl_testbench);25 (*i)->testbench(); 26 26 ++i; 27 27 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench.cpp
r40 r41 13 13 14 14 // à optimisé -> pointeur de fonction afin d'éviter le test et le switch 15 void Signal::testbench ( Vhdl_Testbench * & vhdl_testbench)15 void Signal::testbench (void) 16 16 { 17 17 log_printf(FUNC,Behavioural,"testbench","Begin"); 18 18 19 19 if ((_presence_port == PORT_VHDL_YES_TESTBENCH_YES) or 20 (_presence_port == PORT_VHDL_NO_TESTBENCH_YES ))20 (_presence_port == PORT_VHDL_NO_TESTBENCH_YES )) 21 21 { 22 22 string str; … … 30 30 switch (_direction) 31 31 { 32 case IN : {vhdl_testbench->add_input (value); 33 str = toBase2 (value); break;} 34 case OUT : {vhdl_testbench->add_output(value); 35 str = toBase2 (value); break;} 36 case INOUT : {break;} 32 case IN : {str = toBase2 (value); break;} 33 case OUT : {str = toBase2 (value); break;} 34 // case INOUT : {break;} 37 35 } 38 36 break; … … 44 42 switch (_direction) 45 43 { 46 case IN : {vhdl_testbench->add_input (value); 47 str = toBase2 (value,_size); break;} 48 case OUT : {vhdl_testbench->add_output(value); 49 str = toBase2 (value,_size); break;} 50 case INOUT : {break;} 44 case IN : {str = toBase2 (value,_size); break;} 45 case OUT : {str = toBase2 (value,_size); break;} 46 // case INOUT : {break;} 51 47 } 52 48 break; … … 58 54 switch (_direction) 59 55 { 60 case IN : {vhdl_testbench->add_input (value); 61 str = toBase2 (value,_size); break;} 62 case OUT : {vhdl_testbench->add_output(value); 63 str = toBase2 (value,_size); break;} 64 case INOUT : {break;} 56 case IN : {str = toBase2 (value,_size); break;} 57 case OUT : {str = toBase2 (value,_size); break;} 58 // case INOUT : {break;} 65 59 } 66 60 break; … … 72 66 switch (_direction) 73 67 { 74 case IN : {vhdl_testbench->add_input (value); 75 str = toBase2 (value,_size); break;} 76 case OUT : {vhdl_testbench->add_output(value); 77 str = toBase2 (value,_size); break;} 78 case INOUT : {break;} 68 case IN : {str = toBase2 (value,_size); break;} 69 case OUT : {str = toBase2 (value,_size); break;} 70 // case INOUT : {break;} 79 71 } 80 72 break; … … 86 78 switch (_direction) 87 79 { 88 case IN : {vhdl_testbench->add_input (value); 89 str = toBase2 (value,_size); break;} 90 case OUT : {vhdl_testbench->add_output(value); 91 str = toBase2 (value,_size); break;} 92 case INOUT : {break;} 80 case IN : {str = toBase2 (value,_size); break;} 81 case OUT : {str = toBase2 (value,_size); break;} 82 // case INOUT : {break;} 93 83 } 94 84 break; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench.cpp
r40 r41 13 13 namespace behavioural { 14 14 15 Vhdl_Testbench::Vhdl_Testbench (string name ,16 bool exhaustive ):17 _name (name ),18 _exhaustive (exhaustive )19 {20 _vhdl = new Vhdl (_name + "_Testbench");15 // Vhdl_Testbench::Vhdl_Testbench (string name , 16 // bool exhaustive ): 17 // _name (name ), 18 // _exhaustive (exhaustive ) 19 // { 20 // _vhdl = new Vhdl (_name + "_Testbench"); 21 21 22 _size_input = 0;23 _size_output = 0;22 // _size_input = 0; 23 // _size_output = 0; 24 24 25 _num_cycle = 0;26 };25 // _num_cycle = 0; 26 // }; 27 27 28 Vhdl_Testbench::~Vhdl_Testbench ()29 {30 delete _vhdl;31 };28 // Vhdl_Testbench::~Vhdl_Testbench () 29 // { 30 // delete _vhdl; 31 // }; 32 32 33 33 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_add_input.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::add_input (uint32_t value)19 {20 _list_input_cycle.push_front(toBase2(value,*_num_input));21 _num_input++;22 };18 // void Vhdl_Testbench::add_input (uint32_t value) 19 // { 20 // _list_input_cycle.push_front(toBase2(value,*_num_input)); 21 // _num_input++; 22 // }; 23 23 24 24 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_add_label.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::add_label (string label)19 {20 _list_label.push_back(label_t(_num_cycle,label));21 };18 // void Vhdl_Testbench::add_label (string label) 19 // { 20 // _list_label.push_back(label_t(_num_cycle,label)); 21 // }; 22 22 23 23 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_add_output.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::add_output (uint32_t value)19 {20 _list_output_cycle.push_front(toBase2(value,*_num_output));21 _num_output ++;22 };18 // void Vhdl_Testbench::add_output (uint32_t value) 19 // { 20 // _list_output_cycle.push_front(toBase2(value,*_num_output)); 21 // _num_output ++; 22 // }; 23 23 24 24 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_add_test.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::add_test (bool must_test)19 {20 _list_test.push_back(must_test);21 };18 // void Vhdl_Testbench::add_test (bool must_test) 19 // { 20 // _list_test.push_back(must_test); 21 // }; 22 22 23 23 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_generate_file.cpp
r2 r41 14 14 namespace behavioural { 15 15 16 void Vhdl_Testbench::generate_file (void)17 {18 _vhdl->set_library_work (_name + "_Pack");16 // void Vhdl_Testbench::generate_file (void) 17 // { 18 // _vhdl->set_library_work (_name + "_Pack"); 19 19 20 if (_size_input == 0)21 throw (ErrorMorpheo ("No input for the test bench."));22 if (_size_output == 0)23 throw (ErrorMorpheo ("No output for the test bench."));20 // if (_size_input == 0) 21 // throw (ErrorMorpheo ("No input for the test bench.")); 22 // if (_size_output == 0) 23 // throw (ErrorMorpheo ("No output for the test bench.")); 24 24 25 // Only 2 signals and a variable26 _vhdl->set_signal ("testbench_input" ,std_logic(_size_input ));27 _vhdl->set_signal ("testbench_output" ,std_logic(_size_output));28 _vhdl->set_signal ("testbench_test" ,std_logic(_size_output));29 _vhdl->set_signal ("testbench_must_test" ,std_logic(1));30 _vhdl->set_signal ("testbench_counter" ,"natural","0");25 // // Only 2 signals and a variable 26 // _vhdl->set_signal ("testbench_input" ,std_logic(_size_input )); 27 // _vhdl->set_signal ("testbench_output" ,std_logic(_size_output)); 28 // _vhdl->set_signal ("testbench_test" ,std_logic(_size_output)); 29 // _vhdl->set_signal ("testbench_must_test" ,std_logic(1)); 30 // _vhdl->set_signal ("testbench_counter" ,"natural","0"); 31 31 32 uint32_t counter = get_input ();33 get_output ();34 get_test ();35 get_label ();32 // uint32_t counter = get_input (); 33 // get_output (); 34 // get_test (); 35 // get_label (); 36 36 37 // if (counter == get_output ())38 // throw (ErrorMorpheo ("The number of input is different of number of output."));37 // // if (counter == get_output ()) 38 // // throw (ErrorMorpheo ("The number of input is different of number of output.")); 39 39 40 generate_instance ();41 generate_process_clock (counter);40 // generate_instance (); 41 // generate_process_clock (counter); 42 42 43 _vhdl->generate_file(false, true);44 };43 // _vhdl->generate_file(false, true); 44 // }; 45 45 46 46 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_generate_instance.cpp
r2 r41 13 13 namespace behavioural { 14 14 15 void Vhdl_Testbench::generate_instance (void)16 {17 _vhdl->set_body("");18 _vhdl->set_body("instance_"+_name+" : "+_name);19 _vhdl->set_body("port map (");15 // void Vhdl_Testbench::generate_instance (void) 16 // { 17 // _vhdl->set_body(""); 18 // _vhdl->set_body("instance_"+_name+" : "+_name); 19 // _vhdl->set_body("port map ("); 20 20 21 list<string>::iterator i = _list_port.begin();22 if (i != _list_port.end())23 {24 _vhdl->set_body("\t "+*i+"\t=>\t"+*i);25 ++i;26 }27 while (i != _list_port.end())28 {29 _vhdl->set_body("\t,"+*i+"\t=>\t"+*i);30 ++i;31 }32 _vhdl->set_body(" );");33 };21 // list<string>::iterator i = _list_port.begin(); 22 // if (i != _list_port.end()) 23 // { 24 // _vhdl->set_body("\t "+*i+"\t=>\t"+*i); 25 // ++i; 26 // } 27 // while (i != _list_port.end()) 28 // { 29 // _vhdl->set_body("\t,"+*i+"\t=>\t"+*i); 30 // ++i; 31 // } 32 // _vhdl->set_body(" );"); 33 // }; 34 34 35 35 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_generate_process_clock.cpp
r2 r41 13 13 namespace behavioural { 14 14 15 void Vhdl_Testbench::generate_process_clock (uint32_t counter)16 {17 _vhdl->set_body("");18 _vhdl->set_body(_clock_name+" <= not "+_clock_name+" after 50 ns;");19 _vhdl->set_body("testbench_counter <= testbench_counter+1 after 100 ns;");20 _vhdl->set_body("");15 // void Vhdl_Testbench::generate_process_clock (uint32_t counter) 16 // { 17 // _vhdl->set_body(""); 18 // _vhdl->set_body(_clock_name+" <= not "+_clock_name+" after 50 ns;"); 19 // _vhdl->set_body("testbench_counter <= testbench_counter+1 after 100 ns;"); 20 // _vhdl->set_body(""); 21 21 22 _vhdl->set_body("process ("+_clock_name+")");23 _vhdl->set_body("begin");24 _vhdl->set_body("\tif "+_clock_name+"'event and "+_clock_name+" = '1' then");25 _vhdl->set_body("");26 _vhdl->set_body("\t\tassert (not ((testbench_must_test = '1') and not (testbench_test = testbench_output)))");27 _vhdl->set_body("\t\treport \" Test KO - output's test is different of output's component\"");28 _vhdl->set_body("\t\tseverity FAILURE;");29 _vhdl->set_body("");30 _vhdl->set_body("\t\tassert (not ((testbench_must_test = '1') and (testbench_test = testbench_output)))");31 _vhdl->set_body("\t\treport \" Test OK\"");32 _vhdl->set_body("\t\tseverity NOTE;");33 _vhdl->set_body("");34 _vhdl->set_body("\t\tassert (not ( testbench_must_test = '0'))");35 _vhdl->set_body("\t\treport \"No Test\"");36 _vhdl->set_body("\t\tseverity NOTE;");37 _vhdl->set_body("");38 _vhdl->set_body("\tend if;");39 _vhdl->set_body("end process;");22 // _vhdl->set_body("process ("+_clock_name+")"); 23 // _vhdl->set_body("begin"); 24 // _vhdl->set_body("\tif "+_clock_name+"'event and "+_clock_name+" = '1' then"); 25 // _vhdl->set_body(""); 26 // _vhdl->set_body("\t\tassert (not ((testbench_must_test = '1') and not (testbench_test = testbench_output)))"); 27 // _vhdl->set_body("\t\treport \" Test KO - output's test is different of output's component\""); 28 // _vhdl->set_body("\t\tseverity FAILURE;"); 29 // _vhdl->set_body(""); 30 // _vhdl->set_body("\t\tassert (not ((testbench_must_test = '1') and (testbench_test = testbench_output)))"); 31 // _vhdl->set_body("\t\treport \" Test OK\""); 32 // _vhdl->set_body("\t\tseverity NOTE;"); 33 // _vhdl->set_body(""); 34 // _vhdl->set_body("\t\tassert (not ( testbench_must_test = '0'))"); 35 // _vhdl->set_body("\t\treport \"No Test\""); 36 // _vhdl->set_body("\t\tseverity NOTE;"); 37 // _vhdl->set_body(""); 38 // _vhdl->set_body("\tend if;"); 39 // _vhdl->set_body("end process;"); 40 40 41 _vhdl->set_body("");42 _vhdl->set_body("assert (not (testbench_counter = " + toString(counter)+"))");43 _vhdl->set_body("report \"End of Simulation\"");44 _vhdl->set_body("severity FAILURE;");45 };41 // _vhdl->set_body(""); 42 // _vhdl->set_body("assert (not (testbench_counter = " + toString(counter)+"))"); 43 // _vhdl->set_body("report \"End of Simulation\""); 44 // _vhdl->set_body("severity FAILURE;"); 45 // }; 46 46 47 47 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_get_input.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 uint32_t Vhdl_Testbench::get_input (void)19 {20 list<string>::iterator i = _list_input.begin();18 // uint32_t Vhdl_Testbench::get_input (void) 19 // { 20 // list<string>::iterator i = _list_input.begin(); 21 21 22 uint32_t counter = 0;22 // uint32_t counter = 0; 23 23 24 if (i != _list_input.end())25 {26 _vhdl->set_body ("");27 _vhdl->set_body ("with testbench_counter select");28 _vhdl->set_body ("\ttestbench_input <=");24 // if (i != _list_input.end()) 25 // { 26 // _vhdl->set_body (""); 27 // _vhdl->set_body ("with testbench_counter select"); 28 // _vhdl->set_body ("\ttestbench_input <="); 29 29 30 while (i != _list_input.end())31 {32 list<string>::iterator j = i;33 ++i;30 // while (i != _list_input.end()) 31 // { 32 // list<string>::iterator j = i; 33 // ++i; 34 34 35 if (i != _list_input.end())36 _vhdl->set_body ("\t\""+*j+"\" when "+toString(counter++)+",");37 else38 _vhdl->set_body ("\t\""+*j+"\" when others;");39 }40 }35 // if (i != _list_input.end()) 36 // _vhdl->set_body ("\t\""+*j+"\" when "+toString(counter++)+","); 37 // else 38 // _vhdl->set_body ("\t\""+*j+"\" when others;"); 39 // } 40 // } 41 41 42 return counter;43 };42 // return counter; 43 // }; 44 44 45 45 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_get_label.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::get_label (void)19 {20 for (list<label_t>::iterator i = _list_label.begin(); i != _list_label.end(); i++)21 {22 _vhdl->set_body("");23 _vhdl->set_body("assert (not (testbench_counter = " + toString(i->_cycle)+"))");24 _vhdl->set_body("report \"***** "+i->_label+" *****\"");25 _vhdl->set_body("severity NOTE;");26 }27 };18 // void Vhdl_Testbench::get_label (void) 19 // { 20 // for (list<label_t>::iterator i = _list_label.begin(); i != _list_label.end(); i++) 21 // { 22 // _vhdl->set_body(""); 23 // _vhdl->set_body("assert (not (testbench_counter = " + toString(i->_cycle)+"))"); 24 // _vhdl->set_body("report \"***** "+i->_label+" *****\""); 25 // _vhdl->set_body("severity NOTE;"); 26 // } 27 // }; 28 28 29 29 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_get_output.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 uint32_t Vhdl_Testbench::get_output (void)19 {20 list<string>::iterator i = _list_output.begin();18 // uint32_t Vhdl_Testbench::get_output (void) 19 // { 20 // list<string>::iterator i = _list_output.begin(); 21 21 22 uint32_t counter = 0;22 // uint32_t counter = 0; 23 23 24 if (i != _list_output.end())25 {26 _vhdl->set_body ("");27 _vhdl->set_body ("with testbench_counter select");28 _vhdl->set_body ("\ttestbench_test <=");24 // if (i != _list_output.end()) 25 // { 26 // _vhdl->set_body (""); 27 // _vhdl->set_body ("with testbench_counter select"); 28 // _vhdl->set_body ("\ttestbench_test <="); 29 29 30 while (i != _list_output.end())31 {32 list<string>::iterator j = i;33 ++i;30 // while (i != _list_output.end()) 31 // { 32 // list<string>::iterator j = i; 33 // ++i; 34 34 35 if (i != _list_output.end())36 _vhdl->set_body ("\t\""+*j+"\" when "+toString(counter++)+",");37 else38 _vhdl->set_body ("\t\""+*j+"\" when others;");39 }40 }35 // if (i != _list_output.end()) 36 // _vhdl->set_body ("\t\""+*j+"\" when "+toString(counter++)+","); 37 // else 38 // _vhdl->set_body ("\t\""+*j+"\" when others;"); 39 // } 40 // } 41 41 42 return counter;43 };42 // return counter; 43 // }; 44 44 45 45 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_get_test.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 uint32_t Vhdl_Testbench::get_test (void)19 {20 list<bool>::iterator i = _list_test.begin();18 // uint32_t Vhdl_Testbench::get_test (void) 19 // { 20 // list<bool>::iterator i = _list_test.begin(); 21 21 22 uint32_t counter = 0;22 // uint32_t counter = 0; 23 23 24 if (i != _list_test.end())25 {26 _vhdl->set_body ("");27 _vhdl->set_body ("with testbench_counter select");28 _vhdl->set_body ("\ttestbench_must_test <=");24 // if (i != _list_test.end()) 25 // { 26 // _vhdl->set_body (""); 27 // _vhdl->set_body ("with testbench_counter select"); 28 // _vhdl->set_body ("\ttestbench_must_test <="); 29 29 30 while (i != _list_test.end())31 {32 list<bool>::iterator j = i;33 ++i;30 // while (i != _list_test.end()) 31 // { 32 // list<bool>::iterator j = i; 33 // ++i; 34 34 35 string str = (*j==true)?"1":"0";35 // string str = (*j==true)?"1":"0"; 36 36 37 if (i != _list_test.end())38 _vhdl->set_body ("\t'"+str+"' when "+toString(counter++)+",");39 else40 _vhdl->set_body ("\t'"+str+"' when others;");41 }42 }37 // if (i != _list_test.end()) 38 // _vhdl->set_body ("\t'"+str+"' when "+toString(counter++)+","); 39 // else 40 // _vhdl->set_body ("\t'"+str+"' when others;"); 41 // } 42 // } 43 43 44 return counter;45 };44 // return counter; 45 // }; 46 46 47 47 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_new_cycle.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::new_cycle (void)19 {20 set_input();21 set_output();18 // void Vhdl_Testbench::new_cycle (void) 19 // { 20 // set_input(); 21 // set_output(); 22 22 23 _num_input = _list_input_size .begin();24 _num_output = _list_output_size.begin();23 // _num_input = _list_input_size .begin(); 24 // _num_output = _list_output_size.begin(); 25 25 26 _num_cycle ++;27 };26 // _num_cycle ++; 27 // }; 28 28 29 29 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_set_clock.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::set_clock (string name,19 bool model_have_clock)20 {21 _clock_name = name;22 _vhdl->set_signal (name,std_logic(1),"'0'");18 // void Vhdl_Testbench::set_clock (string name, 19 // bool model_have_clock) 20 // { 21 // _clock_name = name; 22 // _vhdl->set_signal (name,std_logic(1),"'0'"); 23 23 24 if (model_have_clock == true)25 _list_port.push_back(name);24 // if (model_have_clock == true) 25 // _list_port.push_back(name); 26 26 27 _num_input = _list_input_size .begin();28 _num_output = _list_output_size.begin();29 };27 // _num_input = _list_input_size .begin(); 28 // _num_output = _list_output_size.begin(); 29 // }; 30 30 31 31 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_set_input.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::set_input (void)19 {20 string text = "";18 // void Vhdl_Testbench::set_input (void) 19 // { 20 // string text = ""; 21 21 22 while (_list_input_cycle.empty() == false)23 {24 text += _list_input_cycle.front();22 // while (_list_input_cycle.empty() == false) 23 // { 24 // text += _list_input_cycle.front(); 25 25 26 _list_input_cycle.pop_front();27 }26 // _list_input_cycle.pop_front(); 27 // } 28 28 29 _list_input.push_back(text);30 };29 // _list_input.push_back(text); 30 // }; 31 31 32 32 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_set_output.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::set_output (void)19 {20 string text = "";18 // void Vhdl_Testbench::set_output (void) 19 // { 20 // string text = ""; 21 21 22 while (_list_output_cycle.empty() == false)23 {24 text += _list_output_cycle.front();22 // while (_list_output_cycle.empty() == false) 23 // { 24 // text += _list_output_cycle.front(); 25 25 26 _list_output_cycle.pop_front();27 }26 // _list_output_cycle.pop_front(); 27 // } 28 28 29 _list_output.push_back(text);30 };29 // _list_output.push_back(text); 30 // }; 31 31 32 32 }; // end namespace behavioural -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench_set_port.cpp
r2 r41 16 16 namespace behavioural { 17 17 18 void Vhdl_Testbench::set_port (string name ,19 direction_t direction,20 uint32_t size )21 {22 string name2;23 uint32_t size_old;24 if (direction == IN)25 {26 _list_input_size.push_back(size);27 size_old = _size_input;28 _size_input += size;29 name2 = "testbench_input";30 }31 else32 {33 _list_output_size.push_back(size);34 size_old = _size_output;35 _size_output += size;36 name2 = "testbench_output";37 }18 // void Vhdl_Testbench::set_port (string name , 19 // direction_t direction, 20 // uint32_t size ) 21 // { 22 // string name2; 23 // uint32_t size_old; 24 // if (direction == IN) 25 // { 26 // _list_input_size.push_back(size); 27 // size_old = _size_input; 28 // _size_input += size; 29 // name2 = "testbench_input"; 30 // } 31 // else 32 // { 33 // _list_output_size.push_back(size); 34 // size_old = _size_output; 35 // _size_output += size; 36 // name2 = "testbench_output"; 37 // } 38 38 39 string range;40 if (size == 1)41 range = "("+toString(size_old)+")";42 else43 range = "("+toString(size_old+size-1)+" downto "+toString(size_old)+")";39 // string range; 40 // if (size == 1) 41 // range = "("+toString(size_old)+")"; 42 // else 43 // range = "("+toString(size_old+size-1)+" downto "+toString(size_old)+")"; 44 44 45 _vhdl->set_alias (name, std_logic(size), name2, range);45 // _vhdl->set_alias (name, std_logic(size), name2, range); 46 46 47 _list_port.push_back(name);48 };47 // _list_port.push_back(name); 48 // }; 49 49 50 50 }; // end namespace behavioural
Note: See TracChangeset
for help on using the changeset viewer.