source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_partial_crossbar_genMealy_read.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.6 KB
Line 
1#ifdef SYSTEMC
2//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
3/*
4 * $Id: RegisterFile_Multi_Banked_partial_crossbar_genMealy_read.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
19#undef  FUNCTION
20#define FUNCTION "RegisterFile_Multi_Banked::partial_crossbar_genMealy_read"
21  void RegisterFile_Multi_Banked::partial_crossbar_genMealy_read (void)
22  {
23    log_begin(RegisterFile_Multi_Banked,FUNCTION);
24    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
25
26    bool read_port_use [_param->_nb_bank][_param->_nb_port_read_by_bank];
27
28    for (uint32_t i=0; i<_param->_nb_bank; i++)
29      for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j++)
30        read_port_use [i][j]=false;
31
32    for (uint32_t i=0; i<_param->_nb_port_read; i++)
33      {
34        bool val = PORT_READ(in_READ_VAL    [i]);
35        bool ack = false;
36
37        log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"  * read [%d] : %d",i,val);
38
39        if (val == true)
40          {
41            // Compute the adress of the bank
42            Taddress_t address;
43            if (_param->_have_port_address == true)
44              address = PORT_READ(in_READ_ADDRESS[i]);
45            else
46              address = 0;
47            log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * address   : %d",address);
48            Taddress_t bank    = address_bank    (address);
49            log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * bank      : %d",bank   );
50
51//          // Search loop
52//          for (uint32_t j=0; j<_param->_nb_port_read_by_bank; j++)
53//            {
54           
55            uint32_t j = _param->_link_port_read_to_bank_read [i];
56
57                // find a unbusy port on this bank
58                if (read_port_use[bank][j] == false)
59                  {
60                    // find !!!
61                    read_port_use[bank][j] = true;
62                    ack                    = true;
63                   
64                    Taddress_t num_reg = address_num_reg (address);
65
66                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * num_reg   : %d",num_reg);
67                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * bank_port : %d",j);
68
69                    Tdata_t    data    = reg_DATA[bank][num_reg];
70                   
71                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * data      : %d",data);
72
73                    PORT_WRITE(out_READ_DATA [i], data);
74
75//                  break;
76                  }
77//            }
78          }
79
80        // Write output
81        PORT_WRITE(out_READ_ACK [i], ack);
82      }
83
84    log_end(RegisterFile_Multi_Banked,FUNCTION);
85  };
86
87}; // end namespace registerfile_multi_banked
88}; // end namespace registerfile
89}; // end namespace generic
90
91}; // end namespace behavioural
92}; // end namespace morpheo             
93#endif
94//#endif
Note: See TracBrowser for help on using the repository browser.