Changeset 42 for trunk/IPs/systemC/processor/Morpheo/Behavioural/include
- Timestamp:
- Jul 5, 2007, 5:50:19 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/include
- Files:
-
- 1 deleted
- 8 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h
r38 r42 1 #ifdef POSITION 2 #ifndef morpheo_behavioural_Position_h 3 #define morpheo_behavioural_Position_h 1 #ifndef morpheo_behavioural_Component_h 2 #define morpheo_behavioural_Component_h 4 3 5 4 /* … … 13 12 #include <iostream> 14 13 #include <list> 14 #include <map> 15 #ifdef VHDL 16 #include "Behavioural/include/Vhdl.h" 17 #endif 18 //#include "Behavioural/include/Description.h" 15 19 #include "Behavioural/include/Entity.h" 16 20 #include "Include/ToString.h" … … 22 26 namespace behavioural { 23 27 24 class Position28 class Component 25 29 { 26 30 // -----[ fields ]---------------------------------------------------- … … 29 33 30 34 // -----[ methods ]--------------------------------------------------- 31 public : Position(void);32 public : Position (const Position & position);33 public : ~ Position();35 public : Component (void); 36 public : Component (const Component & component); 37 public : ~Component (); 34 38 35 public : Entity * set_entity (string name , 36 string type , 37 schema_t schema ); 39 public : Entity * set_entity (string name 40 ,string type 41 #ifdef POSITION 42 ,schema_t schema 43 #endif 44 ); 38 45 private : string get_entity (void); 39 46 40 public : void set_component (Position * position, 41 uint32_t pos_x , 42 uint32_t pos_y , 43 uint32_t size_x , 44 uint32_t size_y ); 47 public : void set_component (Component * component 48 #ifdef POSITION 49 ,uint32_t pos_x 50 ,uint32_t pos_y 51 ,uint32_t size_x 52 ,uint32_t size_y 53 #endif 54 ); 45 55 46 56 private : string get_component (void); 47 48 public : void port_map (string component1,49 string signal1 ,50 string component2,51 string signal2 );52 53 public : XML toXML (void);54 57 55 58 private : Entity * find_entity (string name); … … 57 60 Entity * entity); 58 61 62 #ifdef VHDL 63 public : void vhdl_instance (Vhdl * & vhdl); 64 #endif 65 66 public : void port_map (string component_src , 67 string port_src , 68 string component_dest, 69 string port_dest ); 70 71 #ifdef POSITION 72 public : void interface_map (string component_src , 73 string port_dest, 74 string component_dest, 75 string port_dest ); 76 77 public : XML toXML (void); 78 59 79 public : void generate_file (void); 60 80 #endif 61 81 public : friend ostream& operator<< (ostream& output_stream, 62 morpheo::behavioural:: Position& x);82 morpheo::behavioural::Component & x); 63 83 }; 64 84 … … 67 87 68 88 #endif 69 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Direction.h
r41 r42 7 7 namespace behavioural { 8 8 9 typedef enum { IN, OUT } direction_t;10 9 typedef enum {INTERNAL, IN, OUT } direction_t; 10 //typedef enum { IN, OUT, INOUT } direction_t; 11 11 12 12 }; // end namespace behavioural … … 16 16 switch (x) 17 17 { 18 case morpheo::behavioural::IN : return "in" ; break; 19 case morpheo::behavioural::OUT : return "out" ; break; 20 // case morpheo::behavioural::INOUT : return "inout" ; break; 18 case morpheo::behavioural::INTERNAL : return "internal" ; break; 19 case morpheo::behavioural::IN : return "in" ; break; 20 case morpheo::behavioural::OUT : return "out" ; break; 21 // case morpheo::behavioural::INOUT : return "inout" ; break; 21 22 default : return "" ; break; 22 23 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h
r38 r42 1 #ifdef POSITION2 1 #ifndef morpheo_behavioural_Entity_h 3 2 #define morpheo_behavioural_Entity_h … … 13 12 #include <iostream> 14 13 #include <list> 14 //#include "Behavioural/include/Description.h" 15 15 #include "Behavioural/include/Interfaces.h" 16 16 #include "Behavioural/include/Schema.h" … … 26 26 class Entity 27 27 { 28 friend class Position;29 friend class Interface;30 31 28 // -----[ fields ]---------------------------------------------------- 32 29 private : const string _name ; 33 30 private : const string _type ; 31 #ifdef POSITION 34 32 private : const schema_t _schema ; 33 #endif 35 34 private : Interfaces * _interfaces ; 35 36 #ifdef POSITION 36 37 private : string _comment ; 37 38 … … 41 42 private : uint32_t _map_pos_x ; 42 43 private : uint32_t _map_pos_y ; 44 #endif 43 45 44 46 // -----[ methods ]--------------------------------------------------- 45 public : Entity (string name , 46 string type , 47 schema_t schema ); 47 public : Entity ( string name 48 ,string type 49 #ifdef POSITION 50 ,schema_t schema 51 #endif 52 ); 48 53 public : Entity (const Entity & entity); 49 54 public : ~Entity (); 50 55 56 public : string get_name (void); 57 public : string get_type (void); 58 59 #ifdef POSITION 51 60 public : void set_comment (string comment); 52 61 private : string get_comment (void ); 53 62 #endif 54 63 public : Interfaces * set_interfaces (void); 55 64 private : string get_interfaces (void); 65 public : Interfaces * get_interfaces_list(void); 56 66 57 67 public : Interface * find_interface (string name); 68 public : Signal * find_signal (string name); 69 public : bool find_signal (Signal * signal); 58 70 71 #ifdef POSITION 59 72 public : void mapping (uint32_t pos_x, 60 73 uint32_t pos_y, 61 74 uint32_t size_x , 62 75 uint32_t size_y ); 76 #endif 63 77 78 #ifdef POSITION 64 79 public : XML toXML (void); 65 80 public : XML toXML_mapping (void); 66 81 #endif 67 82 public : friend ostream& operator<< (ostream& output_stream, 68 83 morpheo::behavioural::Entity & x); … … 73 88 74 89 #endif 75 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environnement.h
r40 r42 10 10 # error "To have the vhdl's test bench, you must set flags VHDL" 11 11 #endif 12 13 #if (defined(VHDL_TESTBENCH_ASSERT) and not defined(VHDL_TESTBENCH)) 14 # error "To have an assert in vhdl's test bench, you must set flags VHDL_TESTBENCH" 15 #endif 16 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
r41 r42 33 33 class Interface 34 34 { 35 friend class Interfaces;36 37 35 // -----[ fields ]---------------------------------------------------- 38 36 protected : const string _name ; 37 #ifdef POSITION 39 38 protected : const direction_t _direction ; 40 39 protected : const localisation_t _localisation ; 41 40 protected : string _comment ; 41 #endif 42 42 43 43 protected : list<Signal *> * _list_signal ; … … 54 54 55 55 // -----[ methods ]--------------------------------------------------- 56 public : Interface (string name , 57 direction_t direction , 58 localisation_t localisation); 56 public : Interface (string name 57 #ifdef POSITION 58 ,direction_t direction 59 ,localisation_t localisation 60 #endif 61 ); 59 62 60 63 public : Interface (const Interface & interface); 61 64 public : ~Interface (); 62 65 66 public : string get_name (); 67 68 #ifdef POSITION 63 69 public : void set_comment (string comment); 64 70 protected : string get_comment (void ); 71 #endif 65 72 66 73 protected : string signal_name (string name_interface, 67 74 string name_signal , 68 75 direction_t direction ); 76 77 public : Signal * find_signal (string name); 78 public : bool find_signal (Signal * signal); 69 79 70 80 protected : string get_signal (void); … … 73 83 uint32_t size , 74 84 presence_port_t presence_port = PORT_VHDL_YES_TESTBENCH_YES); 85 public : list<Signal *> * get_signal_list (void); 75 86 76 87 #ifdef SYSTEMC … … 85 96 throw ErrorMorpheo ("Signal \""+name+"\" is a clock, bad presence_port."); 86 97 87 Signal * sig = set_signal (name, IN , size, presence_port); 88 sc_in_clk * signal = new sc_in_clk (sig->_name.c_str()); 98 Signal * sig = set_signal (name, IN , size, presence_port); 99 sc_in_clk * port = new sc_in_clk (sig->_name.c_str()); 100 101 sig->alloc<bool> (static_cast<void *>(port)); 89 102 90 103 log_printf(FUNC,Behavioural,"set_signal_clk","End"); 91 104 92 return signal;105 return port; 93 106 }; 94 107 … … 104 117 throw ErrorMorpheo ("Signal \""+name+"\" is not a clock, bad presence_port."); 105 118 106 Signal * sig= set_signal (name, IN , size, presence_port);119 Signal * sig = set_signal (name, IN , size, presence_port); 107 120 sc_in <T> * port = new sc_in <T> (sig->_name.c_str()); 108 #ifdef VHDL_TESTBENCH 121 109 122 sig->alloc<T> (static_cast<void *>(port)); 110 #endif111 123 112 124 log_printf(FUNC,Behavioural,"set_signal_in","End"); … … 128 140 Signal * sig = set_signal (name, OUT , size, presence_port); 129 141 sc_out <T> * port = new sc_out <T> (sig->_name.c_str()); 130 #ifdef VHDL_TESTBENCH 142 131 143 sig->alloc<T> (static_cast<void *>(port)); 132 #endif133 144 134 145 log_printf(FUNC,Behavioural,"set_signal_out","End"); … … 136 147 return port; 137 148 }; 149 150 public : template <typename T> 151 sc_signal <T> * set_signal_internal (string name, 152 uint32_t size) 153 { 154 log_printf(FUNC,Behavioural,"set_signal_internal","Begin"); 155 156 Signal * sig = set_signal (name, INTERNAL , size, PORT_VHDL_NO_TESTBENCH_NO); 157 sc_signal <T> * port = new sc_signal <T> (sig->_name.c_str()); 158 159 sig->alloc<T> (static_cast<void *>(port)); 160 161 log_printf(FUNC,Behavioural,"set_signal_internal","End"); 162 163 return port; 164 }; 165 138 166 #endif 139 167 140 168 #ifdef VHDL 141 169 public : void set_port (Vhdl * & vhdl); 142 # ifdef VHDL_TESTBENCH170 # ifdef VHDL_TESTBENCH 143 171 public : void set_signal (Vhdl * & vhdl); 144 172 public : void get_signal (list<string> * & list_signal); 145 # endif173 # endif 146 174 #endif 147 175 #ifdef VHDL_TESTBENCH 148 176 public : uint32_t get_cycle (void); 149 public : string get_clock (void); 177 public : Signal * get_clock (void); 178 public : Signal * get_reset (void); 150 179 151 180 public : void testbench (void); 152 181 public : void testbench_cycle (void); 153 182 public : void testbench_body (Vhdl * & vhdl , 154 string counter_name ); 183 string counter_name , 184 string reset_name ); 155 185 public : string testbench_test (Vhdl * & vhdl , 156 string counter_name); 186 string counter_name, 187 string reset_name); 157 188 public : string testbench_test_ok (Vhdl * & vhdl ); 158 189 protected : string testbench_test_name (Vhdl * & vhdl); 159 190 protected : string testbench_test_ok_name(Vhdl * & vhdl); 160 161 #endif 162 163 #ifdef POSITION 164 public : void port_map(void * entity,191 protected : string testbench_test_transaction_name(Vhdl * & vhdl); 192 #endif 193 194 #ifdef POSITION 195 public : void interface_map (void * entity, 165 196 void * interface); 166 #endif167 168 197 public : XML toXML (void); 169 #ifdef POSITION170 198 public : XML toXML_mapping (void); 171 199 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface_fifo.h
r41 r42 24 24 private : bool _test_exhaustive; 25 25 private : list<uint32_t> * _list_cycle ; 26 27 26 #endif 28 27 29 28 // -----[ methods ]--------------------------------------------------- 30 public : Interface_fifo (string name , 31 direction_t direction , 32 localisation_t localisation); 29 public : Interface_fifo (string name 30 #ifdef POSITION 31 ,direction_t direction 32 ,localisation_t localisation 33 #endif 34 ); 33 35 34 36 public : Interface_fifo (const Interface_fifo & interface_fifo); … … 79 81 public : bool testbench_transaction(void); 80 82 public : void testbench_cycle (void); 81 public : string testbench_test (Vhdl * & vhdl , 82 string counter_name); 83 public : string testbench_test (Vhdl * & vhdl , 84 string counter_name, 85 string reset_name ); 86 87 public : string testbench_test_transaction (Vhdl * & vhdl); 83 88 #endif 84 89 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h
r41 r42 35 35 public : ~Interfaces (); 36 36 37 public : Interface_fifo * set_interface (string name , 38 direction_t direction , 39 localisation_t localisation); 37 public : Interface_fifo * set_interface (string name 38 #ifdef POSITION 39 ,direction_t direction 40 ,localisation_t localisation 41 #endif 42 ); 43 #ifdef POSITION 40 44 public : Interface_fifo * set_interface (string name , 41 45 direction_t direction , 42 46 localisation_t localisation, 43 47 string comment ); 48 #endif 44 49 private : string get_interface (void); 50 public :list<Interface_fifo*>* get_interface_list (void); 45 51 46 52 #ifdef VHDL … … 53 59 #ifdef VHDL_TESTBENCH 54 60 private : uint32_t get_cycle (void); 55 private : string get_clock (void); 61 private : Signal * get_clock (void); 62 private : Signal * get_reset (void); 56 63 57 64 private : void testbench_generate_file (void); 58 65 public : void testbench (void); 59 66 private : string testbench_body (Vhdl * & vhdl , 60 string counter_name ); 67 string counter_name , 68 string reset_name ); 61 69 #endif 62 70 63 71 public : Interface_fifo * find_interface (string name); 72 public : Signal * find_signal (string name); 73 public : bool find_signal (Signal * signal); 64 74 75 #ifdef POSITION 65 76 public : XML toXML (void); 66 #ifdef POSITION67 77 public : XML toXML_mapping (void); 68 78 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Localisation.h
r31 r42 1 #ifdef POSITION 1 2 #ifndef morpheo_behavioural_Localisation_h 2 3 #define morpheo_behavioural_Localisation_h … … 26 27 27 28 #endif 29 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
r41 r42 44 44 PORT_VHDL_NO_TESTBENCH_NO , 45 45 CLOCK_VHDL_YES , 46 CLOCK_VHDL_NO } presence_port_t; 46 CLOCK_VHDL_NO , 47 RESET_VHDL_YES , 48 RESET_VHDL_NO } presence_port_t; 47 49 48 50 class Signal … … 56 58 private : const presence_port_t _presence_port; 57 59 60 private : Signal * _signal ; 61 private : bool _is_allocate ; 62 private : void * _sc_signal ; 63 private : bool _is_map ; 64 private : void * _sc_signal_map; 65 private : type_info_t _type_info ; 66 58 67 #ifdef VHDL_TESTBENCH 59 private : void * _signal ;60 private : type_info_t _type_info ;61 62 68 private : list<string> * _list_value ; 63 69 #endif … … 71 77 public : ~Signal (); 72 78 73 #ifdef VHDL_TESTBENCH 79 public : string get_name (void); 80 public : uint32_t get_size (void); 81 public : Signal * get_signal_link (void); 82 83 public : bool presence_vhdl (void); 84 public : bool presence_testbench (void); 85 86 public : void mapping (Signal * signal); 87 public : void link (Signal * signal); 88 89 #ifdef SYSTEMC 74 90 public :template <typename T> 75 91 T read (void) … … 88 104 switch (_type_info) 89 105 { 90 case BOOL : return (static_cast<sc_in <bool > *>(_s ignal)->read());91 case UINT8_T : return (static_cast<sc_in <uint8_t > *>(_s ignal)->read());92 case UINT16_T : return (static_cast<sc_in <uint16_t> *>(_s ignal)->read());93 case UINT32_T : return (static_cast<sc_in <uint32_t> *>(_s ignal)->read());94 case UINT64_T : return (static_cast<sc_in <uint64_t> *>(_s ignal)->read());106 case BOOL : return (static_cast<sc_in <bool > *>(_sc_signal_map)->read()); 107 case UINT8_T : return (static_cast<sc_in <uint8_t > *>(_sc_signal_map)->read()); 108 case UINT16_T : return (static_cast<sc_in <uint16_t> *>(_sc_signal_map)->read()); 109 case UINT32_T : return (static_cast<sc_in <uint32_t> *>(_sc_signal_map)->read()); 110 case UINT64_T : return (static_cast<sc_in <uint64_t> *>(_sc_signal_map)->read()); 95 111 default : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); 96 112 } … … 102 118 switch (_type_info) 103 119 { 104 case BOOL : return (static_cast<sc_out <bool > *>(_s ignal)->read());105 case UINT8_T : return (static_cast<sc_out <uint8_t > *>(_s ignal)->read());106 case UINT16_T : return (static_cast<sc_out <uint16_t> *>(_s ignal)->read());107 case UINT32_T : return (static_cast<sc_out <uint32_t> *>(_s ignal)->read());108 case UINT64_T : return (static_cast<sc_out <uint64_t> *>(_s ignal)->read());120 case BOOL : return (static_cast<sc_out <bool > *>(_sc_signal_map)->read()); 121 case UINT8_T : return (static_cast<sc_out <uint8_t > *>(_sc_signal_map)->read()); 122 case UINT16_T : return (static_cast<sc_out <uint16_t> *>(_sc_signal_map)->read()); 123 case UINT32_T : return (static_cast<sc_out <uint32_t> *>(_sc_signal_map)->read()); 124 case UINT64_T : return (static_cast<sc_out <uint64_t> *>(_sc_signal_map)->read()); 109 125 default : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.")); 110 126 } … … 117 133 throw (ErrorMorpheo ("Signal \""+_name+"\" : already allocate.")); 118 134 119 _signal = port; 135 _is_allocate = true; 136 _sc_signal = port; 137 _sc_signal_map = port; 120 138 121 139 if (typeid(T) == typeid(bool )) … … 136 154 _type_info = UNKNOW; 137 155 } 138 139 public : void testbench (void); 140 public : void testbench_body (Vhdl * & vhdl , 141 string counter_name ); 142 public : void testbench_test_ok(Vhdl * & vhdl ); 143 #endif 156 #endif 157 144 158 #ifdef VHDL 145 159 public : void set_port (Vhdl * & vhdl); 146 160 # ifdef VHDL_TESTBENCH 147 public : string get_clock (void); 161 public : Signal * get_clock (void); 162 public : Signal * get_reset (void); 163 public : uint32_t get_reset_cycle (bool active_low); 164 148 165 public : void set_signal (Vhdl * & vhdl); 149 166 public : void get_name_vhdl (list<string> * & list_signal); 167 168 public : void testbench (void); 169 public : void testbench_body (Vhdl * & vhdl , 170 string counter_name , 171 string reset_name ); 172 public : void testbench_test_ok(Vhdl * & vhdl ); 150 173 # endif 151 174 #endif … … 162 185 switch (x) 163 186 { 164 case morpheo::behavioural::PORT_VHDL_YES_TESTBENCH_YES : return "Port is in VHDL's model and TestBench's model" ; break; 165 case morpheo::behavioural::PORT_VHDL_YES_TESTBENCH_NO : return "Port is in VHDL's model " ; break; 166 case morpheo::behavioural::PORT_VHDL_NO_TESTBENCH_YES : return "Port is in TestBench's model" ; break; 167 case morpheo::behavioural::PORT_VHDL_NO_TESTBENCH_NO : return "Port is in none model " ; break; 187 case morpheo::behavioural::PORT_VHDL_YES_TESTBENCH_YES : return "Port is in VHDL's model and TestBench's model" ; break; 188 case morpheo::behavioural::PORT_VHDL_YES_TESTBENCH_NO : return "Port is in VHDL's model " ; break; 189 case morpheo::behavioural::PORT_VHDL_NO_TESTBENCH_YES : return "Port is in TestBench's model" ; break; 190 case morpheo::behavioural::PORT_VHDL_NO_TESTBENCH_NO : return "Port is in none model " ; break; 191 case morpheo::behavioural::CLOCK_VHDL_YES : return "Clock is in VHDL's model " ; break; 192 case morpheo::behavioural::CLOCK_VHDL_NO : return "Clock is not in VHDL's model " ; break; 193 case morpheo::behavioural::RESET_VHDL_YES : return "Reset is in VHDL's model " ; break; 194 case morpheo::behavioural::RESET_VHDL_NO : return "Reset is not in VHDL's model " ; break; 168 195 default : return ""; break; 169 196 }
Note: See TracChangeset
for help on using the changeset viewer.