openfpga/src/utils/mux_utils.cpp
/**************************************************
 * Find the number of shared configuration bits for a ReRAM multiplexer
 *************************************************/
Find the number of shared configuration bits for a ReRAM multiplexer
Find the number of shared configuration bits for a ReRAM multiplexer
static 
size_t find_rram_mux_num_shared_config_bits(const CircuitLibrary& circuit_lib,
                                            const CircuitModelId& mux_model,
                                            const MuxGraph& mux_graph, 
                                            const e_config_protocol_type& sram_orgz_type) {
  size_t num_shared_config_bits = 0; 
  switch (sram_orgz_type) {
  case CONFIG_MEM_MEMORY_BANK: {
    for (auto lvl : mux_graph.node_levels()) {
      num_shared_config_bits += mux_graph.branch_sizes(lvl).back();
    }
    break;
  }
  case CONFIG_MEM_SCAN_CHAIN:
  case CONFIG_MEM_STANDALONE:
    num_shared_config_bits = size_t(-1);
    break;
  default:
    VTR_LOG_ERROR("Invalid type of SRAM organization!\n"); 
    exit(1);
  }
  if (true == circuit_lib.mux_use_local_encoder(mux_model)) {
    return 0;
  }
  return num_shared_config_bits;
}
static size_t find_rram_mux_num_shared_config_bits ( const CircuitLibrary & circuit_lib , const CircuitModelId & mux_model , const MuxGraph & mux_graph , const e_config_protocol_type & sram_orgz_type ) { size_t num_shared_config_bits = 0 ; switch ( sram_orgz_type ) { case CONFIG_MEM_MEMORY_BANK : { for ( auto lvl : mux_graph . node_levels ( ) ) { num_shared_config_bits += mux_graph . branch_sizes ( lvl ) . back ( ) ; } break ; } case CONFIG_MEM_SCAN_CHAIN : case CONFIG_MEM_STANDALONE : num_shared_config_bits = size_t ( -1 ) ; break ; default : VTR_LOG_ERROR ( " \n " ) ; exit ( 1 ) ; } if ( true == circuit_lib . mux_use_local_encoder ( mux_model ) ) { return 0 ; } return num_shared_config_bits ; }
Find the number of shared configuration bits for a ReRAM multiplexer
Find the number of shared configuration bits for a ReRAM multiplexer
/* In memory bank, the number of shared configuration bits is
     * the sum of largest branch size at each level 
     */ /* Find the maximum branch size: 
       * Note that branch_sizes() returns a sorted vector
       * The last one is the maximum
       */ /* Currently we DO NOT SUPPORT THESE, given an invalid number */ /* TODO: this is a to-do work for ReRAM-based multiplexers and FPGAs 
     * The number of states of a local decoder only depends on how many 
     * memory bits that the multiplexer will have
     * This may NOT be correct!!! 
     * If local encoders are introduced, zero shared configuration bits are required
     */