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

Last change on this file since 55 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
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#ifdef STATISTICS
22    _stat_nb_read = 0;
23#endif   
24
25    for (uint32_t i=0; i<_param->_nb_port_read; i++)
26      {
27        // Have a write?
28        if ( PORT_READ(in_READ_VAL [i]) == 1)
29          {
30            Taddress_t address = PORT_READ(in_READ_ADDRESS[i]);
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 = 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
78    log_printf(FUNC,RegisterFile,"genMealy_read","End");
79       
80  };
81
82}; // end namespace registerfile_monolithic
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.