source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_transition.cpp @ 2

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 1.3 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/RegisterFile/include/RegisterFile.h"
10
11namespace morpheo                    {
12namespace behavioural                {
13namespace generic                    {
14namespace registerfile               {
15
16  void RegisterFile::transition (void)
17  {
18    log_printf(FUNC,Register_File,"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_ENABLE[i]) == true)
27          {
28            log_printf(TRACE,Register_File,"transition","Write [%d] : Have transaction, Reg[%d] <- %x",i,PORT_READ(in_WRITE_ADDRESS[i]),PORT_READ(in_WRITE_DATA   [i]));
29           
30#ifdef STATISTICS
31            _stat_nb_write ++;
32#endif   
33
34            Taddress_t address = PORT_READ(in_WRITE_ADDRESS[i]);
35            Tdata_t    data    = PORT_READ(in_WRITE_DATA   [i]);
36           
37            // Write in registerFile
38            REGISTER_WRITE(reg_DATA[address],data);
39          }
40      }
41
42#ifdef STATISTICS
43    _stat->add(_stat_nb_read,_stat_nb_write);
44#endif   
45
46#ifdef VHDL_TESTBENCH
47    vhdl_testbench_transition (*_vhdl_testbench);
48#endif
49    log_printf(FUNC,Register_File,"transition","End");
50  };
51
52}; // end namespace registerfile
53}; // end namespace generic
54}; // end namespace behavioural         
55}; // end namespace morpheo             
56#endif
Note: See TracBrowser for help on using the repository browser.