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