source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp @ 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: 2.9 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
9
10namespace morpheo                    {
11namespace behavioural                {
12namespace generic                    {
13namespace registerfile               {
14namespace registerfile_monolithic    {
15
16  RegisterFile_Monolithic::RegisterFile_Monolithic
17  (
18#ifdef SYSTEMC
19   sc_module_name name,
20#else
21   string name        ,
22#endif
23#ifdef STATISTICS
24   morpheo::behavioural::Parameters_Statistics            * param_statistics,
25#endif
26   morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters * param,
27   morpheo::behavioural::Tusage_t usage
28   ):
29    _name  (name),
30    _param (param),
31    _usage (usage)
32  {
33    log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","Begin");
34
35    log_printf(INFO,RegisterFile_Monolithic,"RegisterFile_Monolithic","Allocation");
36    allocation ();
37
38#ifdef STATISTICS
39    _stat = new Statistics (static_cast<string>(_name),
40                            param_statistics          ,
41                            param);
42#endif
43
44#ifdef VHDL
45    // generate the vhdl
46    vhdl();
47#endif
48
49#ifdef SYSTEMC
50    if (_usage & USE_SYSTEMC)
51      {
52        SC_METHOD (transition);
53        dont_initialize ();
54        sensitive_pos << *(in_CLOCK);
55       
56        SC_METHOD (genMealy_read);
57        dont_initialize ();
58        sensitive_neg << *(in_CLOCK);
59        for (uint32_t i=0; i<_param->_nb_port_read; i++)
60          sensitive << *(in_READ_VAL     [i])
61                    << *(in_READ_ADDRESS [i]);
62        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
63          sensitive << *(in_READ_WRITE_VAL     [i])
64                    << *(in_READ_WRITE_RW      [i])
65                    << *(in_READ_WRITE_ADDRESS [i]);
66       
67#  ifdef SYSTEMCASS_SPECIFIC
68        // List dependency information
69        for (uint32_t i=0; i<_param->_nb_port_read; i++)
70          {
71            (*(out_READ_DATA  [i])) (*( in_READ_VAL     [i]));
72            (*(out_READ_DATA  [i])) (*( in_READ_ADDRESS [i]));
73          }
74        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
75          { 
76            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL     [i]));
77            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW      [i]));
78            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i]));
79          }
80#  endif   
81       
82        for (uint32_t i=0; i<_param->_nb_port_read       ; i++)
83          PORT_WRITE(out_READ_ACK        [i], 1);
84        for (uint32_t i=0; i<_param->_nb_port_write      ; i++)
85          PORT_WRITE(out_WRITE_ACK       [i], 1);
86        for (uint32_t i=0; i<_param->_nb_port_read_write ; i++)
87          PORT_WRITE(out_READ_WRITE_ACK  [i], 1);
88      }
89#endif
90   
91    log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End");
92  };
93 
94  RegisterFile_Monolithic::~RegisterFile_Monolithic (void)
95  {
96#ifdef STATISTICS
97    _stat->generate_file(statistics(0));
98    delete _stat;
99#endif
100
101    deallocation ();
102  };
103
104}; // end namespace registerfile_monolithic
105}; // end namespace registerfile
106}; // end namespace generic
107}; // end namespace behavioural         
108}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.