Ignore:
Timestamp:
Jul 12, 2013, 12:16:30 PM (11 years ago)
Author:
alain
Message:

Introducing a preliminary configuration interface in vci_mem_cache.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h

    r430 r434  
    7777
    7878      /* States of the TGT_CMD fsm */
    79       enum tgt_cmd_fsm_state_e{
     79      enum tgt_cmd_fsm_state_e
     80      {
    8081        TGT_CMD_IDLE,
    8182        TGT_CMD_ERROR,
    8283        TGT_CMD_READ,
    8384        TGT_CMD_WRITE,
    84         TGT_CMD_CAS
     85        TGT_CMD_CAS,
     86        TGT_CMD_CONFIG
    8587      };
    8688
     
    144146        MULTI_ACK_UPT_LOCK,
    145147        MULTI_ACK_UPT_CLEAR,
    146         MULTI_ACK_WRITE_RSP
     148        MULTI_ACK_WRITE_RSP,
     149        MULTI_ACK_CONFIG_ACK
     150      };
     151
     152      /* States of the CONFIG fsm */
     153      enum config_fsm_state_e
     154      {
     155        CONFIG_IDLE,
     156        CONFIG_LOOP,
     157        CONFIG_RSP,
     158        CONFIG_DIR_REQ,
     159        CONFIG_DIR_ACCESS,
     160        CONFIG_DIR_INVAL,
     161        CONFIG_BC_UPT_LOCK,
     162        CONFIG_BC_SEND,
     163        CONFIG_BC_WAIT,
     164       
     165        CONFIG_UPT_WAIT,
     166
     167        CONFIG_UPT_LOCK,
     168
     169        CONFIG_HEAP_REQ
    147170      };
    148171
     
    277300        CLEANUP_UPT_CLEAR,
    278301        CLEANUP_WRITE_RSP,
    279         CLEANUP_SEND_ACK
     302        CLEANUP_CONFIG_ACK,
     303        CLEANUP_SEND_CLACK
    280304      };
    281305
     
    284308      {
    285309        ALLOC_DIR_RESET,
     310        ALLOC_DIR_CONFIG,
    286311        ALLOC_DIR_READ,
    287312        ALLOC_DIR_WRITE,
     
    304329      enum alloc_upt_fsm_state_e
    305330      {
     331        ALLOC_UPT_CONFIG,
    306332        ALLOC_UPT_WRITE,
    307333        ALLOC_UPT_XRAM_RSP,
     
    350376      };
    351377
     378      /* Configuration commands */
     379      enum cmd_config_type_e
     380      {
     381          CMD_CONFIG_INVAL = 0,
     382          CMD_CONFIG_SYNC  = 1
     383      };
     384
    352385      // debug variables (for each FSM)
    353       bool         m_debug_global;
    354       bool         m_debug_tgt_cmd_fsm;
    355       bool         m_debug_tgt_rsp_fsm;
    356       bool         m_debug_cc_send_fsm;
    357       bool         m_debug_cc_receive_fsm;
    358       bool         m_debug_multi_ack_fsm;
    359       bool         m_debug_read_fsm;
    360       bool         m_debug_write_fsm;
    361       bool         m_debug_cas_fsm;
    362       bool         m_debug_cleanup_fsm;
    363       bool         m_debug_ixr_cmd_fsm;
    364       bool         m_debug_ixr_rsp_fsm;
    365       bool         m_debug_xram_rsp_fsm;
     386      bool         m_debug;
    366387      bool         m_debug_previous_hit;
    367388      size_t       m_debug_previous_count;
     
    373394      // instrumentation counters
    374395      uint32_t     m_cpt_cycles;        // Counter of cycles
     396
    375397      uint32_t     m_cpt_read;          // Number of READ transactions
     398      uint32_t     m_cpt_read_remote;   // number of remote READ transactions
     399      uint32_t     m_cpt_read_flits;    // number of flits for READs
     400      uint32_t     m_cpt_read_cost;     // Number of (flits * distance) for READs
     401
    376402      uint32_t     m_cpt_read_miss;     // Number of MISS READ
     403
    377404      uint32_t     m_cpt_write;         // Number of WRITE transactions
     405      uint32_t     m_cpt_write_remote;  // number of remote WRITE transactions
     406      uint32_t     m_cpt_write_flits;   // number of flits for WRITEs
     407      uint32_t     m_cpt_write_cost;    // Number of (flits * distance) for WRITEs
     408
    378409      uint32_t     m_cpt_write_miss;    // Number of MISS WRITE
    379410      uint32_t     m_cpt_write_cells;   // Cumulated length for WRITE transactions
     
    391422      uint32_t     m_cpt_cas;           // Number of CAS transactions
    392423
     424      uint32_t     m_cpt_cleanup_cost;  // Number of (flits * distance) for CLEANUPs
     425
     426      uint32_t     m_cpt_update_flits;  // Number of flits for UPDATEs
     427      uint32_t     m_cpt_update_cost;   // Number of (flits * distance) for UPDATEs
     428
     429      uint32_t     m_cpt_inval_cost;    // Number of (flits * distance) for INVALs
     430
     431      uint32_t     m_cpt_get;
     432
     433      uint32_t     m_cpt_put;
     434
    393435      size_t       m_prev_count;
    394436
     
    407449      VciMemCache(
    408450          sc_module_name name,                                // Instance Name
    409           const soclib::common::MappingTable &mtp,            // Mapping table direct network
    410           const soclib::common::MappingTable &mtx,            // Mapping table external network
    411           const soclib::common::IntTab       &srcid_x,        // global index on external network
    412           const soclib::common::IntTab       &tgtid_d,        // global index on direct network
    413           const size_t                       cc_global_id,    // global index on cc network
     451          const soclib::common::MappingTable &mtp,            // Mapping table INT network
     452          const soclib::common::MappingTable &mtx,            // Mapping table RAM network
     453          const soclib::common::IntTab       &srcid_x,        // global index RAM network
     454          const soclib::common::IntTab       &tgtid_d,        // global index INT network
     455          const size_t                       cc_global_id,    // global index CC network
    414456          const size_t                       nways,           // Number of ways per set
    415457          const size_t                       nsets,           // Number of sets
    416458          const size_t                       nwords,          // Number of words per line
    417           const size_t                       max_copies,      // max number of copies in heap
     459          const size_t                       max_copies,      // max number of copies
    418460          const size_t                       heap_size=HEAP_ENTRIES,
    419461          const size_t                       trt_lines=TRT_ENTRIES,
     
    437479
    438480      // Component attributes
    439       std::list<soclib::common::Segment> m_seglist;          // segments allocated to memcache
     481      std::list<soclib::common::Segment> m_seglist;          // segments allocated
    440482      size_t                             m_nseg;             // number of segments
    441483      soclib::common::Segment            **m_seg;            // array of segments pointers
    442       const size_t                       m_srcid_x;          // global index on external network
     484      size_t                             m_seg_config;       // config segment index
     485      const size_t                       m_srcid_x;          // global index on RAM network
    443486      const size_t                       m_initiators;       // Number of initiators
    444487      const size_t                       m_heap_size;        // Size of the heap
     
    458501      size_t                             m_max_copies;       // max number of copies in heap
    459502      GenericLLSCGlobalTable
    460       < 32  ,                              // number of slots
    461         4096,                              // number of processors in the system
    462         8000,                              // registration life (# of LL operations)
    463         addr_t >  m_llsc_table;            // ll/sc global registration table
     503      < 32  ,    // number of slots
     504        4096,    // number of processors in the system
     505        8000,    // registration life (# of LL operations)
     506        addr_t >                         m_llsc_table;       // ll/sc registration table
    464507
    465508      // adress masks
     
    511554      // (segmentation violation response request)
    512555      sc_signal<bool>     r_tgt_cmd_to_tgt_rsp_req;
     556
     557      sc_signal<uint32_t> r_tgt_cmd_to_tgt_rsp_rdata;
     558      sc_signal<size_t>   r_tgt_cmd_to_tgt_rsp_error;
    513559      sc_signal<size_t>   r_tgt_cmd_to_tgt_rsp_srcid;
    514560      sc_signal<size_t>   r_tgt_cmd_to_tgt_rsp_trdid;
    515561      sc_signal<size_t>   r_tgt_cmd_to_tgt_rsp_pktid;
    516562
     563      sc_signal<addr_t>   r_tgt_cmd_config_addr;
     564      sc_signal<size_t>   r_tgt_cmd_config_cmd;
     565
     566      ///////////////////////////////////////////////////////
     567      // Registers controlled by the CONFIG fsm
     568      ///////////////////////////////////////////////////////
     569
     570      sc_signal<int>      r_config_fsm;        // FSM state
     571      sc_signal<bool>     r_config_lock;       // lock protecting exclusive access
     572      sc_signal<int>      r_config_cmd;        // config request status
     573      sc_signal<addr_t>   r_config_address;    // target buffer physical address
     574      sc_signal<size_t>   r_config_srcid;      // config request srcid
     575      sc_signal<size_t>   r_config_trdid;      // config request trdid
     576      sc_signal<size_t>   r_config_pktid;      // config request pktid
     577      sc_signal<size_t>   r_config_nlines;     // number of lines covering the buffer
     578      sc_signal<size_t>   r_config_way;        // selected way
     579      sc_signal<size_t>   r_config_count;      // number of copies
     580      sc_signal<size_t>   r_config_upt_index;  // UPT index
     581      sc_signal<bool>     r_config_is_cnt;     // counter mode (broadcast required)
     582
     583      // Buffer between CONFIG fsm and TGT_RSP fsm (send a done response to L1 cache)
     584      sc_signal<bool>     r_config_to_tgt_rsp_req;    // valid request
     585      sc_signal<bool>     r_config_to_tgt_rsp_error;  // error response
     586      sc_signal<size_t>   r_config_to_tgt_rsp_srcid;  // Transaction srcid
     587      sc_signal<size_t>   r_config_to_tgt_rsp_trdid;  // Transaction trdid
     588      sc_signal<size_t>   r_config_to_tgt_rsp_pktid;  // Transaction pktid
     589
     590      // Buffer between CONFIG fsm and CC_SEND fsm (multi-inval / broadcast-inval)
     591      sc_signal<bool>     r_config_to_cc_send_multi_req;    // multi-inval request
     592      sc_signal<bool>     r_config_to_cc_send_brdcast_req;  // broadcast-inval request
     593      sc_signal<size_t>   r_config_to_cc_send_nline;        // line index
     594      sc_signal<size_t>   r_config_to_cc_send_trdid;        // UPT index
     595
    517596      ///////////////////////////////////////////////////////
    518597      // Registers controlled by the READ fsm
    519598      ///////////////////////////////////////////////////////
    520599
    521       sc_signal<int>      r_read_fsm;        // FSM state
    522       sc_signal<size_t>   r_read_copy;       // Srcid of the first copy
    523       sc_signal<size_t>   r_read_copy_cache; // Srcid of the first copy
    524       sc_signal<bool>     r_read_copy_inst;  // Type of the first copy
    525       sc_signal<tag_t>    r_read_tag;        // cache line tag (in directory)
    526       sc_signal<bool>     r_read_is_cnt;     // is_cnt bit (in directory)
    527       sc_signal<bool>     r_read_lock;       // lock bit (in directory)
    528       sc_signal<bool>     r_read_dirty;      // dirty bit (in directory)
    529       sc_signal<size_t>   r_read_count;      // number of copies
    530       sc_signal<size_t>   r_read_ptr;        // pointer to the heap
    531       sc_signal<data_t> * r_read_data;       // data (one cache line)
    532       sc_signal<size_t>   r_read_way;        // associative way (in cache)
    533       sc_signal<size_t>   r_read_trt_index;  // Transaction Table index
    534       sc_signal<size_t>   r_read_next_ptr;   // Next entry to point to
    535       sc_signal<bool>     r_read_last_free;  // Last free entry
    536       sc_signal<addr_t>   r_read_ll_key;     // LL key from the llsc_global_table
     600      sc_signal<int>      r_read_fsm;          // FSM state
     601      sc_signal<size_t>   r_read_copy;         // Srcid of the first copy
     602      sc_signal<size_t>   r_read_copy_cache;   // Srcid of the first copy
     603      sc_signal<bool>     r_read_copy_inst;    // Type of the first copy
     604      sc_signal<tag_t>    r_read_tag;          // cache line tag (in directory)
     605      sc_signal<bool>     r_read_is_cnt;       // is_cnt bit (in directory)
     606      sc_signal<bool>     r_read_lock;         // lock bit (in directory)
     607      sc_signal<bool>     r_read_dirty;        // dirty bit (in directory)
     608      sc_signal<size_t>   r_read_count;        // number of copies
     609      sc_signal<size_t>   r_read_ptr;          // pointer to the heap
     610      sc_signal<data_t> * r_read_data;         // data (one cache line)
     611      sc_signal<size_t>   r_read_way;          // associative way (in cache)
     612      sc_signal<size_t>   r_read_trt_index;    // Transaction Table index
     613      sc_signal<size_t>   r_read_next_ptr;     // Next entry to point to
     614      sc_signal<bool>     r_read_last_free;    // Last free entry
     615      sc_signal<addr_t>   r_read_ll_key;       // LL key from the llsc_global_table
    537616
    538617      // Buffer between READ fsm and IXR_CMD fsm (ask a missing cache line to XRAM)
     
    626705      sc_signal<addr_t>   r_multi_ack_nline;     // pending write nline
    627706
     707      // signaling completion of multi-inval to CONFIG fsm
     708      sc_signal<bool>     r_multi_ack_to_config_ack;
     709
    628710      // Buffer between MULTI_ACK fsm and TGT_RSP fsm (complete write/update transaction)
    629711      sc_signal<bool>     r_multi_ack_to_tgt_rsp_req;   // valid request
     
    662744      sc_signal<size_t>   r_cleanup_way;           // associative way (in cache)
    663745
    664       sc_signal<size_t>   r_cleanup_write_srcid;   // srcid of write response
     746      sc_signal<size_t>   r_cleanup_write_srcid;   // srcid of write rsp
    665747      sc_signal<size_t>   r_cleanup_write_trdid;   // trdid of write rsp
    666748      sc_signal<size_t>   r_cleanup_write_pktid;   // pktid of write rsp
    667       sc_signal<bool>     r_cleanup_write_need_rsp;// needs a write rsp
     749
     750      sc_signal<bool>     r_cleanup_need_rsp;      // write response required
     751      sc_signal<bool>     r_cleanup_need_ack;      // config acknowledge required
    668752
    669753      sc_signal<size_t>   r_cleanup_index;         // index of the INVAL line (in the UPT)
    670754
     755      // signaling completion of broadcast-inval to CONFIG fsm
     756      sc_signal<bool>     r_cleanup_to_config_ack; 
     757       
    671758      // Buffer between CLEANUP fsm and TGT_RSP fsm (acknowledge a write command from L1)
    672759      sc_signal<bool>     r_cleanup_to_tgt_rsp_req;   // valid request
Note: See TracChangeset for help on using the changeset viewer.