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
RevLine 
[2]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
[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
[106]17#undef  FUNCTION
18#define FUNCTION "RegisterFile_Monolithic::genMealy_read"
[15]19  void RegisterFile_Monolithic::genMealy_read (void)
[2]20  {
[106]21    log_begin(RegisterFile_Monolithic,FUNCTION);
22    log_function(RegisterFile_Monolithic,FUNCTION,_name.c_str());
[2]23
[55]24    for (uint32_t i=0; i<_param->_nb_port_read; i++)
[2]25      {
26        // Have a write?
[6]27        if ( PORT_READ(in_READ_VAL [i]) == 1)
[2]28          {
[62]29            Taddress_t address;
30            if (_param->_have_port_address)
31              address = PORT_READ(in_READ_ADDRESS[i]);
32            else
33              address = 0;
[78]34            Tdata_t    data    = reg_DATA[address];
[3]35
[106]36            log_printf(TRACE,RegisterFile,FUNCTION,"  * [%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
[3]37
[2]38            // Write in registerFile
[3]39            PORT_WRITE(out_READ_DATA[i],data);
[2]40          }
41        else
42          {
[106]43            //log_printf(TRACE,RegisterFile,FUNCTION,"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           
[78]63            data = reg_DATA[address];
[55]64
[106]65            log_printf(TRACE,RegisterFile,FUNCTION,"  * [%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
[55]66          }
67        else
68          {
[106]69            //log_printf(TRACE,RegisterFile,FUNCTION,"Read  [%d] : No   transaction",i);
[55]70            data = 0;
71          }
72
73        PORT_WRITE(out_READ_WRITE_RDATA[i],data);
74      }
75
[106]76    log_end(RegisterFile_Monolithic,FUNCTION);
[2]77  };
78
[15]79}; // end namespace registerfile_monolithic
[2]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.