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
RevLine 
[2]1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
[15]9#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
[2]10
11namespace morpheo                    {
12namespace behavioural                {
13namespace generic                    {
14namespace registerfile               {
[15]15namespace registerfile_monolithic    {
[2]16
[15]17  void RegisterFile_Monolithic::genMealy_read (void)
[2]18  {
[53]19    log_printf(FUNC,RegisterFile,"genMealy_read","Begin");
[2]20
[55]21    for (uint32_t i=0; i<_param->_nb_port_read; i++)
[2]22      {
23        // Have a write?
[6]24        if ( PORT_READ(in_READ_VAL [i]) == 1)
[2]25          {
[62]26            Taddress_t address;
27            if (_param->_have_port_address)
28              address = PORT_READ(in_READ_ADDRESS[i]);
29            else
30              address = 0;
[3]31            Tdata_t    data    = REGISTER_READ(reg_DATA[address]);
32
[53]33            log_printf(TRACE,RegisterFile,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
[3]34
[2]35#ifdef STATISTICS
[71]36            (*_stat_nb_read) ++;
[2]37#endif   
38            // Write in registerFile
[3]39            PORT_WRITE(out_READ_DATA[i],data);
[2]40          }
41        else
42          {
[53]43            //log_printf(TRACE,RegisterFile,"genMealy_read","Read  [%d] : No   transaction",i);
[2]44            PORT_WRITE(out_READ_DATA[i],0);
45          }
46      }
[55]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          {
[62]57            Taddress_t address;
58            if (_param->_have_port_address)
59              address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
60            else
61              address = 0;
[55]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
[53]76    log_printf(FUNC,RegisterFile,"genMealy_read","End");
[2]77       
78  };
79
[15]80}; // end namespace registerfile_monolithic
[2]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.