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

Last change on this file since 59 was 55, checked in by rosiere, 17 years ago

Ajout SystemC read_queue et reservation_station
Ajout port au bloc registerfile_monolithic (à ajouter également au bloc registerfile et registerfile_multi_banked)
Modif param : passage de pointeur (attention, tous les composants n'ont pas été tous modifier)

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
21#ifdef STATISTICS
22    _stat_nb_read = 0;
23#endif   
24
[55]25    for (uint32_t i=0; i<_param->_nb_port_read; i++)
[2]26      {
27        // Have a write?
[6]28        if ( PORT_READ(in_READ_VAL [i]) == 1)
[2]29          {
[3]30            Taddress_t address = PORT_READ(in_READ_ADDRESS[i]);
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
36            _stat_nb_read ++;
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          {
57            Taddress_t address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
58           
59            data = REGISTER_READ(reg_DATA[address]);
60
61            log_printf(TRACE,RegisterFile,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
62
63#ifdef STATISTICS
64            _stat_nb_read ++;
65#endif   
66            // Write in registerFile
67           
68          }
69        else
70          {
71            //log_printf(TRACE,RegisterFile,"genMealy_read","Read  [%d] : No   transaction",i);
72            data = 0;
73          }
74
75        PORT_WRITE(out_READ_WRITE_RDATA[i],data);
76      }
77
[53]78    log_printf(FUNC,RegisterFile,"genMealy_read","End");
[2]79       
80  };
81
[15]82}; // end namespace registerfile_monolithic
[2]83}; // end namespace registerfile
84}; // end namespace generic
85}; // end namespace behavioural         
86}; // end namespace morpheo             
87#endif
Note: See TracBrowser for help on using the repository browser.