source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_transition.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
Line 
1#ifdef SYSTEMC
2//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
3/*
4 * $Id: RegisterFile_Multi_Banked_transition.cpp 106 2009-02-09 22:55:26Z rosiere $
5 *
6 * [ Description ]
7 *
8 */
9
10#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace generic {
15namespace registerfile {
16namespace registerfile_multi_banked {
17
18#undef  FUNCTION
19#define FUNCTION "RegisterFile_Multi_Banked::transition"
20  void RegisterFile_Multi_Banked::transition (void)
21  {
22    log_begin(RegisterFile_Multi_Banked,FUNCTION);
23    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
24   
25    // call function pointer
26//     (this->*function_transition) ();
27
28    for (uint32_t i=0; i<_param->_nb_port_write; i++)
29      {
30        if (internal_WRITE_VAL [i] == 1)
31          {
32            Tdata_t data = PORT_READ(in_WRITE_DATA   [i]);
33           
34            // Write in registerFile
35            reg_DATA[internal_WRITE_BANK[i]][internal_WRITE_NUM_REG[i]] = data;
36          }
37      }
38
39#if defined(DEBUG_RegisterFile_Multi_Banked) and DEBUG_RegisterFile_Multi_Banked and (DEBUG >= DEBUG_TRACE)
40    {
41      log_printf(TRACE,RegisterFile,FUNCTION,"  * Dump RegisterFile");
42
43      uint32_t limit = 4;
44     
45      for (uint32_t i=0; i<_param->_nb_bank; i++)
46        {
47         
48          log_printf(TRACE,RegisterFile,FUNCTION,"  Bank %d",i);
49
50          for (uint32_t j=0; j<_param->_nb_word_by_bank; j+=limit)
51            {
52              std::string str = "";
53             
54              for (uint32_t k=0; k<limit; k++)
55                {
56                  uint32_t index = j+k;
57                  if (index >= _param->_nb_word)
58                    break;
59                  else
60                    str+=toString("[%.4d] %.8x ",index,reg_DATA[i][index]);
61                }
62             
63              log_printf(TRACE,RegisterFile,FUNCTION,"  %s",str.c_str());
64            }
65        }
66    }
67#endif
68
69#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
70    end_cycle();
71#endif
72
73    log_end(RegisterFile_Multi_Banked,FUNCTION);
74  };
75
76}; // end namespace registerfile_multi_banked
77}; // end namespace registerfile
78}; // end namespace generic
79
80}; // end namespace behavioural
81}; // end namespace morpheo             
82#endif
83//#endif
Note: See TracBrowser for help on using the repository browser.