- Timestamp:
- May 31, 2007, 11:22:29 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
r31 r38 9 9 */ 10 10 11 #ifdef SYSTEMC 12 #include "systemc.h" 13 #endif 14 11 15 #include <stdint.h> 12 16 #include <iostream> 17 18 #ifdef VHDL_TESTBENCH 19 #include "Behavioural/include/Vhdl_Testbench.h" 20 #endif 21 13 22 #include "Behavioural/include/Direction.h" 14 23 #include "Behavioural/include/XML.h" 24 #include "Include/ErrorMorpheo.h" 15 25 #include "Include/ToString.h" 16 26 #include "Include/Debug.h" … … 20 30 namespace morpheo { 21 31 namespace behavioural { 32 33 typedef enum {UNKNOW , 34 BOOL , 35 UINT8_T , 36 UINT16_T , 37 UINT32_T , 38 UINT64_T } type_info_t; 22 39 23 40 typedef enum {PORT_VHDL_YES_TESTBENCH_YES, … … 36 53 private : const presence_port_t _presence_port; 37 54 55 #ifdef VHDL_TESTBENCH 56 private : void * _signal ; 57 private : type_info_t _type_info ; 58 #endif 59 38 60 // -----[ methods ]--------------------------------------------------- 39 61 public : Signal (string name , … … 43 65 public : Signal (const Signal &); 44 66 public : ~Signal (); 67 68 #ifdef VHDL_TESTBENCH 69 public : void testbench (Vhdl_Testbench * & vhdl_testbench); 70 71 public : template <typename T> 72 void alloc (void * port) 73 { 74 if (_type_info != UNKNOW) 75 throw (ErrorMorpheo ("Signal \""+_name+"\" : already allocate.")); 76 77 _signal = port; 78 79 if (typeid(T) == typeid(bool )) 80 _type_info = BOOL; 81 else 82 if (typeid(T) == typeid(uint8_t )) 83 _type_info = UINT8_T; 84 else 85 if (typeid(T) == typeid(uint16_t)) 86 _type_info = UINT16_T; 87 else 88 if (typeid(T) == typeid(uint32_t)) 89 _type_info = UINT32_T; 90 else 91 if (typeid(T) == typeid(uint64_t)) 92 _type_info = UINT64_T; 93 else 94 _type_info = UNKNOW; 95 } 96 #endif 45 97 46 98 public : XML toXML (void);
Note: See TracChangeset
for help on using the changeset viewer.