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

Last change on this file since 106 was 106, checked in by rosiere, 15 years ago

1) RAT : Fix bug when update and event in same cycle
2) Context State : Compute depth
3) Load Store Unit : In check logic, translate all access in little endian. More easy to check
4) UFPT : End Event

  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: RegisterFile_Monolithic_genMealy_read.cpp 106 2009-02-09 22:55:26Z rosiere $
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#undef  FUNCTION
18#define FUNCTION "RegisterFile_Monolithic::genMealy_read"
19  void RegisterFile_Monolithic::genMealy_read (void)
20  {
21    log_begin(RegisterFile_Monolithic,FUNCTION);
22    log_function(RegisterFile_Monolithic,FUNCTION,_name.c_str());
23
24    for (uint32_t i=0; i<_param->_nb_port_read; i++)
25      {
26        // Have a write?
27        if ( PORT_READ(in_READ_VAL [i]) == 1)
28          {
29            Taddress_t address;
30            if (_param->_have_port_address)
31              address = PORT_READ(in_READ_ADDRESS[i]);
32            else
33              address = 0;
34            Tdata_t    data    = reg_DATA[address];
35
36            log_printf(TRACE,RegisterFile,FUNCTION,"  * [%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
37
38            // Write in registerFile
39            PORT_WRITE(out_READ_DATA[i],data);
40          }
41        else
42          {
43            //log_printf(TRACE,RegisterFile,FUNCTION,"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 = reg_DATA[address];
64
65            log_printf(TRACE,RegisterFile,FUNCTION,"  * [%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
66          }
67        else
68          {
69            //log_printf(TRACE,RegisterFile,FUNCTION,"Read  [%d] : No   transaction",i);
70            data = 0;
71          }
72
73        PORT_WRITE(out_READ_WRITE_RDATA[i],data);
74      }
75
76    log_end(RegisterFile_Monolithic,FUNCTION);
77  };
78
79}; // end namespace registerfile_monolithic
80}; // end namespace registerfile
81}; // end namespace generic
82}; // end namespace behavioural         
83}; // end namespace morpheo             
84#endif
Note: See TracBrowser for help on using the repository browser.