Changeset 40 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- Jun 5, 2007, 11:06:46 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 6 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
r38 r40 20 20 log_printf(FUNC,Behavioural,"Interface","Begin"); 21 21 22 _comment = "";23 _list_signal = new (list<Signal*>);22 _comment = ""; 23 _list_signal = new (list<Signal*>); 24 24 25 25 #ifdef POSITION 26 _is_map = false; 27 _entity_map = NULL; 28 _interface_map = NULL; 26 _is_map = false; 27 _entity_map = NULL; 28 _interface_map = NULL; 29 #endif 30 31 #ifdef VHDL_TESTBENCH 32 _list_cycle = new list<string>; 29 33 #endif 30 34 … … 45 49 _interface_map = interface._interface_map; 46 50 #endif 51 #ifdef VHDL_TESTBENCH 52 _list_cycle = interface._list_cycle; 53 #endif 54 47 55 log_printf(FUNC,Behavioural,"Interface (copy)","End"); 48 56 }; … … 54 62 if (_list_signal->empty()== false) 55 63 { 56 list<Signal*>::iterator i 64 list<Signal*>::iterator i = _list_signal->begin(); 57 65 58 66 while (i != _list_signal->end()) … … 64 72 65 73 delete _list_signal; 74 75 #ifdef VHDL_TESTBENCH 76 delete _list_cycle ; 77 #endif 78 66 79 log_printf(FUNC,Behavioural,"~Interface","End"); 67 80 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_get_signal.cpp
r38 r40 15 15 { 16 16 log_printf(FUNC,Behavioural,"get_signal","Begin"); 17 17 18 uint32_t depth = 0; 18 19 string separator = ",\n"; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_print.cpp
r38 r40 19 19 output_stream << x.get_comment() << endl; 20 20 output_stream << x.get_signal () << endl; 21 22 #ifdef VHDL_TESTBENCH 23 if (x._list_cycle->empty()== false) 24 { 25 list<string>::iterator i = x._list_cycle->begin(); 26 27 while (i != x._list_cycle->end()) 28 { 29 output_stream << "\n\t" << *i ; 30 ++i; 31 } 32 } 33 #endif 34 21 35 log_printf(FUNC,Behavioural,"operator<<","End"); 22 36 return output_stream; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp
r38 r40 1 #ifdef VHDL2 1 /* 3 2 * $Id$ … … 13 12 namespace behavioural { 14 13 14 #ifdef VHDL 15 15 void Interface::set_port (Vhdl * & vhdl) 16 16 { … … 31 31 log_printf(FUNC,Behavioural,"set_port (Vhdl)","End"); 32 32 }; 33 #endif 33 34 35 #ifdef VHDL_TESTBENCH 34 36 void Interface::set_port (Vhdl_Testbench * & vhdl_testbench) 35 37 { … … 50 52 log_printf(FUNC,Behavioural,"set_port (Testbench)","End"); 51 53 }; 52 54 #endif 53 55 }; // end namespace behavioural 54 56 }; // end namespace morpheo 55 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp
r38 r40 6 6 */ 7 7 8 #include "Include/ChangeCase.h"9 8 #include "Behavioural/include/Interface.h" 10 9 … … 18 17 { 19 18 log_printf(FUNC,Behavioural,"set_signal","Begin"); 20 string str_direction = toString(direction);21 string str_interface = _name;22 string str_signal = name;23 19 24 LowerCase(str_direction); 25 UpperCase(str_interface); 26 UpperCase(str_signal ); 27 28 string signame = str_direction; 29 if (_name != "") 30 signame += "_"+str_interface; 31 if (name != "") 32 signame += "_"+str_signal; 20 string signame = signal_name(_name, name, direction); 33 21 34 22 Signal * sig = new Signal (signame , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_testbench.cpp
r38 r40 12 12 namespace morpheo { 13 13 namespace behavioural { 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 } 14 20 15 21 void Interface::testbench (Vhdl_Testbench * & vhdl_testbench) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
r38 r40 14 14 { 15 15 log_printf(FUNC,Behavioural,"Interfaces","Begin"); 16 _list_interface = new list<Interface *>;16 _list_interface = new list<Interface_fifo*>; 17 17 log_printf(FUNC,Behavioural,"Interfaces","End"); 18 18 }; … … 31 31 if (_list_interface->empty()== false) 32 32 { 33 list<Interface *>::iterator i = _list_interface->begin();33 list<Interface_fifo*>::iterator i = _list_interface->begin(); 34 34 35 35 while (i != _list_interface->end()) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_find_interface.cpp
r38 r40 11 11 namespace behavioural { 12 12 13 Interface * Interfaces::find_interface (string name)13 Interface_fifo * Interfaces::find_interface (string name) 14 14 { 15 15 if (_list_interface->empty()== false) 16 16 { 17 list<Interface *>::iterator i = _list_interface->begin();17 list<Interface_fifo*>::iterator i = _list_interface->begin(); 18 18 19 19 while (i != _list_interface->end()) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_get_interface.cpp
r38 r40 18 18 bool last_separator = false; 19 19 20 list<Interface *>::iterator i = _list_interface->begin();20 list<Interface_fifo*>::iterator i = _list_interface->begin(); 21 21 bool empty = _list_interface->empty(); 22 22 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_interface.cpp
r38 r40 11 11 namespace behavioural { 12 12 13 Interface * Interfaces::set_interface (string name ,13 Interface_fifo * Interfaces::set_interface (string name , 14 14 direction_t direction , 15 15 localisation_t localisation) 16 16 { 17 Interface * interface = new Interface(name, direction, localisation);17 Interface_fifo * interface = new Interface_fifo (name, direction, localisation); 18 18 19 19 _list_interface->push_back (interface); … … 22 22 }; 23 23 24 Interface * Interfaces::set_interface (string name ,24 Interface_fifo * Interfaces::set_interface (string name , 25 25 direction_t direction , 26 26 localisation_t localisation, 27 27 string comment ) 28 28 { 29 Interface * interface = set_interface(name, direction, localisation);29 Interface_fifo * interface = set_interface(name, direction, localisation); 30 30 31 31 interface->set_comment (comment); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp
r38 r40 1 #ifdef VHDL2 1 /* 3 2 * $Id$ … … 13 12 namespace behavioural { 14 13 14 #ifdef VHDL 15 15 void Interfaces::set_port (Vhdl * & vhdl) 16 16 { 17 17 if (not _list_interface->empty()) 18 18 { 19 list<Interface *>::iterator i = _list_interface->begin();19 list<Interface_fifo*>::iterator i = _list_interface->begin(); 20 20 21 21 while (i != _list_interface->end()) … … 26 26 } 27 27 }; 28 #endif 28 29 30 31 #ifdef VHDL_TESTBENCH 29 32 void Interfaces::set_port (Vhdl_Testbench * & vhdl_testbench) 30 33 { 31 34 if (not _list_interface->empty()) 32 35 { 33 list<Interface *>::iterator i = _list_interface->begin();36 list<Interface_fifo*>::iterator i = _list_interface->begin(); 34 37 35 38 while (i != _list_interface->end()) … … 40 43 } 41 44 }; 45 #endif 42 46 43 47 }; // end namespace behavioural 44 48 }; // end namespace morpheo 45 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench.cpp
r38 r40 19 19 if (_list_interface->empty()== false) 20 20 { 21 list<Interface *>::iterator i = _list_interface->begin();21 list<Interface_fifo*>::iterator i = _list_interface->begin(); 22 22 23 23 while (i != _list_interface->end()) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_toXML.cpp
r38 r40 17 17 if (_list_interface->empty()== false) 18 18 { 19 list<Interface *>::iterator i = _list_interface->begin();19 list<Interface_fifo*>::iterator i = _list_interface->begin(); 20 20 21 21 while (i != _list_interface->end()) … … 36 36 if (_list_interface->empty()== false) 37 37 { 38 list<Interface *>::iterator i = _list_interface->begin();38 list<Interface_fifo*>::iterator i = _list_interface->begin(); 39 39 40 40 while (i != _list_interface->end()) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp
r38 r40 22 22 log_printf(FUNC,Behavioural,"Signal","Begin"); 23 23 #ifdef VHDL_TESTBENCH 24 _signal = NULL; 25 _type_info = UNKNOW; 24 _signal = NULL; 25 _type_info = UNKNOW; 26 _list_value = new list<string>; 26 27 #endif 27 28 log_printf(FUNC,Behavioural,"Signal","End"); … … 36 37 log_printf(FUNC,Behavioural,"Signal (copy)","Begin"); 37 38 #ifdef VHDL_TESTBENCH 38 _signal = signal._signal ; 39 _type_info = signal._type_info; 39 _signal = signal._signal ; 40 _type_info = signal._type_info ; 41 _list_value = signal._list_value; 40 42 #endif 41 43 log_printf(FUNC,Behavioural,"Signal (copy)","End"); … … 45 47 { 46 48 log_printf(FUNC,Behavioural,"~Signal","Begin"); 49 #ifdef VHDL_TESTBENCH 50 delete _list_value; 51 #endif 47 52 log_printf(FUNC,Behavioural,"~Signal","End"); 48 53 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_print.cpp
r38 r40 9 9 10 10 namespace morpheo { 11 12 13 14 11 namespace behavioural { 15 12 … … 22 19 output_stream << "\t{" << x._size << "}\t" 23 20 << toString(x._direction) << "\t" 24 << toString(x._presence_port)<< endl; 21 << toString(x._presence_port); 22 23 // #ifdef VHDL_TESTBENCH 24 // if (x._list_value->empty()== false) 25 // { 26 // list<string>::iterator i = x._list_value->begin(); 27 28 // while (i != x._list_value->end()) 29 // { 30 // output_stream << "\n\t" << *i ; 31 // ++i; 32 // } 33 // } 34 // #endif 25 35 26 36 log_printf(FUNC,Behavioural,"operator<<","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench.cpp
r38 r40 20 20 (_presence_port == PORT_VHDL_NO_TESTBENCH_YES)) 21 21 { 22 string str; 23 22 24 switch (_type_info) 23 25 { 24 26 case BOOL : 25 27 { 28 bool value = read <bool> (); 29 26 30 switch (_direction) 27 31 { 28 case IN : {vhdl_testbench->add_input (static_cast<sc_in <bool > *>(_signal)->read()); break; } 29 case OUT : {vhdl_testbench->add_output(static_cast<sc_out <bool > *>(_signal)->read()); break; } 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;} 30 36 case INOUT : {break;} 31 37 } … … 34 40 case UINT8_T : 35 41 { 42 uint8_t value = read <uint8_t> (); 43 36 44 switch (_direction) 37 45 { 38 case IN : {vhdl_testbench->add_input (static_cast<sc_in <uint8_t > *>(_signal)->read()); break; } 39 case OUT : {vhdl_testbench->add_output(static_cast<sc_out <uint8_t > *>(_signal)->read()); break; } 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;} 40 50 case INOUT : {break;} 41 51 } … … 44 54 case UINT16_T : 45 55 { 56 uint16_t value = read <uint16_t> (); 57 46 58 switch (_direction) 47 59 { 48 case IN : {vhdl_testbench->add_input (static_cast<sc_in <uint16_t> *>(_signal)->read()); break; } 49 case OUT : {vhdl_testbench->add_output(static_cast<sc_out <uint16_t> *>(_signal)->read()); break; } 50 case INOUT : {break;} 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;} 51 65 } 52 66 break; … … 54 68 case UINT32_T : 55 69 { 70 uint32_t value = read <uint32_t> (); 71 56 72 switch (_direction) 57 73 { 58 case IN : {vhdl_testbench->add_input (static_cast<sc_in <uint32_t> *>(_signal)->read()); break; } 59 case OUT : {vhdl_testbench->add_output(static_cast<sc_out <uint32_t> *>(_signal)->read()); break; } 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;} 60 78 case INOUT : {break;} 61 79 } … … 64 82 case UINT64_T : 65 83 { 84 uint64_t value = read <uint64_t> (); 85 66 86 switch (_direction) 67 87 { 68 case IN : {vhdl_testbench->add_input (static_cast<sc_in <uint64_t> *>(_signal)->read()); break; } 69 case OUT : {vhdl_testbench->add_output(static_cast<sc_out <uint64_t> *>(_signal)->read()); break; } 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;} 70 92 case INOUT : {break;} 71 93 } … … 76 98 } 77 99 100 _list_value->push_back(str); 78 101 } 79 102 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_Testbench.cpp
r2 r40 13 13 namespace behavioural { 14 14 15 Vhdl_Testbench::Vhdl_Testbench (string name ): 16 _name (name ) 15 Vhdl_Testbench::Vhdl_Testbench (string name , 16 bool exhaustive ): 17 _name (name ), 18 _exhaustive (exhaustive ) 17 19 { 18 20 _vhdl = new Vhdl (_name + "_Testbench"); … … 26 28 Vhdl_Testbench::~Vhdl_Testbench () 27 29 { 30 delete _vhdl; 28 31 }; 29 32
Note: See TracChangeset
for help on using the changeset viewer.