source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.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.0 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  void RegisterFile_Monolithic::transition (void)
17  {
18    log_printf(FUNC,RegisterFile,"transition","Begin");
19#ifdef STATISTICS
20    _stat_nb_write = 0;
21#endif   
22
23    for (uint32_t i=0; i<_param->_nb_port_write; i++)
24      {
25        // Have a write?
26        if ( PORT_READ(in_WRITE_VAL[i]) == true)
27          {
28#ifdef STATISTICS
29            _stat_nb_write ++;
30#endif   
31
32            Taddress_t address = PORT_READ(in_WRITE_ADDRESS[i]);
33            Tdata_t    data    = PORT_READ(in_WRITE_DATA   [i]);
34           
35            log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
36
37            // Write in registerFile
38            REGISTER_WRITE(reg_DATA[address],data);
39          }
40      }
41    for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
42      {
43        // Have a read_write?
44        if ( (PORT_READ(in_READ_WRITE_VAL[i]) == true) and
45             (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE))
46          {
47#ifdef STATISTICS
48            _stat_nb_write ++;
49#endif   
50
51            Taddress_t address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
52            Tdata_t    data    = PORT_READ(in_READ_WRITE_WDATA  [i]);
53           
54            log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
55
56            // Write in registerFile
57            REGISTER_WRITE(reg_DATA[address],data);
58          }
59      }
60
61#ifdef STATISTICS
62    _stat->add(_stat_nb_read,_stat_nb_write);
63#endif   
64
65#ifdef VHDL_TESTBENCH
66    vhdl_testbench_transition ();
67#endif
68    log_printf(FUNC,RegisterFile,"transition","End");
69  };
70
71}; // end namespace registerfile_monolithic
72}; // end namespace registerfile
73}; // end namespace generic
74}; // end namespace behavioural         
75}; // end namespace morpheo             
76#endif
Note: See TracBrowser for help on using the repository browser.