source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h @ 62

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

Modification en profondeur de Component-port_map.
Compilation ok pour Register_unit ... a tester (systemC et vhdl)

File size: 3.6 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  public : const bool        _have_port_address     ;
74  public : const bool        _have_bank_port_address;
75
76    // A lot of table to the partial crossbar
77  public :       uint32_t  * _link_port_read_to_bank_read  ;
78//public :       uint32_t  * _link_port_read_to_num_bank   ;
79  public :       uint32_t  * _link_port_write_to_bank_write;
80//public :       uint32_t  * _link_port_write_to_num_bank  ;
81
82    //-----[ methods ]-----------------------------------------------------------
83  public : Parameters  (uint32_t    nb_port_read         ,
84                        uint32_t    nb_port_write        ,
85                        uint32_t    nb_word              ,
86                        uint32_t    size_word            ,
87                        uint32_t    nb_bank              ,
88                        uint32_t    nb_port_read_by_bank ,
89                        uint32_t    nb_port_write_by_bank,
90                        Tcrossbar_t crossbar             );
91  public : Parameters  (Parameters & param) ;
92  public : ~Parameters () ;
93
94  public : string msg_error (void);
95
96  public :        string   print      (uint32_t depth);
97  public : friend ostream& operator<< (ostream& output_stream,
98                                       morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters & x);
99  };
100
101}; // end namespace registerfile_multi_banked
102}; // end namespace registerfile
103}; // end namespace generic
104}; // end namespace behavioural
105}; // end namespace morpheo             
106
107#endif
Note: See TracBrowser for help on using the repository browser.