Ignore:
Timestamp:
Oct 4, 2010, 5:22:53 PM (14 years ago)
Author:
choichil
Message:

Synthetic initiator that compiles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp

    r98 r102  
    4545  tmpl(/**/)::VciSyntheticInitiator(
    4646      sc_module_name name,
    47       const  soclib::common::MappingTable &mt,
    48       const  soclib::common::IntTab       &vci_index,
    49       size_t length,    // Packet length (flit numbers)
    50       float  rho,       // Packets ratio on the network
    51       size_t depth,     // Fifo depth
    52       size_t xmesh,     
    53       size_t ymesh,
    54       size_t bc_period = 0, // Broadcast period, if no broadcast => 0
    55       size_t xmin = 0,
    56       size_t xmax = 0,
    57       size_t ymin = 0,
    58       size_t ymax = 0
     47      const soclib::common::MappingTable &mt,
     48      const soclib::common::IntTab       &vci_index,
     49      const uint32_t length,    // Packet length (flit numbers)
     50      const float  rho,       // Packets ratio on the network
     51      const uint32_t depth,     // Fifo depth
     52      const uint32_t xmesh,     
     53      const uint32_t ymesh,
     54      const uint32_t bc_period, // Broadcast period, if no broadcast => 0
     55      const uint32_t xmin,
     56      const uint32_t xmax,
     57      const uint32_t ymin,
     58      const uint32_t ymax
    5959      )
    6060
     
    7171    m_rho(rho),
    7272    m_depth(depth),
    73     m_x(x),
    74     m_y(y),
    7573    m_xmesh(xmesh),
    7674    m_ymesh(ymesh),
     
    8179    m_ymax(ymax),
    8280    m_date_fifo("m_date_fifo", depth),
    83     r_vci_fsm("r_vci_fsm"),
     81    r_vci_fsm("r_vci_fsm")
    8482    {
    8583
     
    160158            } else {
    161159              r_vci_fsm = VCI_SINGLE_SEND ;
    162               destAdress();
     160              r_address_to_send = destAdress();
    163161              m_count = 0;
    164162            }
     
    196194      case VCI_BC_SEND:
    197195        {
    198           m_address_to_send.broadcast_address.xmin = m_xmin;
    199           m_address_to_send.broadcast_address.xmax = m_xmax;
    200           m_address_to_send.broadcast_address.ymin = m_ymin;
    201           m_address_to_send.broadcast_address.ymax = m_ymax;
    202           m_address_to_send.broadcast_address.bc   = 0x3;
     196          r_address_to_send = (((((((((m_xmin << 5) & m_xmax ) << 5 ) & m_ymin ) << 5 ) & m_ymax ) << 5 ) << 17 ) & 0x3) | 0 ;
     197          //m_address_to_send.broadcast_address.xmin = m_xmin;
     198          //m_address_to_send.broadcast_address.xmax = m_xmax;
     199          //m_address_to_send.broadcast_address.ymin = m_ymin;
     200          //m_address_to_send.broadcast_address.ymax = m_ymax;
     201          //m_address_to_send.broadcast_address.bc   = 0x3;
    203202          m_bc_nrsp = (m_xmax - m_xmin) * (m_ymax - m_ymin);
    204203          r_vci_fsm = VCI_BC_SEND;
     
    223222
    224223/////////////////// Filling fifo
    225     if( (rhos < m_rho) && (rand()/RAND_MAX) ){
     224    if( (m_rhos < m_rho) && (rand()/RAND_MAX) ){
    226225      if (m_date_fifo.wok()){
    227226        date_fifo_put = true ;
    228227      }
    229       if (!r_broadcast_req.read() && (m_cpt_cycles % bc_period)){
     228      if (!r_broadcast_req.read() && (m_cpt_cycles % m_bc_period)){
    230229        r_broadcast_req = true;
    231230      }
     
    288287        {
    289288          p_vci.cmdval  = true;                 
    290           p_vci.address = (typename vci_param::addr_t)(m_address_to_send+(m_count*4));
     289          p_vci.address = (vci_addr_t)(r_address_to_send.read() + (m_count*4));
    291290          p_vci.plen    = m_length*4;                                         
    292291          p_vci.wdata   = 0;                                       
     
    316315        {
    317316          p_vci.cmdval  = true;                 
    318           p_vci.address = (typename vci_param::addr_t) m_address_to_send;
     317          p_vci.address = (vci_addr_t) r_address_to_send.read();
    319318          p_vci.plen    = 4;                                         
    320319          p_vci.wdata   = 0;                                       
Note: See TracChangeset for help on using the changeset viewer.