- Timestamp:
- Apr 14, 2009, 8:39:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.