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

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

Modification en profondeur de Component-port_map.
Compilation ok pour Register_unit ... a tester (systemC et vhdl)

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   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    _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
50    if (_usage & USE_SYSTEMC)
51      {
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          {
61            sensitive << *(in_READ_VAL     [i]);
62            if (_param->_have_port_address)
63              sensitive << *(in_READ_ADDRESS [i]);
64          }
65        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
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          }
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]));
78            if (_param->_have_port_address)
79              (*(out_READ_DATA  [i])) (*( in_READ_ADDRESS [i]));
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]));
85            if (_param->_have_port_address)
86              (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i]));
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);
96      }
97#endif
98   
99    log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End");
100  };
101 
102  RegisterFile_Monolithic::~RegisterFile_Monolithic (void)
103  {
104#ifdef STATISTICS
105    if (_usage & USE_STATISTICS)
106      {
107        _stat->generate_file(statistics(0));
108        delete _stat;
109      }
110#endif
111
112    deallocation ();
113  };
114
115}; // end namespace registerfile_monolithic
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.