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

Last change on this file since 75 was 75, checked in by rosiere, 16 years ago

Update all component (except front_end) to :

  • new statistics model
  • no namespace std
File size: 3.1 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   std::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    if (_usage & USE_STATISTICS)
40      statistics_declaration(param_statistics);
41#endif
42
43#ifdef VHDL
44    // generate the vhdl
45    vhdl();
46#endif
47
48#ifdef SYSTEMC
49    if (_usage & USE_SYSTEMC)
50      {
51        SC_METHOD (transition);
52        dont_initialize ();
53        sensitive << (*(in_CLOCK)).pos();
54       
55        SC_METHOD (genMealy_read);
56        dont_initialize ();
57        sensitive << (*(in_CLOCK)).neg();
58        for (uint32_t i=0; i<_param->_nb_port_read; i++)
59          {
60            sensitive << *(in_READ_VAL     [i]);
61            if (_param->_have_port_address)
62              sensitive << *(in_READ_ADDRESS [i]);
63          }
64        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
65          {
66            sensitive << *(in_READ_WRITE_VAL     [i])
67                      << *(in_READ_WRITE_RW      [i]);
68            if (_param->_have_port_address)
69              sensitive << *(in_READ_WRITE_ADDRESS [i]);
70          }
71       
72# ifdef SYSTEMCASS_SPECIFIC
73        // List dependency information
74        for (uint32_t i=0; i<_param->_nb_port_read; i++)
75          {
76            (*(out_READ_DATA  [i])) (*( in_READ_VAL     [i]));
77            if (_param->_have_port_address)
78              (*(out_READ_DATA  [i])) (*( in_READ_ADDRESS [i]));
79          }
80        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
81          { 
82            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL     [i]));
83            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW      [i]));
84            if (_param->_have_port_address)
85              (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i]));
86          }
87# endif   
88       
89        for (uint32_t i=0; i<_param->_nb_port_read       ; i++)
90          PORT_WRITE(out_READ_ACK        [i], 1);
91        for (uint32_t i=0; i<_param->_nb_port_write      ; i++)
92          PORT_WRITE(out_WRITE_ACK       [i], 1);
93        for (uint32_t i=0; i<_param->_nb_port_read_write ; i++)
94          PORT_WRITE(out_READ_WRITE_ACK  [i], 1);
95      }
96#endif
97   
98    log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End");
99  };
100 
101  RegisterFile_Monolithic::~RegisterFile_Monolithic (void)
102  {
103#ifdef STATISTICS
104    if (_usage & USE_STATISTICS)
105      delete _stat;
106#endif
107
108    deallocation ();
109  };
110
111}; // end namespace registerfile_monolithic
112}; // end namespace registerfile
113}; // end namespace generic
114}; // end namespace behavioural         
115}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.