source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface_fifo.h @ 55

Last change on this file since 55 was 55, checked in by rosiere, 17 years ago

Ajout SystemC read_queue et reservation_station
Ajout port au bloc registerfile_monolithic (à ajouter également au bloc registerfile et registerfile_multi_banked)
Modif param : passage de pointeur (attention, tous les composants n'ont pas été tous modifier)

File size: 3.8 KB
Line 
1#ifndef morpheo_behavioural_Interface_fifo_h
2#define morpheo_behavioural_Interface_fifo_h
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#include "Behavioural/include/Interface.h"
12
13namespace morpheo              {
14namespace behavioural          {
15
16  typedef enum {VAL, ACK} val_ack_t;
17}; // end namespace behavioural
18
19  template<> inline std::string toString<morpheo::behavioural::val_ack_t>(const morpheo::behavioural::val_ack_t& x)
20  {
21    switch (x)
22      {
23      case morpheo::behavioural::VAL : return "val"; break;
24      case morpheo::behavioural::ACK : return "ack"; break;
25      default    : return ""      ; break;
26      }
27  }
28
29namespace behavioural          {
30
31  class Interface_fifo : public Interface
32  {
33  private   : list<Signal *>      * _list_signal_val;
34  private   : list<Signal *>      * _list_signal_ack;
35
36#ifdef VHDL_TESTBENCH
37  private   : bool                  _test_exhaustive;
38  private   : list<uint32_t>      * _list_cycle   ;
39#endif
40
41   // -----[ methods ]---------------------------------------------------
42  public    :                       Interface_fifo       (string         name       
43#ifdef POSITION
44                                                          ,direction_t    direction   
45                                                          ,localisation_t localisation
46#endif
47                                                          );
48   
49  public    :                       Interface_fifo       (const Interface_fifo & interface_fifo);
50  public    :                       ~Interface_fifo      ();
51
52  public    : Signal *              set_signal_valack    (string          name     ,
53                                                          direction_t     direction,
54                                                          val_ack_t       val_ack  ,
55                                                          presence_port_t presence_port = PORT_VHDL_YES_TESTBENCH_YES);
56
57  private   : void                  save_ptr             (Signal *        signal   ,
58                                                          val_ack_t       val_ack  );
59
60#ifdef SYSTEMC
61  public    : sc_in <bool> *        set_signal_valack_in (val_ack_t       val_ack  ,
62                                                          presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
63    {
64      return set_signal_valack_in (toString(val_ack) ,val_ack, presence_port);
65    }
66
67  public    : sc_in <bool> *        set_signal_valack_in (string          name     ,
68                                                          val_ack_t       val_ack  ,
69                                                          presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
70    {
71      log_printf(FUNC,Behavioural,"set_signal_valack_in","Begin");
72
73      sc_in <bool> * port = set_signal_in <bool> (name, 1, presence_port);
74     
75      save_ptr(_list_signal->back(), val_ack);
76     
77      log_printf(FUNC,Behavioural,"set_signal_valack_in","End");
78      return port;
79    };
80
81  public    : sc_out<bool> *        set_signal_valack_out(val_ack_t       val_ack  ,
82                                                          presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
83    {
84      return set_signal_valack_out(toString(val_ack) ,val_ack, presence_port);
85    }
86
87  public    : sc_out<bool> *        set_signal_valack_out(string          name     ,
88                                                          val_ack_t       val_ack  ,
89                                                          presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
90    {
91      log_printf(FUNC,Behavioural,"set_signal_valack_out","Begin");
92
93      sc_out<bool> * port = set_signal_out<bool> (name, 1, presence_port);
94     
95      save_ptr(_list_signal->back(), val_ack);
96     
97      log_printf(FUNC,Behavioural,"set_signal_valack_out","End");
98      return port;
99    };
100#endif
101
102#ifdef VHDL_TESTBENCH
103  public    : uint32_t              get_cycle            (void);
104
105  public    : void                  testbench            (void);
106  public    : bool                  testbench_transaction(void);
107  public    : void                  testbench_cycle      (void);
108  public    : string                testbench_test       (Vhdl   * & vhdl        ,
109                                                          string     counter_name,
110                                                          string     reset_name  );
111
112  public    : string                testbench_test_transaction (Vhdl * & vhdl);
113#endif
114  };
115
116}; // end namespace behavioural         
117}; // end namespace morpheo             
118
119#endif
Note: See TracBrowser for help on using the repository browser.