source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.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.5 KB
Line 
1#ifndef morpheo_behavioural_generic_registerfile_registerfile_multi_banked_Parameters_h
2#define morpheo_behavioural_generic_registerfile_registerfile_multi_banked_Parameters_h
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#include "Common/include/Debug.h"
12#include "Common/include/FromString.h"
13#include "Behavioural/include/Parameters.h"
14#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h"
15#include <math.h>
16
17namespace morpheo {
18  typedef enum {PARTIAL_CROSSBAR,
19                FULL_CROSSBAR   } Tcrossbar_t;
20
21  template<> inline Tcrossbar_t fromString<Tcrossbar_t> (const std::string& x)
22  {
23    if ( (x.compare("0")                == 0) or
24         (x.compare("PARTIAL_CROSSBAR") == 0))
25      return PARTIAL_CROSSBAR;
26    if ( (x.compare("1")                == 0) or
27         (x.compare("FULL_CROSSBAR"   ) == 0))
28      return FULL_CROSSBAR;
29
30    throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\""));
31  };
32 
33  template<> inline std::string toString<Tcrossbar_t>   (const Tcrossbar_t& x)
34  {
35    ostringstream out;
36
37    if (x == PARTIAL_CROSSBAR)
38      out << "PARTIAL_CROSSBAR";
39    if (x == FULL_CROSSBAR)
40      out << "FULL_CROSSBAR";
41
42    return out.str();
43  };
44
45namespace behavioural {
46namespace generic {
47namespace registerfile {
48namespace registerfile_multi_banked {
49
50
51  class Parameters : public morpheo::behavioural::Parameters
52  {
53    //-----[ fields ]------------------------------------------------------------
54  public : const uint32_t    _nb_port_read         ; // Global read  port
55  public : const uint32_t    _nb_port_write        ; // Global write port
56  public : const uint32_t    _nb_word              ;
57  public : const uint32_t    _size_word            ;
58  public : const uint32_t    _nb_bank              ; // Number of bank (All bank is identical)
59  public : const uint32_t    _nb_port_read_by_bank ; // Local  read  port
60  public : const uint32_t    _nb_port_write_by_bank; // Local  write port
61  public : const Tcrossbar_t _crossbar             ;
62
63  public : const uint32_t    _size_address         ;
64  public : const uint32_t    _size_address_by_bank ;
65
66  public : const uint32_t    _bank_shift           ;
67  public : const Taddress_t  _bank_mask            ;
68  public : const uint32_t    _num_reg_shift        ;
69  public : const Taddress_t  _num_reg_mask         ;
70
71  public : const uint32_t    _nb_word_by_bank      ;
72
73    // A lot of table to the partial crossbar
74  public :       uint32_t  * _link_port_read_to_bank_read  ;
75//public :       uint32_t  * _link_port_read_to_num_bank   ;
76  public :       uint32_t  * _link_port_write_to_bank_write;
77//public :       uint32_t  * _link_port_write_to_num_bank  ;
78
79    //-----[ methods ]-----------------------------------------------------------
80  public : Parameters  (uint32_t    nb_port_read         ,
81                        uint32_t    nb_port_write        ,
82                        uint32_t    nb_word              ,
83                        uint32_t    size_word            ,
84                        uint32_t    nb_bank              ,
85                        uint32_t    nb_port_read_by_bank ,
86                        uint32_t    nb_port_write_by_bank,
87                        Tcrossbar_t crossbar             );
88  public : Parameters  (Parameters & param) ;
89  public : ~Parameters () ;
90
91  public : string msg_error (void);
92
93  public :        string   print      (uint32_t depth);
94  public : friend ostream& operator<< (ostream& output_stream,
95                                       morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters & x);
96  };
97
98}; // end namespace registerfile_multi_banked
99}; // end namespace registerfile
100}; // end namespace generic
101}; // end namespace behavioural
102}; // end namespace morpheo             
103
104#endif
Note: See TracBrowser for help on using the repository browser.