[42] | 1 | #ifndef morpheo_behavioural_Component_h |
---|
| 2 | #define morpheo_behavioural_Component_h |
---|
[31] | 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include <stdint.h> |
---|
| 12 | #include <iostream> |
---|
| 13 | #include <list> |
---|
[42] | 14 | #include <map> |
---|
| 15 | #ifdef VHDL |
---|
| 16 | #include "Behavioural/include/Vhdl.h" |
---|
| 17 | #endif |
---|
| 18 | //#include "Behavioural/include/Description.h" |
---|
[31] | 19 | #include "Behavioural/include/Entity.h" |
---|
[44] | 20 | #include "Common/include/ToString.h" |
---|
| 21 | #include "Common/include/Debug.h" |
---|
[57] | 22 | #include "Behavioural/include/Usage.h" |
---|
[31] | 23 | |
---|
| 24 | namespace morpheo { |
---|
| 25 | namespace behavioural { |
---|
| 26 | |
---|
[57] | 27 | typedef uint8_t Tinstance_t; |
---|
| 28 | |
---|
| 29 | #define INSTANCE_NONE 0x0 |
---|
| 30 | #define INSTANCE_LIBRARY 0x1 |
---|
| 31 | #define INSTANCE_COMPONENT 0x2 |
---|
| 32 | #define INSTANCE_POSITION 0x4 |
---|
| 33 | #define INSTANCE_ALL 0x7 |
---|
| 34 | |
---|
| 35 | typedef struct |
---|
| 36 | { |
---|
| 37 | public : Tinstance_t _instance; |
---|
[62] | 38 | public : Entity * _entity ; |
---|
[57] | 39 | } Tcomponent_t; |
---|
| 40 | |
---|
[42] | 41 | class Component |
---|
[31] | 42 | { |
---|
| 43 | // -----[ fields ]---------------------------------------------------- |
---|
[57] | 44 | private : const Tusage_t _usage; |
---|
[31] | 45 | private : Entity * _entity ; |
---|
[57] | 46 | private : list<Tcomponent_t*> * _list_component; |
---|
| 47 | |
---|
[31] | 48 | // -----[ methods ]--------------------------------------------------- |
---|
[57] | 49 | public : Component (Tusage_t usage=USE_ALL); |
---|
[42] | 50 | public : Component (const Component & component); |
---|
| 51 | public : ~Component (); |
---|
[31] | 52 | |
---|
[71] | 53 | public : Entity * set_entity (std::string name |
---|
| 54 | ,std::string type |
---|
[42] | 55 | #ifdef POSITION |
---|
| 56 | ,schema_t schema |
---|
| 57 | #endif |
---|
| 58 | ); |
---|
[71] | 59 | private : std::string get_entity (void); |
---|
[31] | 60 | |
---|
[42] | 61 | public : void set_component (Component * component |
---|
| 62 | #ifdef POSITION |
---|
| 63 | ,uint32_t pos_x |
---|
| 64 | ,uint32_t pos_y |
---|
| 65 | ,uint32_t size_x |
---|
| 66 | ,uint32_t size_y |
---|
| 67 | #endif |
---|
[57] | 68 | ,Tinstance_t instance=INSTANCE_ALL |
---|
[42] | 69 | ); |
---|
[31] | 70 | |
---|
[71] | 71 | private : std::string get_component (void); |
---|
[31] | 72 | |
---|
[71] | 73 | private : Entity * find_entity (std::string name); |
---|
| 74 | //private : Interface * find_interface (std::string name , |
---|
[62] | 75 | // Entity * entity); |
---|
[31] | 76 | |
---|
[42] | 77 | #ifdef VHDL |
---|
| 78 | public : void vhdl_instance (Vhdl * & vhdl); |
---|
| 79 | #endif |
---|
| 80 | |
---|
[62] | 81 | |
---|
| 82 | private : Signal * signal_internal (Entity * entity_productor, |
---|
| 83 | Signal * signal_productor); |
---|
| 84 | |
---|
[71] | 85 | public : void port_map (std::string component_src , |
---|
| 86 | std::string port_src , |
---|
| 87 | std::string component_dest, |
---|
| 88 | std::string port_dest ); |
---|
| 89 | public : void port_map (std::string component_src , |
---|
| 90 | std::string port_src ); |
---|
[42] | 91 | |
---|
[62] | 92 | public : bool test_map (void); |
---|
| 93 | |
---|
[42] | 94 | #ifdef POSITION |
---|
[71] | 95 | public : void interface_map (std::string component_src , |
---|
| 96 | std::string port_dest, |
---|
| 97 | std::string component_dest, |
---|
| 98 | std::string port_dest ); |
---|
[42] | 99 | |
---|
| 100 | public : XML toXML (void); |
---|
| 101 | |
---|
[31] | 102 | public : void generate_file (void); |
---|
[42] | 103 | #endif |
---|
[31] | 104 | public : friend ostream& operator<< (ostream& output_stream, |
---|
[42] | 105 | morpheo::behavioural::Component & x); |
---|
[31] | 106 | }; |
---|
| 107 | |
---|
| 108 | }; // end namespace behavioural |
---|
| 109 | }; // end namespace morpheo |
---|
| 110 | |
---|
| 111 | #endif |
---|