[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 | using namespace std; |
---|
| 25 | |
---|
| 26 | namespace morpheo { |
---|
| 27 | namespace behavioural { |
---|
| 28 | |
---|
[57] | 29 | typedef uint8_t Tinstance_t; |
---|
| 30 | |
---|
| 31 | #define INSTANCE_NONE 0x0 |
---|
| 32 | #define INSTANCE_LIBRARY 0x1 |
---|
| 33 | #define INSTANCE_COMPONENT 0x2 |
---|
| 34 | #define INSTANCE_POSITION 0x4 |
---|
| 35 | #define INSTANCE_ALL 0x7 |
---|
| 36 | |
---|
| 37 | typedef struct |
---|
| 38 | { |
---|
| 39 | public : Tinstance_t _instance; |
---|
| 40 | public : Entity * _entity ; |
---|
| 41 | } Tcomponent_t; |
---|
| 42 | |
---|
[42] | 43 | class Component |
---|
[31] | 44 | { |
---|
| 45 | // -----[ fields ]---------------------------------------------------- |
---|
[57] | 46 | private : const Tusage_t _usage; |
---|
[31] | 47 | private : Entity * _entity ; |
---|
[57] | 48 | private : list<Tcomponent_t*> * _list_component; |
---|
| 49 | |
---|
[31] | 50 | // -----[ methods ]--------------------------------------------------- |
---|
[57] | 51 | public : Component (Tusage_t usage=USE_ALL); |
---|
[42] | 52 | public : Component (const Component & component); |
---|
| 53 | public : ~Component (); |
---|
[31] | 54 | |
---|
[42] | 55 | public : Entity * set_entity (string name |
---|
| 56 | ,string type |
---|
| 57 | #ifdef POSITION |
---|
| 58 | ,schema_t schema |
---|
| 59 | #endif |
---|
| 60 | ); |
---|
[31] | 61 | private : string get_entity (void); |
---|
| 62 | |
---|
[42] | 63 | public : void set_component (Component * component |
---|
| 64 | #ifdef POSITION |
---|
| 65 | ,uint32_t pos_x |
---|
| 66 | ,uint32_t pos_y |
---|
| 67 | ,uint32_t size_x |
---|
| 68 | ,uint32_t size_y |
---|
| 69 | #endif |
---|
[57] | 70 | ,Tinstance_t instance=INSTANCE_ALL |
---|
[42] | 71 | ); |
---|
[31] | 72 | |
---|
| 73 | private : string get_component (void); |
---|
| 74 | |
---|
| 75 | private : Entity * find_entity (string name); |
---|
| 76 | private : Interface * find_interface (string name , |
---|
| 77 | Entity * entity); |
---|
| 78 | |
---|
[42] | 79 | #ifdef VHDL |
---|
| 80 | public : void vhdl_instance (Vhdl * & vhdl); |
---|
| 81 | #endif |
---|
| 82 | |
---|
| 83 | public : void port_map (string component_src , |
---|
| 84 | string port_src , |
---|
| 85 | string component_dest, |
---|
| 86 | string port_dest ); |
---|
| 87 | |
---|
| 88 | #ifdef POSITION |
---|
| 89 | public : void interface_map (string component_src , |
---|
| 90 | string port_dest, |
---|
| 91 | string component_dest, |
---|
| 92 | string port_dest ); |
---|
| 93 | |
---|
| 94 | public : XML toXML (void); |
---|
| 95 | |
---|
[31] | 96 | public : void generate_file (void); |
---|
[42] | 97 | #endif |
---|
[31] | 98 | public : friend ostream& operator<< (ostream& output_stream, |
---|
[42] | 99 | morpheo::behavioural::Component & x); |
---|
[31] | 100 | }; |
---|
| 101 | |
---|
| 102 | }; // end namespace behavioural |
---|
| 103 | }; // end namespace morpheo |
---|
| 104 | |
---|
| 105 | #endif |
---|