- Timestamp:
- Jul 5, 2007, 5:50:19 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.