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

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

Modification of Statisctics
Add a new systemC component : Load_Store_Queue (tested with one benchmark and one configuration). Store don't supported the Data Buss Error (Load is supported)

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