source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_transition.cpp @ 124

Last change on this file since 124 was 124, checked in by rosiere, 15 years ago

1) Add test and configuration
2) Fix Bug
3) Add log file in load store unit
4) Fix Bug in environment

  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1#ifdef SYSTEMC
2//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
3/*
4 * $Id: RegisterFile_Multi_Banked_transition.cpp 124 2009-06-17 12:11:25Z 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    if (_param->_have_init_value and (PORT_READ(in_NRESET) == 0))
28      {
29        for (uint32_t i=0; i<_param->_nb_bank; ++i)
30          for (uint32_t j=0; j<_param->_nb_word; ++j)
31          reg_DATA[i][j] = fromString<Tdata_t>(_param->_init_value);
32      }
33    else
34      {
35        for (uint32_t i=0; i<_param->_nb_port_write; i++)
36          {
37            if (internal_WRITE_VAL [i] == 1)
38              {
39                Tdata_t data = PORT_READ(in_WRITE_DATA   [i]);
40               
41                // Write in registerFile
42                reg_DATA[internal_WRITE_BANK[i]][internal_WRITE_NUM_REG[i]] = data;
43              }
44          }
45      }
46
47#if defined(DEBUG_RegisterFile_Multi_Banked) and DEBUG_RegisterFile_Multi_Banked and (DEBUG >= DEBUG_TRACE)
48    if (0)
49    {
50      log_printf(TRACE,RegisterFile,FUNCTION,"  * Dump RegisterFile");
51
52      uint32_t limit = 4;
53     
54      for (uint32_t i=0; i<_param->_nb_bank; i++)
55        {
56         
57          log_printf(TRACE,RegisterFile,FUNCTION,"  Bank %d",i);
58
59          for (uint32_t j=0; j<_param->_nb_word_by_bank; j+=limit)
60            {
61              std::string str = "";
62             
63              for (uint32_t k=0; k<limit; k++)
64                {
65                  uint32_t index = j+k;
66                  if (index >= _param->_nb_word)
67                    break;
68                  else
69                    str+=toString("[%.4d] %.8x ",index,reg_DATA[i][index]);
70                }
71             
72              log_printf(TRACE,RegisterFile,FUNCTION,"  %s",str.c_str());
73            }
74        }
75    }
76#endif
77
78#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
79    end_cycle();
80#endif
81
82    log_end(RegisterFile_Multi_Banked,FUNCTION);
83  };
84
85}; // end namespace registerfile_multi_banked
86}; // end namespace registerfile
87}; // end namespace generic
88
89}; // end namespace behavioural
90}; // end namespace morpheo             
91#endif
92//#endif
Note: See TracBrowser for help on using the repository browser.