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

Last change on this file since 66 was 66, checked in by rosiere, 17 years ago
  • un pas de plus vers la compatibilite avec systemC
  • modification de l'interface de read_queue : context_id devient context_id, front_end_id et ooo_engine_id
File size: 3.1 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 ();
[66]54        sensitive << (*(in_CLOCK)).pos();
[57]55       
56        SC_METHOD (genMealy_read);
57        dont_initialize ();
[66]58        sensitive << (*(in_CLOCK)).neg();
[57]59        for (uint32_t i=0; i<_param->_nb_port_read; i++)
[62]60          {
61            sensitive << *(in_READ_VAL     [i]);
62            if (_param->_have_port_address)
63              sensitive << *(in_READ_ADDRESS [i]);
64          }
[57]65        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
[62]66          {
67            sensitive << *(in_READ_WRITE_VAL     [i])
68                      << *(in_READ_WRITE_RW      [i]);
69            if (_param->_have_port_address)
70              sensitive << *(in_READ_WRITE_ADDRESS [i]);
71          }
[57]72       
73#  ifdef SYSTEMCASS_SPECIFIC
74        // List dependency information
75        for (uint32_t i=0; i<_param->_nb_port_read; i++)
76          {
77            (*(out_READ_DATA  [i])) (*( in_READ_VAL     [i]));
[62]78            if (_param->_have_port_address)
79              (*(out_READ_DATA  [i])) (*( in_READ_ADDRESS [i]));
[57]80          }
81        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
82          { 
83            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL     [i]));
84            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW      [i]));
[62]85            if (_param->_have_port_address)
86              (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i]));
[57]87          }
88#  endif   
89       
90        for (uint32_t i=0; i<_param->_nb_port_read       ; i++)
91          PORT_WRITE(out_READ_ACK        [i], 1);
92        for (uint32_t i=0; i<_param->_nb_port_write      ; i++)
93          PORT_WRITE(out_WRITE_ACK       [i], 1);
94        for (uint32_t i=0; i<_param->_nb_port_read_write ; i++)
95          PORT_WRITE(out_READ_WRITE_ACK  [i], 1);
[2]96      }
97#endif
[57]98   
[41]99    log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End");
[2]100  };
101 
[15]102  RegisterFile_Monolithic::~RegisterFile_Monolithic (void)
[2]103  {
104#ifdef STATISTICS
[58]105    if (_usage & USE_STATISTICS)
106      {
107        _stat->generate_file(statistics(0));
108        delete _stat;
109      }
[2]110#endif
[41]111
112    deallocation ();
[2]113  };
114
[15]115}; // end namespace registerfile_monolithic
[2]116}; // end namespace registerfile
117}; // end namespace generic
118}; // end namespace behavioural         
119}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.