Changeset 113 for trunk/IPs/systemC/processor/Morpheo/Behavioural/include
- Timestamp:
- Apr 14, 2009, 8:39:12 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/include
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h
r112 r113 101 101 #define PRINT_SIZE_NUL(component,interface,signal) log_printf(TRACE,Allocation,FUNCTION,_("<%s> %s.%s.%s : size is nul."),_name.c_str(),component->get_name().c_str(),interface->get_name().c_str(),signal); 102 102 #define TEST_SIGNAL(name,address) PRINT_SIGNAL_ADDRESS(name,address); TEST_PTR(address) 103 #define INSTANCE_FOREIGN_PRINT(name) log_printf(TRACE,Allocation,FUNCTION,"<%s> : %s (%s, %d)",_name.c_str(),name,__FILE__,__LINE__); 103 104 104 105 // ---------------------------------------------------------------------- … … 106 107 // ---------------------------------------------------------------------- 107 108 108 109 #define __ALLOC0_SIGNAL(sig, name, type) \ 109 #define __ALLOC0_SIGNAL(sig, name, type) \ 110 110 { \ 111 111 sig = new type (name); \ … … 113 113 114 114 #ifdef POSITION 115 #define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str) 115 #define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str) \ 116 116 INTERFACE_PRINT(name); \ 117 117 morpheo::behavioural::Interface_fifo * interface = _interfaces->set_interface( name, direction, localisation, str); 118 118 #else 119 #define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str) 119 #define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str) \ 120 120 INTERFACE_PRINT(name); \ 121 121 morpheo::behavioural::Interface_fifo * interface = _interfaces->set_interface( name); … … 124 124 #define ALLOC0_INTERFACE_END() 125 125 126 #define ALLOC0_VAL_ACK_IN( sig, name, type) 126 #define ALLOC0_VAL_ACK_IN( sig, name, type) \ 127 127 { \ 128 128 sig = interface->set_signal_valack_in (name, type); \ 129 129 } 130 #define ALLOC0_VAL_ACK_OUT( sig, name, type) 130 #define ALLOC0_VAL_ACK_OUT( sig, name, type) \ 131 131 { \ 132 132 sig = interface->set_signal_valack_out(name, type); \ 133 133 } 134 #define ALLOC0_VALACK_IN( sig, type) 134 #define ALLOC0_VALACK_IN( sig, type) \ 135 135 { \ 136 136 sig = interface->set_signal_valack_in (type); \ … … 160 160 } 161 161 162 #define DELETE0_SIGNAL( sig, size) 162 #define DELETE0_SIGNAL( sig, size) \ 163 163 if (size > 0) \ 164 164 { \ … … 166 166 } 167 167 168 #define ALLOC0_SC_SIGNAL( sig, name, type) \ 169 sc_signal<type> * sig = new sc_signal<type> (name); \ 168 #define ALLOC0_FOREIGN_SIGNAL_IN( sig, interface, name, type, size) \ 169 if (size > 0) \ 170 { \ 171 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \ 172 sig = new SC_IN (type) (str.c_str()); \ 173 } 174 175 #define ALLOC0_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size) \ 176 if (size > 0) \ 177 { \ 178 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \ 179 sig = new SC_OUT (type) (str.c_str()); \ 180 } 181 182 #define DELETE0_FOREIGN_SIGNAL( sig, size) \ 183 { \ 184 DELETE0_SIGNAL(sig,size); \ 185 } 186 187 #define INSTANCE0_FOREIGN_SIGNAL(component, sig, type, name, size) \ 188 if (size > 0) \ 189 { \ 190 INSTANCE_FOREIGN_PRINT(name); \ 191 _component->set_sc_signal<type>(_name,name,static_cast<void*>(component->sig)); \ 192 } 193 194 #define ALLOC0_SC_SIGNAL( sig, name, type) \ 195 sig = new sc_signal<type> (name); \ 170 196 PRINT_SIGNAL_ADDRESS(name,sig); 171 197 172 #define INSTANCE0_SC_SIGNAL(component, sig) 198 #define INSTANCE0_SC_SIGNAL(component, sig) \ 173 199 { \ 174 200 TEST_SIGNAL(component->sig->name(),component->sig); \ … … 177 203 } 178 204 179 #define _INSTANCE0_SC_SIGNAL(component, sig1,sig2) 205 #define _INSTANCE0_SC_SIGNAL(component, sig1,sig2) \ 180 206 { \ 181 207 TEST_SIGNAL(component->sig1->name(),component->sig1); \ … … 185 211 186 212 #define DELETE0_SC_SIGNAL( sig) \ 187 { \ 188 delete sig; \ 213 { \ 214 PRINT_SIGNAL_ADDRESS("",sig); \ 215 delete sig; \ 189 216 } 190 217 … … 326 353 } 327 354 355 #define ALLOC1_FOREIGN_SIGNAL_IN(sig, interface, name, type, size,x1) \ 356 { \ 357 sig = new SC_IN (type) * [x1]; \ 358 for (uint32_t it1=0; it1<x1; it1++) \ 359 if (size > 0) \ 360 { \ 361 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \ 362 sig [it1] = new SC_IN (type) (str.c_str()); \ 363 } \ 364 } 365 366 #define ALLOC1_FOREIGN_SIGNAL_OUT(sig, interface, name, type, size,x1) \ 367 { \ 368 sig = new SC_OUT (type) * [x1]; \ 369 for (uint32_t it1=0; it1<x1; it1++) \ 370 if (size > 0) \ 371 { \ 372 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \ 373 sig [it1] = new SC_OUT (type) (str.c_str()); \ 374 } \ 375 } 376 377 #define DELETE1_FOREIGN_SIGNAL( sig, size,x1) \ 378 { \ 379 DELETE1_SIGNAL(sig,x1,size); \ 380 } 381 328 382 #define ALLOC1_SC_SIGNAL( sig, name, type, x1) \ 329 s c_signal<type> ** sig = new sc_signal<type> * [x1];\383 sig = new sc_signal<type> * [x1]; \ 330 384 { \ 331 385 std::string separator="_"; \ … … 359 413 for (uint32_t it1=0; it1<x1; it1++) \ 360 414 { \ 415 PRINT_SIGNAL_ADDRESS("",sig[it1]); \ 361 416 delete sig[it1]; \ 362 417 } \ … … 530 585 } 531 586 587 588 #define ALLOC2_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2) \ 589 { \ 590 sig = new SC_IN (type) ** [x1]; \ 591 for (uint32_t it1=0; it1<x1; it1++) \ 592 { \ 593 sig [it1] = new SC_IN (type) * [x2]; \ 594 for (uint32_t it2=0; it2<x2; it2++) \ 595 if (size > 0) \ 596 { \ 597 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \ 598 sig [it1][it2] = new SC_IN (type) (str.c_str()); \ 599 } \ 600 } \ 601 } 602 603 #define ALLOC2_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2) \ 604 { \ 605 sig = new SC_OUT (type) ** [x1]; \ 606 for (uint32_t it1=0; it1<x1; it1++) \ 607 { \ 608 sig [it1] = new SC_OUT (type) * [x2]; \ 609 for (uint32_t it2=0; it2<x2; it2++) \ 610 if (size > 0) \ 611 { \ 612 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \ 613 sig [it1][it2] = new SC_IN (type) (str.c_str()); \ 614 } \ 615 } \ 616 } 617 618 #define DELETE2_FOREIGN_SIGNAL( sig, size,x1,x2) \ 619 { \ 620 DELETE2_SIGNAL(sig,x1,x2,size); \ 621 } 622 532 623 #define ALLOC2_SC_SIGNAL( sig, name, type, x1, x2) \ 533 s c_signal<type> *** sig = new sc_signal<type> ** [x1];\624 sig = new sc_signal<type> ** [x1]; \ 534 625 { \ 535 626 std::string separator="_"; \ … … 571 662 for (uint32_t it2=0; it2<x2; it2++) \ 572 663 { \ 664 PRINT_SIGNAL_ADDRESS("",sig[it1][it2]); \ 573 665 delete sig[it1][it2]; \ 574 666 } \ … … 758 850 } 759 851 852 #define ALLOC3_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2,x3) \ 853 { \ 854 sig = new SC_IN (type) *** [x1]; \ 855 for (uint32_t it1=0; it1<x1; it1++) \ 856 { \ 857 sig [it1] = new SC_IN (type) ** [x2]; \ 858 for (uint32_t it2=0; it2<x2; it2++) \ 859 { \ 860 sig [it1][it2] = new SC_IN (type) * [x3]; \ 861 for (uint32_t it3=0; it3<x3; it3++) \ 862 if (size > 0) \ 863 { \ 864 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \ 865 sig [it1][it2][it3] = new SC_IN (type) (str.c_str()); \ 866 } \ 867 } \ 868 } \ 869 } 870 871 #define ALLOC3_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2,x3) \ 872 { \ 873 sig = new SC_OUT (type) *** [x1]; \ 874 for (uint32_t it1=0; it1<x1; it1++) \ 875 { \ 876 sig [it1] = new SC_OUT (type) ** [x2]; \ 877 for (uint32_t it2=0; it2<x2; it2++) \ 878 { \ 879 sig [it1][it2] = new SC_OUT (type) * [x3]; \ 880 for (uint32_t it3=0; it3<x3; it3++) \ 881 if (size > 0) \ 882 { \ 883 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \ 884 sig [it1][it2][it3] = new SC_OUT(type) (str.c_str()); \ 885 } \ 886 } \ 887 } \ 888 } 889 890 #define DELETE3_FOREIGN_SIGNAL( sig, size,x1,x2,x3) \ 891 { \ 892 DELETE3_SIGNAL(sig,x1,x2,x3,size); \ 893 } 894 760 895 #define ALLOC3_SC_SIGNAL( sig, name, type, x1, x2, x3) \ 761 s c_signal<type> **** sig = new sc_signal<type> *** [x1];\896 sig = new sc_signal<type> *** [x1]; \ 762 897 { \ 763 898 std::string separator="_"; \ … … 807 942 for (uint32_t it3=0; it3<x3; it3++) \ 808 943 { \ 944 PRINT_SIGNAL_ADDRESS("",sig[it1][it2][it3]); \ 809 945 delete sig[it1][it2][it3]; \ 810 946 } \ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h
r82 r113 72 72 public : Entity * _entity ; 73 73 public : Tinstance_t _instance ; 74 public : std::string _architecture; 74 75 } Tcomponent_t; 75 76 … … 102 103 #endif 103 104 ,Tinstance_t instance=INSTANCE_ALL 105 ,std::string architecture="" 104 106 ); 105 107 … … 116 118 117 119 private : Signal * signal_internal (Entity * entity_productor, 118 Signal * signal_productor); 120 Signal * signal_productor, 121 Entity * entity_consumer, 122 Signal * signal_consumer); 119 123 120 124 public : void port_map (std::string component_src , … … 125 129 public : bool test_map (bool recursive=true); 126 130 private : bool test_map (uint32_t depth, bool recursive); 131 132 public : void * get_sc_signal (std::string component, 133 std::string port ); 134 // public : void set_sc_signal (std::string component, 135 // std::string port , 136 // void * sc_signal); 127 137 128 138 // public : bool test_equi (bool recursive=true); … … 141 151 public : friend std::ostream& operator<< (std::ostream& output_stream, 142 152 morpheo::behavioural::Component & x); 153 154 155 #undef FUNCTION 156 #define FUNCTION "Component::set_sc_signal" 157 public : template <typename T> 158 void set_sc_signal (std::string component, 159 std::string port , 160 void * sc_signal) 161 { 162 log_begin(Behavioural,FUNCTION); 163 164 std::string name_entity = _entity->get_name(); 165 166 Entity * entity = find_entity(component); 167 168 if (entity == NULL) 169 throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", the component \""+component+"\" is unknow.\n")); 170 171 Signal * signal = entity->find_signal (port); 172 173 if (signal == NULL) 174 throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", the component \""+component+"\" have not the signal \""+port+"\".\n")); 175 176 signal->alloc<T>(sc_signal); 177 178 log_end(Behavioural,FUNCTION); 179 }; 143 180 }; 144 181 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h
r82 r113 58 58 public : std::string get_name (void); 59 59 public : std::string get_type (void); 60 public : Tusage_t get_usage (void); 60 61 61 62 #ifdef POSITION -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
r88 r113 91 91 92 92 #ifdef SYSTEMC 93 94 #undef FUNCTION 95 #define FUNCTION "Interface::set_signal_clk" 93 96 public : sc_in_clk * set_signal_clk (std::string name , 94 97 uint32_t size , 95 98 presence_port_t presence_port=CLOCK_VHDL_YES) 96 99 { 97 log_ printf(FUNC,Behavioural,"set_signal_clk","Begin");100 log_begin(Behavioural,FUNCTION); 98 101 99 102 if ((presence_port != CLOCK_VHDL_YES) and … … 101 104 throw ErrorMorpheo ("Signal \""+name+"\" is a clock, bad presence_port."); 102 105 106 LowerCase(name); 107 103 108 Signal * sig = set_signal (name, IN , size, presence_port); 104 109 sc_in_clk * port; 105 110 106 if (_usage & USE_SYSTEMC )111 if (_usage & USE_SYSTEMC_INTERFACE) 107 112 { 108 113 port = new sc_in_clk (sig->_name.c_str()); … … 114 119 } 115 120 116 log_printf(FUNC,Behavioural,"set_signal_clk","End"); 117 118 return port; 119 }; 120 121 log_end(Behavioural,FUNCTION); 122 123 return port; 124 }; 125 126 #undef FUNCTION 127 #define FUNCTION "Interface::set_signal_in" 121 128 public : template <typename T> 122 129 sc_in <T> * set_signal_in (std::string name , … … 124 131 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES) 125 132 { 126 log_ printf(FUNC,Behavioural,"set_signal_in","Begin");133 log_begin(Behavioural,FUNCTION); 127 134 128 135 if ((presence_port == CLOCK_VHDL_YES) or … … 130 137 throw ErrorMorpheo ("Signal \""+name+"\" is not a clock, bad presence_port."); 131 138 139 LowerCase(name); 140 132 141 Signal * sig = set_signal (name, IN , size, presence_port); 133 142 sc_in <T> * port; 134 143 135 if (_usage & USE_SYSTEMC )144 if (_usage & USE_SYSTEMC_INTERFACE) 136 145 { 137 146 port = new sc_in <T> (sig->_name.c_str()); … … 143 152 } 144 153 145 log_printf(FUNC,Behavioural,"set_signal_in","End"); 146 147 return port; 148 }; 149 154 log_end(Behavioural,FUNCTION); 155 156 return port; 157 }; 158 159 #undef FUNCTION 160 #define FUNCTION "Interface::set_signal_out" 150 161 public : template <typename T> 151 162 sc_out <T> * set_signal_out (std::string name , … … 153 164 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES) 154 165 { 155 log_printf(FUNC,Behavioural,"set_signal_out","Begin"); 166 log_begin(Behavioural,FUNCTION); 167 168 LowerCase(name); 156 169 157 170 if ((presence_port == CLOCK_VHDL_YES) or … … 162 175 sc_out <T> * port; 163 176 164 if (_usage & USE_SYSTEMC )177 if (_usage & USE_SYSTEMC_INTERFACE) 165 178 { 166 179 port = new sc_out <T> (sig->_name.c_str()); … … 172 185 } 173 186 174 log_printf(FUNC,Behavioural,"set_signal_out","End"); 175 176 return port; 177 }; 178 187 log_end(Behavioural,FUNCTION); 188 189 return port; 190 }; 191 192 #undef FUNCTION 193 #define FUNCTION "Interface::set_signal_internal" 179 194 public : template <typename T> 180 195 sc_signal <T> * set_signal_internal (std::string name, 181 196 uint32_t size) 182 197 { 183 log_printf(FUNC,Behavioural,"set_signal_internal","Begin"); 198 log_begin(Behavioural,FUNCTION); 199 200 LowerCase(name); 184 201 185 202 Signal * sig = set_signal (name, INTERNAL , size, PORT_VHDL_NO_TESTBENCH_NO); 186 203 sc_signal <T> * port; 187 204 188 if (_usage & USE_SYSTEMC )205 if (_usage & USE_SYSTEMC_INTERFACE) 189 206 { 190 207 port = new sc_signal <T> (sig->_name.c_str()); … … 196 213 } 197 214 198 log_ printf(FUNC,Behavioural,"set_signal_internal","End");215 log_end(Behavioural,FUNCTION); 199 216 200 217 return port; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Model.h
r112 r113 40 40 public : model_type_t get_type (std::string component); 41 41 public : debug_verbosity_t get_debug (std::string component); 42 public : void print (void); 42 43 }; 43 44 44 45 }; // end namespace behavioural 46 47 template<> inline std::string toString<morpheo::behavioural::model_type_t>(const morpheo::behavioural::model_type_t& x) 48 { 49 switch (x) 50 { 51 case morpheo::behavioural::MODEL_SYSTEMC : return "systemc" ; break; 52 case morpheo::behavioural::MODEL_VHDL : return "vhdl" ; break; 53 default : return ""; break; 54 } 55 }; 45 56 46 57 template<> inline morpheo::behavioural::model_type_t fromString<morpheo::behavioural::model_type_t>(const std::string& x) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h
r88 r113 33 33 class Parameters 34 34 { 35 public : const std::string _type; 36 35 37 // -----[ fields ]---------------------------------------------------- 36 38 public : static const uint32_t _size_instruction = 32; … … 127 129 // -----[ methods ]--------------------------------------------------- 128 130 public : Parameters (void); 131 public : Parameters (std::string type); 129 132 public : virtual ~Parameters (); 130 133 … … 132 135 public : virtual std::string print (uint32_t depth) = 0; 133 136 public : virtual Parameters_test msg_error (void) = 0; 137 public : virtual std::string id (void) const {return "";} 134 138 135 139 // methods to copy depends parameters -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
r88 r113 5 5 * $Id$ 6 6 * 7 * [ 7 * [ Description ] 8 8 * 9 9 */ … … 90 90 public : type_info_t get_type_info (void); 91 91 92 public : void * get_sc_signal (void); 93 92 94 public : bool presence_vhdl (void); 93 95 public : bool presence_testbench (void); … … 174 176 else 175 177 _type_info = UNKNOW; 176 178 177 179 log_printf(TRACE,Behavioural,FUNCTION, "Allocation of %s (%s, 0x%.8x)", _name.c_str(),toString(_type_info).c_str(), static_cast<uint32_t>(reinterpret_cast<uint64_t>(_sc_signal_map))); 178 180 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Usage.h
r88 r113 2 2 #define morpheo_behavioural_Usage_h 3 3 4 #include "Common/include/Environment.h" 4 5 #include <stdint.h> 5 6 … … 7 8 namespace behavioural { 8 9 9 typedef uint 8_t Tusage_t;10 typedef uint16_t Tusage_t; 10 11 11 # define USE_SYSTEMC 0x01 12 # define USE_VHDL 0x02 13 # define USE_VHDL_TESTBENCH 0x04 14 # define USE_VHDL_TESTBENCH_ASSERT 0x08 15 # define USE_POSITION 0x10 16 # define USE_STATISTICS 0x20 17 # define USE_INFORMATION 0x40 18 # define USE_HEADER 0x80 19 //#define USE_ 0x80 12 # define USE_SYSTEMC 0x003 13 # define USE_SYSTEMC_INTERFACE 0x001 14 # define USE_SYSTEMC_BODY 0x002 15 # define USE_VHDL 0x004 16 # define USE_VHDL_TESTBENCH 0x008 17 # define USE_VHDL_TESTBENCH_ASSERT 0x010 18 # define USE_POSITION 0x020 19 # define USE_STATISTICS 0x040 20 //#define USE_INFORMATION 0x080 21 # define USE_HEADER 0x100 22 # define USE_COSIMULATION 0x200 23 //#define USE_ 0x400 20 24 21 25 # define USE_NONE 0x00 22 //#define USE_ALL 0xff23 26 # define USE_ALL usage_all() 24 27 25 28 #ifdef MODELSIM_COSIMULATION 29 Tusage_t usage_cosimulation(Tusage_t usage); 30 #endif 26 31 Tusage_t usage_set (Tusage_t usage, Tusage_t flag); 27 32 Tusage_t usage_unset (Tusage_t usage, Tusage_t flag); 28 33 bool usage_is_set (Tusage_t usage, Tusage_t flag); 29 voidusage_environment (Tusage_t usage);34 Tusage_t usage_environment (Tusage_t usage); 30 35 Tusage_t usage_all (void); 31 36 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h
r112 r113 10 10 #define MORPHEO_MAJOR_VERSION "0" 11 11 #define MORPHEO_MINOR_VERSION "2" 12 #define MORPHEO_REVISION "11 2"12 #define MORPHEO_REVISION "113" 13 13 #define MORPHEO_CODENAME "Castor" 14 14 15 #define MORPHEO_DATE_DAY "1 8"16 #define MORPHEO_DATE_MONTH "0 3"15 #define MORPHEO_DATE_DAY "14" 16 #define MORPHEO_DATE_MONTH "04" 17 17 #define MORPHEO_DATE_YEAR "2009" 18 18 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h
r98 r113 7 7 * $Id$ 8 8 * 9 * [ 9 * [ Description ] 10 10 * 11 11 */ … … 14 14 #include <iostream> 15 15 #include <list> 16 #include <map> 16 17 #include "Common/include/Environment.h" 17 18 #include "Behavioural/include/Direction.h" … … 23 24 namespace behavioural { 24 25 26 #define VHDL_EXTENSION ".vhdl" 27 28 typedef enum 29 { 30 VHDL_SEVERITY_NOTE , 31 VHDL_SEVERITY_WARNING, 32 VHDL_SEVERITY_ERROR , 33 VHDL_SEVERITY_FAILURE 34 } vhdl_severity_t; 35 25 36 std::string std_logic (uint32_t size); 26 37 std::string std_logic_conv (uint32_t size, std::string value); … … 37 48 class Vhdl 38 49 { 39 // -----[ fields ]---------------------------------------------------- 40 private : const std::string _name ; 41 42 private : std::list<std::string> _list_library_work ; 43 private : std::list<std::string> _list_signal ; 44 private : std::list<std::string> _list_type ; 45 private : std::list<std::string> _list_alias ; 46 private : std::list<std::string> _list_port ; 47 private : std::list<std::string> _list_body ; 48 49 // -----[ methods ]--------------------------------------------------- 50 public : Vhdl (std::string name); 50 typedef struct 51 { 52 std::list<std::string> _list_signal; 53 std::list<std::string> _list_type ; 54 std::list<std::string> _list_alias ; 55 std::list<std::string> _list_body ; 56 std::list<std::string> _list_debug ; 57 } vhdl_architecture_t; 58 59 // -----[ fields ]---------------------------------------------------- 60 private : const std::string _name; 61 private : const std::string _id; 62 63 private : std::list<std::string> _list_library; 64 // Entity 65 // private : std::string _port_clock; 66 private : std::list<std::string> _list_port; 67 // Architecture 68 public : const std::string _name_architecture_default; 69 private : std::string _name_architecture; 70 private : std::map<std::string,vhdl_architecture_t> _architecture; 71 72 // -----[ methods ]--------------------------------------------------- 73 public : Vhdl (std::string name, 74 std::string id=""); 51 75 public : ~Vhdl (); 52 76 … … 64 88 private : std::string get_model (uint32_t depth , 65 89 std::string filename , 66 std::string entity_name , 67 std::string architecture_name ); 90 std::string entity_name ); 68 91 private : std::string get_header (uint32_t depth , 69 92 std::string filename ); 70 93 private : std::string get_entity (uint32_t depth , 71 94 std::string name ); 95 private : void test_architecture (void); 96 private : std::string test_architecture (std::string name ); 97 public : std::string set_architecture (std::string name ); 72 98 private : std::string get_architecture (uint32_t depth , 73 std::string name ,74 99 std::string entity_name ); 100 private : std::string get_configuration (uint32_t depth , 101 std::string entity_name , 102 std::string configuration_name ); 75 103 private : std::string get_component (uint32_t depth , 76 104 std::string name ); … … 83 111 direction_t direction , 84 112 uint32_t size ); 113 // public : void set_port_clock (std::string name ); 85 114 private : std::string get_signal (uint32_t depth ); 86 115 public : void set_signal (std::string name , … … 136 165 public : void set_body_component (std::string name_instance , 137 166 std::string name_component , 167 std::string name_architecture , 168 std::string name_package , 138 169 std::list<std::string> list_port_map); 139 170 public : void set_body_component_port_map (std::list<std::string> & list_port_map, … … 147 178 std::string text ); 148 179 149 private : std::string get_library_ieee (uint32_t depth ); 150 private : std::string get_library_work (uint32_t depth ); 180 public : void set_debug (std::string condition , 181 std::string text , 182 vhdl_severity_t severity = VHDL_SEVERITY_NOTE); 183 private : std::string get_debug (uint32_t depth ); 184 185 private : std::string get_library (uint32_t depth ); 186 private : std::string get_library_default (uint32_t depth ); 187 private : void set_library_default (void ); 188 public : void set_library (std::string library_name , 189 std::string package_name , 190 std::string declarative_unit="all"); 151 191 public : void set_library_work (std::string package_name ); 152 192 … … 154 194 }; 155 195 196 std::string vhdl_get_id (std::string model_name); 197 156 198 }; // end namespace behavioural 199 200 template<> inline std::string toString<morpheo::behavioural::vhdl_severity_t>(const morpheo::behavioural::vhdl_severity_t& x) 201 { 202 switch (x) 203 { 204 case morpheo::behavioural::VHDL_SEVERITY_NOTE : return "note" ; break; 205 case morpheo::behavioural::VHDL_SEVERITY_WARNING : return "warning"; break; 206 case morpheo::behavioural::VHDL_SEVERITY_ERROR : return "error" ; break; 207 case morpheo::behavioural::VHDL_SEVERITY_FAILURE : return "failure"; break; 208 default : return ""; break; 209 } 210 }; 211 157 212 }; // end namespace morpheo 158 213
Note: See TracChangeset
for help on using the changeset viewer.