source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface_fifo.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.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                                                          ,Tusage_t       usage=USE_ALL
48                                                          );
49   
50  public    :                       Interface_fifo       (const Interface_fifo & interface_fifo);
51  public    :                       ~Interface_fifo      ();
52
53  public    : Signal *              set_signal_valack    (string          name     ,
54                                                          direction_t     direction,
55                                                          val_ack_t       val_ack  ,
56                                                          presence_port_t presence_port = PORT_VHDL_YES_TESTBENCH_YES);
57
58  private   : void                  save_ptr             (Signal *        signal   ,
59                                                          val_ack_t       val_ack  );
60
61#ifdef SYSTEMC
62  public    : sc_in <bool> *        set_signal_valack_in (val_ack_t       val_ack  ,
63                                                          presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
64    {
65      return set_signal_valack_in (toString(val_ack) ,val_ack, presence_port);
66    }
67
68  public    : sc_in <bool> *        set_signal_valack_in (string          name     ,
69                                                          val_ack_t       val_ack  ,
70                                                          presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
71    {
72      log_printf(FUNC,Behavioural,"set_signal_valack_in","Begin");
73
74      sc_in <bool> * port = set_signal_in <bool> (name, 1, presence_port);
75     
76      save_ptr(_list_signal->back(), val_ack);
77     
78      log_printf(FUNC,Behavioural,"set_signal_valack_in","End");
79      return port;
80    };
81
82  public    : sc_out<bool> *        set_signal_valack_out(val_ack_t       val_ack  ,
83                                                          presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
84    {
85      return set_signal_valack_out(toString(val_ack) ,val_ack, presence_port);
86    }
87
88  public    : sc_out<bool> *        set_signal_valack_out(string          name     ,
89                                                          val_ack_t       val_ack  ,
90                                                          presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
91    {
92      log_printf(FUNC,Behavioural,"set_signal_valack_out","Begin");
93
94      sc_out<bool> * port = set_signal_out<bool> (name, 1, presence_port);
95     
96      save_ptr(_list_signal->back(), val_ack);
97     
98      log_printf(FUNC,Behavioural,"set_signal_valack_out","End");
99      return port;
100    };
101#endif
102
103#ifdef VHDL_TESTBENCH
104  public    : uint32_t              get_cycle            (void);
105
106  public    : void                  testbench            (void);
107  public    : bool                  testbench_transaction(void);
108  public    : void                  testbench_cycle      (void);
109  public    : string                testbench_test       (Vhdl   * & vhdl        ,
110                                                          string     counter_name,
111                                                          string     reset_name  );
112
113  public    : string                testbench_test_transaction (Vhdl * & vhdl);
114#endif
115  };
116
117}; // end namespace behavioural         
118}; // end namespace morpheo             
119
120#endif
Note: See TracBrowser for help on using the repository browser.