source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp @ 59

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

Vhdl : RegisterFile_Multi_Banked - "full crossbar"
Correction d'un bug pour le "partial crossbar"

File size: 2.9 KB
RevLine 
[2]1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
[15]8#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
[2]9
10namespace morpheo                    {
11namespace behavioural                {
12namespace generic                    {
13namespace registerfile               {
[15]14namespace registerfile_monolithic    {
[2]15
[57]16  RegisterFile_Monolithic::RegisterFile_Monolithic
17  (
[2]18#ifdef SYSTEMC
[57]19   sc_module_name name,
[2]20#else
[57]21   string name        ,
[2]22#endif
23#ifdef STATISTICS
[57]24   morpheo::behavioural::Parameters_Statistics            * param_statistics,
[2]25#endif
[57]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)
[2]32  {
[41]33    log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","Begin");
34
35    log_printf(INFO,RegisterFile_Monolithic,"RegisterFile_Monolithic","Allocation");
36    allocation ();
37
[2]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
[57]50    if (_usage & USE_SYSTEMC)
[2]51      {
[57]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);
[2]88      }
89#endif
[57]90   
[41]91    log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End");
[2]92  };
93 
[15]94  RegisterFile_Monolithic::~RegisterFile_Monolithic (void)
[2]95  {
96#ifdef STATISTICS
[58]97    if (_usage & USE_STATISTICS)
98      {
99        _stat->generate_file(statistics(0));
100        delete _stat;
101      }
[2]102#endif
[41]103
104    deallocation ();
[2]105  };
106
[15]107}; // end namespace registerfile_monolithic
[2]108}; // end namespace registerfile
109}; // end namespace generic
110}; // end namespace behavioural         
111}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.