source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_genMealy_read.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: 2.3 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
10
11namespace morpheo                    {
12namespace behavioural                {
13namespace generic                    {
14namespace registerfile               {
15namespace registerfile_monolithic    {
16
17  void RegisterFile_Monolithic::genMealy_read (void)
18  {
19    log_printf(FUNC,RegisterFile,"genMealy_read","Begin");
20
21#ifdef STATISTICS
22    _stat_nb_read = 0;
23#endif   
24
25    for (uint32_t i=0; i<_param->_nb_port_read; i++)
26      {
27        // Have a write?
28        if ( PORT_READ(in_READ_VAL [i]) == 1)
29          {
30            Taddress_t address;
31            if (_param->_have_port_address)
32              address = PORT_READ(in_READ_ADDRESS[i]);
33            else
34              address = 0;
35            Tdata_t    data    = REGISTER_READ(reg_DATA[address]);
36
37            log_printf(TRACE,RegisterFile,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
38
39#ifdef STATISTICS
40            _stat_nb_read ++;
41#endif   
42            // Write in registerFile
43            PORT_WRITE(out_READ_DATA[i],data);
44          }
45        else
46          {
47            //log_printf(TRACE,RegisterFile,"genMealy_read","Read  [%d] : No   transaction",i);
48            PORT_WRITE(out_READ_DATA[i],0);
49          }
50      }
51
52    for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
53      {
54        Tdata_t data;
55
56        // Have a write?
57        if ( (PORT_READ(in_READ_WRITE_VAL [i]) == 1) and
58             (PORT_READ(in_READ_WRITE_RW  [i]) == RW_READ)
59             )
60          {
61            Taddress_t address;
62            if (_param->_have_port_address)
63              address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
64            else
65              address = 0;
66           
67            data = REGISTER_READ(reg_DATA[address]);
68
69            log_printf(TRACE,RegisterFile,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
70
71#ifdef STATISTICS
72            _stat_nb_read ++;
73#endif   
74            // Write in registerFile
75           
76          }
77        else
78          {
79            //log_printf(TRACE,RegisterFile,"genMealy_read","Read  [%d] : No   transaction",i);
80            data = 0;
81          }
82
83        PORT_WRITE(out_READ_WRITE_RDATA[i],data);
84      }
85
86    log_printf(FUNC,RegisterFile,"genMealy_read","End");
87       
88  };
89
90}; // end namespace registerfile_monolithic
91}; // end namespace registerfile
92}; // end namespace generic
93}; // end namespace behavioural         
94}; // end namespace morpheo             
95#endif
Note: See TracBrowser for help on using the repository browser.