source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h @ 57

Last change on this file since 57 was 57, checked in by rosiere, 17 years ago
  • VHDL - RegisterFile_Multi_Banked (only partial_crossbar)
  • SystemC - modif Component, interface and co -> ajout du type Tusage_T pour instancier un coposant mais ne demander que le VHDL ou le systemC.
  • Séminaire interne
File size: 3.0 KB
Line 
1#ifndef morpheo_behavioural_Component_h
2#define morpheo_behavioural_Component_h
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#include <stdint.h>
12#include <iostream>
13#include <list>
14#include <map>
15#ifdef VHDL
16#include "Behavioural/include/Vhdl.h"
17#endif
18//#include "Behavioural/include/Description.h"
19#include "Behavioural/include/Entity.h"
20#include "Common/include/ToString.h"
21#include "Common/include/Debug.h"
22#include "Behavioural/include/Usage.h"
23
24using namespace std;
25
26namespace morpheo              {
27namespace behavioural          {
28
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 
43  class Component
44  {
45    // -----[ fields ]----------------------------------------------------
46  private   : const Tusage_t        _usage;
47  private   : Entity              * _entity        ;
48  private   : list<Tcomponent_t*> * _list_component;
49
50    // -----[ methods ]---------------------------------------------------
51  public    :                       Component         (Tusage_t usage=USE_ALL);
52  public    :                       Component         (const Component & component);
53  public    :                       ~Component        ();
54
55  public    : Entity *              set_entity        (string        name   
56                                                       ,string        type 
57#ifdef POSITION
58                                                       ,schema_t      schema
59#endif
60                                                       );
61  private   : string                get_entity        (void);
62
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
70                                                       ,Tinstance_t instance=INSTANCE_ALL
71                                                       );
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
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
96  public    : void                  generate_file     (void);
97#endif   
98  public    : friend ostream&       operator<<        (ostream& output_stream,
99                                                       morpheo::behavioural::Component & x);
100  };
101
102}; // end namespace behavioural         
103}; // end namespace morpheo             
104
105#endif
Note: See TracBrowser for help on using the repository browser.