openfpga/src/utils/mux_utils.cpp
/**************************************************
 * Find the number of configuration bits for a CMOS multiplexer
 * In general, the number of configuration bits is 
 * the number of memory bits for a mux_graph
 * However, when local decoders are used, 
 * the number of configuration bits are reduced to log2(X)
 *************************************************/
Find the number of configuration bits for a CMOS multiplexer
In general, the number of configuration bits is
the number of memory bits for a mux_graph
However, when local decoders are used,
the number of configuration bits are reduced to log2(X)
Find the number of configuration bits for a CMOS multiplexer In general the number of configuration bits is the number of memory bits for a mux_graph However when local decoders are used the number of configuration bits are reduced to log2 ( X )
static 
size_t find_cmos_mux_num_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_config_bits = 0; 
  switch (sram_orgz_type) {
  case CONFIG_MEM_MEMORY_BANK:
  case CONFIG_MEM_SCAN_CHAIN:
  case CONFIG_MEM_STANDALONE:
  case CONFIG_MEM_FRAME_BASED:
    num_config_bits = mux_graph.num_memory_bits();
    break;
  default:
    VTR_LOG_ERROR("Invalid type of SRAM organization!\n"); 
    exit(1);
  }
  if (false == circuit_lib.mux_use_local_encoder(mux_model)) {
    return num_config_bits;
  }
  num_config_bits = 0;
  for (const auto& lvl : mux_graph.levels()) {
    num_config_bits += find_mux_local_decoder_addr_size(mux_graph.num_memory_bits_at_level(lvl));
  } 
  return num_config_bits;
}
static size_t find_cmos_mux_num_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_config_bits = 0 ; switch ( sram_orgz_type ) { case CONFIG_MEM_MEMORY_BANK : case CONFIG_MEM_SCAN_CHAIN : case CONFIG_MEM_STANDALONE : case CONFIG_MEM_FRAME_BASED : num_config_bits = mux_graph . num_memory_bits ( ) ; break ; default : VTR_LOG_ERROR ( " \n " ) ; exit ( 1 ) ; } if ( false == circuit_lib . mux_use_local_encoder ( mux_model ) ) { return num_config_bits ; } num_config_bits = 0 ; for ( const auto & lvl : mux_graph . levels ( ) ) { num_config_bits += find_mux_local_decoder_addr_size ( mux_graph . num_memory_bits_at_level ( lvl ) ) ; } return num_config_bits ; }
Find the number of configuration bits for a CMOS multiplexer
 In general, the number of configuration bits is
 the number of memory bits for a mux_graph
 However, when local decoders are used,
 the number of configuration bits are reduced to log2(X)
Find the number of configuration bits for a CMOS multiplexer In general the number of configuration bits is the number of memory bits for a mux_graph However when local decoders are used the number of configuration bits are reduced to log2 ( X )
/* Multiplexer local encoders are applied to memory bits at each stage */