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

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

Ajout SystemC read_queue et reservation_station
Ajout port au bloc registerfile_monolithic (à ajouter également au bloc registerfile et registerfile_multi_banked)
Modif param : passage de pointeur (attention, tous les composants n'ont pas été tous modifier)

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