Changeset 44 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- Jul 17, 2007, 4:47:56 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 3 added
- 8 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_interface_map.cpp
r43 r44 27 27 28 28 if (entity_dest == NULL) 29 throw (ErrorMorpheo (" Component \""+name_entity+"\", port map with unknow component \""+component_dest+"\"."));29 throw (ErrorMorpheo ("<Component::interface_map> Component \""+name_entity+"\", port map with unknow component \""+component_dest+"\".")); 30 30 31 31 bool is_top_level_dest = (name_entity == component_dest); … … 34 34 35 35 if (interface_dest == NULL) 36 throw (ErrorMorpheo (" Component \""+name_entity+"\", port map with component \""+component_dest+"\" and a unknow interface \""+port_dest+"\"."));36 throw (ErrorMorpheo ("<Component::interface_map> Component \""+name_entity+"\", port map with component \""+component_dest+"\" and a unknow interface \""+port_dest+"\".")); 37 37 38 38 // Second entity … … 40 40 41 41 if (entity_src == NULL) 42 throw (ErrorMorpheo (" Component \""+name_entity+"\", port map with unknow component \""+component_src+"\"."));42 throw (ErrorMorpheo ("<Component::interface_map> Component \""+name_entity+"\", port map with unknow component \""+component_src+"\".")); 43 43 44 44 bool is_top_level_src = (name_entity == component_src); … … 47 47 48 48 if (interface_src == NULL) 49 throw (ErrorMorpheo (" Component \""+name_entity+"\", port map with component \""+component_src+"\" and a unknow interface \""+port_src+"\"."));49 throw (ErrorMorpheo ("<Component::interface_map> Component \""+name_entity+"\", port map with component \""+component_src+"\" and a unknow interface \""+port_src+"\".")); 50 50 51 51 // all is ok - link -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp
r43 r44 45 45 46 46 // If all is ok, mapping 47 48 //cout << " - " << entity_src->get_name() << "("<< signal_src->get_name() << ")" << "\t-> " << entity_dest->get_name() << "(" << signal_dest->get_name() << ")" << endl; 47 log_printf(TRACE,Behavioural,FUNCTION, "Signal \"%s.%s\"\tlink with \"%s.%s\"" 48 ,entity_src ->get_name().c_str() 49 ,signal_src ->get_name().c_str() 50 ,entity_dest->get_name().c_str() 51 ,signal_dest->get_name().c_str()); 49 52 50 signal_src ->link (signal_dest );53 signal_src ->link (signal_dest, entity_dest == _entity); 51 54 //signal_dest->mapping(signal_src ); 52 55 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp
r43 r44 20 20 uint32_t cpt = 0; 21 21 map<Signal *,string> tab; 22 23 // buffer all output 24 { 25 vhdl->set_body ("------------------------------------------------------"); 26 vhdl->set_body ("-- Output's Buffer"); 27 vhdl->set_body ("------------------------------------------------------"); 28 29 // for each interface 30 list<Interface_fifo *> * list_interface = (_entity)->get_interfaces_list()->get_interface_list(); 31 list<Interface_fifo *>::iterator j = list_interface->begin(); 32 if (not list_interface->empty()) 33 { 34 while (j != list_interface->end()) 35 { 36 // for each signal 37 list<Signal *> * list_signal = (*j)->get_signal_list(); 38 list<Signal *>::iterator k = list_signal->begin(); 39 if (not list_signal->empty()) 40 { 41 while (k != list_signal->end()) 42 { 43 Signal * signal = (*k); 44 45 // test if is connect with external interface or with an another component AND if this port is mapped. 46 if ( (signal->get_direction() == OUT) and 47 (signal->get_connect_from_signal () != NULL) ) 48 { 49 // Create name 50 string signal_name = "signal_"+toString(cpt++); 51 52 tab [signal ] = signal_name; 53 tab [signal->get_connect_from_signal()] = signal_name; 54 55 // Add a new signal and the affectation 56 vhdl->set_signal (signal_name, signal->get_size()); 57 vhdl->set_body (signal->get_name()+" <= "+signal_name+";"); 58 } 59 else 60 { 61 tab [signal ] = signal->get_name(); 62 } 63 ++k; 64 } 65 } 66 ++j; 67 } 68 } 69 vhdl->set_body (""); 70 vhdl->set_body ("------------------------------------------------------"); 71 vhdl->set_body (""); 72 } 22 73 23 74 vhdl->set_library_work (_entity->get_name() + "_Pack"); … … 50 101 // test if is connect with external interface or with an another component. 51 102 Signal * signal_src = (*k); 103 52 104 if (signal_src->presence_vhdl () == true) 53 105 { 54 Signal * signal_dest = (*k)->get_signal_link();106 Signal * signal_dest = signal_src->get_connect_to_signal(); 55 107 string name_src = signal_src->get_name(); 56 108 string name_dest; 57 109 58 if (_entity->find_signal(signal_dest) == false) 59 { 110 // // Test if destination signal is a interface port ? 111 // if (_entity->find_signal(signal_dest) == false) 112 // { 60 113 // find if signal is already link 61 map<Signal *,string>::iterator it = tab.find(signal_ src);62 if (tab.find(signal_ src) == tab.end())114 map<Signal *,string>::iterator it = tab.find(signal_dest); 115 if (tab.find(signal_dest) == tab.end()) 63 116 { 64 117 // Create name … … 72 125 } 73 126 else 74 name_dest = (*it).second; 75 } 76 else 77 name_dest = signal_dest->get_name(); 127 { 128 // find !!!! 129 name_dest = (*it).second; 130 tab [signal_src ] = name_dest; 131 } 132 // } 133 // else 134 // { 135 // cout << "Kane à dit : " << signal_dest->get_name() << endl; 136 // // Test if output 137 // if (signal_dest->get_direction() == OUT) 138 // { 139 // // Take buffer's signal 140 // map<Signal *,string>::iterator it = tab.find(signal_dest); 141 // name_dest = (*it).second; 142 143 // cout << " * OUT - name : " << name_dest << endl; 144 // } 145 // else 146 // { 147 // name_dest = signal_dest->get_name(); 148 // cout << " * IN - name : " << name_dest << endl; 149 // } 150 // } 78 151 79 152 vhdl->set_body_component_port_map (list_port_map, name_src, name_dest); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_signal_name.cpp
r40 r44 7 7 8 8 #include "Behavioural/include/Interface.h" 9 #include " Include/ChangeCase.h"9 #include "Common/include/ChangeCase.h" 10 10 11 11 namespace morpheo { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench_generate_file.cpp
r42 r44 87 87 vhdl->set_body("\t\t\t"+counter+" <= "+counter+"+1;"); 88 88 vhdl->set_body(""); 89 vhdl->set_body("\t\t\tassert not ("+counter+" = "+toString(cycle)+") report \"Test OK\" severity FAILURE;");89 vhdl->set_body("\t\t\tassert not ("+counter+" >= "+toString(cycle)+") report \"Test OK\" severity FAILURE;"); 90 90 vhdl->set_body("\t\t\tassert not ("+test_name+" = '0') report \"Test KO\" severity FAILURE;"); 91 91 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp
r42 r44 23 23 _is_allocate = false; 24 24 _is_map = false; 25 _signal = NULL; 25 _connect_from_signal = NULL; 26 _connect_to_signal = NULL; 26 27 _sc_signal = NULL; 27 28 _sc_signal_map = NULL; … … 42 43 _is_allocate= signal._is_allocate; 43 44 _is_map = signal._is_map ; 45 _connect_from_signal = signal._connect_from_signal; 46 _connect_to_signal = signal._connect_to_signal; 44 47 _sc_signal = signal._sc_signal ; 45 48 _sc_signal_map = signal._sc_signal_map; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_connect_to_signal.cpp
r43 r44 13 13 14 14 #undef FUNCTION 15 #define FUNCTION "Signal::get_ signal_link"16 Signal * Signal::get_ signal_link(void)15 #define FUNCTION "Signal::get_connect_to_signal" 16 Signal * Signal::get_connect_to_signal (void) 17 17 { 18 18 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 Signal * _return = _ signal;19 Signal * _return = _connect_to_signal; 20 20 log_printf(FUNC,Behavioural,FUNCTION,"End"); 21 21 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp
r43 r44 14 14 #undef FUNCTION 15 15 #define FUNCTION "Signal::link" 16 void Signal::link (Signal * signal) 16 void Signal::link (Signal * signal, 17 bool is_port_component) 17 18 { 18 19 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 20 20 21 if ( _is_allocate == false) 21 throw (ErrorMorpheo (" Signal \""+_name+"\", can't map with signal \""+ get_name()+"\", because it's not already allocate."));22 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+ get_name()+"\", because it's not already allocate.")); 22 23 if (signal->_is_allocate == false) 23 throw (ErrorMorpheo ("Signal \""+_name+"\", can't map with signal \""+signal->get_name()+"\", because it's not already allocate.")); 24 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+signal->get_name()+"\", because it's not already allocate.")); 25 if (_is_map == true) 26 throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal->get_name()+"\", because it's already map.")); 24 27 25 _signal = signal;26 28 27 if ((_direction == IN ) and (signal->_direction == IN )) 28 switch (_type_info) 29 { 30 case BOOL : {(*(static_cast<sc_in <bool > *>(_sc_signal))) (*(static_cast<sc_in <bool > *>(signal->_sc_signal))); break;} 31 case UINT8_T : {(*(static_cast<sc_in <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in <uint8_t > *>(signal->_sc_signal))); break;} 32 case UINT16_T : {(*(static_cast<sc_in <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in <uint16_t> *>(signal->_sc_signal))); break;} 33 case UINT32_T : {(*(static_cast<sc_in <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in <uint32_t> *>(signal->_sc_signal))); break;} 34 case UINT64_T : {(*(static_cast<sc_in <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in <uint64_t> *>(signal->_sc_signal))); break;} 35 default : {throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); break;} 36 } 37 else 38 if ((_direction == OUT) and (signal->_direction == OUT)) 39 { 40 signal->_sc_signal_map = _sc_signal_map; 29 // List of all case 30 // 31 // dest src dest src 32 // PORT {IN } ----- {SIG} COMBI 33 // PORT {OUT} ----- {SIG} COMBI 34 // 35 // PORT {IN } --X-- {OUT} COMPONENT {IN } ----- {OUT} COMPONENT 36 // PORT {IN } ----- {IN } COMPONENT {IN } --X-- {IN } COMPONENT 37 // PORT {OUT} ----- {OUT} COMPONENT {OUT} --X-- {OUT} COMPONENT 38 // PORT {OUT} --X-- {IN } COMPONENT {OUT} ----- {IN } COMPONENT 41 39 42 switch (_type_info) 43 { 44 case BOOL : {(*(static_cast<sc_out <bool > *>(_sc_signal))) (*(static_cast<sc_out <bool > *>(signal->_sc_signal))); break;} 45 case UINT8_T : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;} 46 case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;} 47 case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;} 48 case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;} 49 default : {throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); break;} 50 } 51 } 52 else 53 if ((_direction == IN ) and (signal->_direction == OUT)) 54 switch (_type_info) 55 { 56 case BOOL : {(*(static_cast<sc_in <bool > *>(_sc_signal))) (*(static_cast<sc_out <bool > *>(signal->_sc_signal))); break;} 57 case UINT8_T : {(*(static_cast<sc_in <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;} 58 case UINT16_T : {(*(static_cast<sc_in <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;} 59 case UINT32_T : {(*(static_cast<sc_in <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;} 60 case UINT64_T : {(*(static_cast<sc_in <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;} 61 default : {throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); break;} 62 } 63 else 64 if ((_direction == OUT) and (signal->_direction == IN )) 40 // log_printf(TRACE,Behavioural,FUNCTION, "Signal \"%s\"\tlink with \"%s\"", _name.c_str(), signal->get_name().c_str()); 41 42 log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (before) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal->_sc_signal_map)); 43 44 _connect_to_signal = signal; 45 signal->_connect_from_signal = this; 46 47 if (is_port_component == true) 48 { 49 if ((_direction == IN ) and (signal->_direction == IN )) 50 { 65 51 switch (_type_info) 66 52 { 67 case BOOL : {(*(static_cast<sc_ out<bool > *>(_sc_signal))) (*(static_cast<sc_in <bool > *>(signal->_sc_signal))); break;}68 case UINT8_T : {(*(static_cast<sc_ out<uint8_t > *>(_sc_signal))) (*(static_cast<sc_in <uint8_t > *>(signal->_sc_signal))); break;}69 case UINT16_T : {(*(static_cast<sc_ out<uint16_t> *>(_sc_signal))) (*(static_cast<sc_in <uint16_t> *>(signal->_sc_signal))); break;}70 case UINT32_T : {(*(static_cast<sc_ out<uint32_t> *>(_sc_signal))) (*(static_cast<sc_in <uint32_t> *>(signal->_sc_signal))); break;}71 case UINT64_T : {(*(static_cast<sc_ out<uint64_t> *>(_sc_signal))) (*(static_cast<sc_in <uint64_t> *>(signal->_sc_signal))); break;}72 default : {throw (ErrorMorpheo (" Signal \""+_name+"\" : type unknow.")); break;}53 case BOOL : {(*(static_cast<sc_in <bool > *>(_sc_signal))) (*(static_cast<sc_in <bool > *>(signal->_sc_signal))); break;} 54 case UINT8_T : {(*(static_cast<sc_in <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in <uint8_t > *>(signal->_sc_signal))); break;} 55 case UINT16_T : {(*(static_cast<sc_in <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in <uint16_t> *>(signal->_sc_signal))); break;} 56 case UINT32_T : {(*(static_cast<sc_in <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in <uint32_t> *>(signal->_sc_signal))); break;} 57 case UINT64_T : {(*(static_cast<sc_in <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in <uint64_t> *>(signal->_sc_signal))); break;} 58 default : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;} 73 59 } 74 else 75 throw (ErrorMorpheo ("Signal \""+_name+"\" : unsupported direction to link.")); 60 } 61 else 62 { 63 if ((_direction == OUT) and (signal->_direction == OUT)) 64 { 65 _is_map = true; 66 signal->_sc_signal_map = _sc_signal_map; 67 68 switch (_type_info) 69 { 70 case BOOL : {(*(static_cast<sc_out <bool > *>(_sc_signal))) (*(static_cast<sc_out <bool > *>(signal->_sc_signal))); break;} 71 case UINT8_T : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;} 72 case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;} 73 case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;} 74 case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;} 75 default : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;} 76 } 77 } 78 else 79 { 80 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal->get_name()+"\" : between two components, illegal direction ("+toString(_direction)+" with "+toString(signal->_direction)+").")); 81 } 82 } 83 } 84 else 85 { 86 if ((_direction == IN ) and (signal->_direction == OUT)) 87 { 88 switch (_type_info) 89 { 90 case BOOL : {(*(static_cast<sc_in <bool > *>(_sc_signal))) (*(static_cast<sc_out <bool > *>(signal->_sc_signal))); break;} 91 case UINT8_T : {(*(static_cast<sc_in <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;} 92 case UINT16_T : {(*(static_cast<sc_in <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;} 93 case UINT32_T : {(*(static_cast<sc_in <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;} 94 case UINT64_T : {(*(static_cast<sc_in <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;} 95 default : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;} 96 } 97 } 98 else 99 { 100 if ((_direction == OUT) and (signal->_direction == IN )) 101 { 102 _is_map = true; 103 switch (_type_info) 104 { 105 case BOOL : {(*(static_cast<sc_out <bool > *>(_sc_signal))) (*(static_cast<sc_in <bool > *>(signal->_sc_signal))); break;} 106 case UINT8_T : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in <uint8_t > *>(signal->_sc_signal))); break;} 107 case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in <uint16_t> *>(signal->_sc_signal))); break;} 108 case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in <uint32_t> *>(signal->_sc_signal))); break;} 109 case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in <uint64_t> *>(signal->_sc_signal))); break;} 110 default : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;} 111 } 112 } 113 else 114 { 115 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal->get_name()+"\" : between a interface's port and one component, illegal direction ("+toString(_direction)+" with "+toString(signal->_direction)+").")); 116 } 117 } 118 } 76 119 120 log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (after ) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal->_sc_signal_map)); 77 121 log_printf(FUNC,Behavioural,FUNCTION,"End"); 78 122 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_mapping.cpp
r43 r44 12 12 namespace behavioural { 13 13 14 #undef FUNCTION15 #define FUNCTION "Signal::mapping"16 void Signal::mapping (Signal * signal)17 {18 log_printf(FUNC,Behavioural,FUNCTION,"Begin");14 // #undef FUNCTION 15 // #define FUNCTION "Signal::mapping" 16 // void Signal::mapping (Signal * signal) 17 // { 18 // log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 19 19 20 if (_is_map == true)21 throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal->get_name()+"\", because it's already map."));20 // if (_is_map == true) 21 // throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal->get_name()+"\", because it's already map.")); 22 22 23 if (signal->_is_allocate == false)24 throw (ErrorMorpheo ("<Signal::mapping> Signal \""+_name+"\", can't map with signal \""+signal->get_name()+"\", because it's not already allocate."));23 // if (signal->_is_allocate == false) 24 // throw (ErrorMorpheo ("<Signal::mapping> Signal \""+_name+"\", can't map with signal \""+signal->get_name()+"\", because it's not already allocate.")); 25 25 26 if (_direction == OUT)27 {28 // This output is mapped29 _is_map = true;26 // if (_direction == OUT) 27 // { 28 // // This output is mapped 29 // _is_map = true; 30 30 31 if (signal->_direction == OUT)32 _sc_signal_map = signal->_sc_signal_map;33 }31 // if (signal->_direction == OUT) 32 // _sc_signal_map = signal->_sc_signal_map; 33 // } 34 34 35 log_printf(FUNC,Behavioural,FUNCTION,"End");36 };35 // log_printf(FUNC,Behavioural,FUNCTION,"End"); 36 // }; 37 37 38 38 }; // end namespace behavioural
Note: See TracChangeset
for help on using the changeset viewer.