1 | #ifdef SYSTEMC |
---|
2 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
3 | /* |
---|
4 | * $Id: RegisterFile_Multi_Banked_transition.cpp 111 2009-02-27 18:37:40Z rosiere $ |
---|
5 | * |
---|
6 | * [ Description ] |
---|
7 | * |
---|
8 | */ |
---|
9 | |
---|
10 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h" |
---|
11 | |
---|
12 | namespace morpheo { |
---|
13 | namespace behavioural { |
---|
14 | namespace generic { |
---|
15 | namespace registerfile { |
---|
16 | namespace 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 | if (0) |
---|
41 | { |
---|
42 | log_printf(TRACE,RegisterFile,FUNCTION," * Dump RegisterFile"); |
---|
43 | |
---|
44 | uint32_t limit = 4; |
---|
45 | |
---|
46 | for (uint32_t i=0; i<_param->_nb_bank; i++) |
---|
47 | { |
---|
48 | |
---|
49 | log_printf(TRACE,RegisterFile,FUNCTION," Bank %d",i); |
---|
50 | |
---|
51 | for (uint32_t j=0; j<_param->_nb_word_by_bank; j+=limit) |
---|
52 | { |
---|
53 | std::string str = ""; |
---|
54 | |
---|
55 | for (uint32_t k=0; k<limit; k++) |
---|
56 | { |
---|
57 | uint32_t index = j+k; |
---|
58 | if (index >= _param->_nb_word) |
---|
59 | break; |
---|
60 | else |
---|
61 | str+=toString("[%.4d] %.8x ",index,reg_DATA[i][index]); |
---|
62 | } |
---|
63 | |
---|
64 | log_printf(TRACE,RegisterFile,FUNCTION," %s",str.c_str()); |
---|
65 | } |
---|
66 | } |
---|
67 | } |
---|
68 | #endif |
---|
69 | |
---|
70 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
71 | end_cycle(); |
---|
72 | #endif |
---|
73 | |
---|
74 | log_end(RegisterFile_Multi_Banked,FUNCTION); |
---|
75 | }; |
---|
76 | |
---|
77 | }; // end namespace registerfile_multi_banked |
---|
78 | }; // end namespace registerfile |
---|
79 | }; // end namespace generic |
---|
80 | |
---|
81 | }; // end namespace behavioural |
---|
82 | }; // end namespace morpheo |
---|
83 | #endif |
---|
84 | //#endif |
---|