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

Last change on this file since 88 was 88, checked in by rosiere, 15 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
1#ifndef morpheo_behavioural_Interface_fifo_h
2#define morpheo_behavioural_Interface_fifo_h
3
4/*
5 * $Id: Interface_fifo.h 88 2008-12-10 18:31:39Z rosiere $
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   : std::list<Signal *>      * _list_signal_val;
34  private   : std::list<Signal *>      * _list_signal_ack;
35
36#ifdef VHDL_TESTBENCH
37  private   : bool                       _test_exhaustive;
38  private   : std::list<uint32_t>      * _list_cycle   ;
39#endif
40
41   // -----[ methods ]---------------------------------------------------
42  public    :                       Interface_fifo       (std::string         name       
43#ifdef POSITION
44                                                          ,direction_t    direction   
45                                                          ,localisation_t localisation
46#endif
47                                                          ,Tusage_t       usage
48                                                          );
49   
50  public    :                       Interface_fifo       (const Interface_fifo & interface_fifo);
51  public    :                       ~Interface_fifo      ();
52
53  public    : Signal *              set_signal_valack    (std::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 (std::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(std::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    : std::string           testbench_test       (Vhdl    * & vhdl        ,
110                                                          std::string counter_name,
111                                                          std::string reset_name  );
112#ifdef VHDL_TESTBENCH_ASSERT
113  public    : void                  testbench_assert     (Vhdl    * & vhdl        ,
114                                                          std::string counter_name);
115#endif
116
117  public    : std::string           testbench_test_transaction (Vhdl * & vhdl);
118#endif
119  };
120
121}; // end namespace behavioural         
122}; // end namespace morpheo             
123
124#endif
Note: See TracBrowser for help on using the repository browser.