openfpga/src/utils/mux_utils.cpp
/**************************************************
 * Find the number of configuration bits for a RRAM multiplexer
 * In general, the number of configuration bits is 
 * the number of levels for a mux_graph
 * This is due to only the last BL/WL of the multiplexer is
 * independent from each other
 * However, when local decoders are used, 
 * the number of configuration bits should be consider all the
 * shared(reserved) configuration bits and independent bits 
 *************************************************/
Find the number of configuration bits for a RRAM multiplexer
In general, the number of configuration bits is
the number of levels for a mux_graph
This is due to only the last BL/WL of the multiplexer is
independent from each other
However, when local decoders are used,
the number of configuration bits should be consider all the
shared(reserved) configuration bits and independent bits
Find the number of configuration bits for a RRAM multiplexer In general the number of configuration bits is the number of levels for a mux_graph This is due to only the last BL / WL of the multiplexer is independent from each other However when local decoders are used the number of configuration bits should be consider all the shared ( reserved ) configuration bits and independent bits
static 
size_t find_rram_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:
    num_config_bits = mux_graph.num_levels();
    break;
  case CONFIG_MEM_SCAN_CHAIN:
  case CONFIG_MEM_STANDALONE:
    num_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 find_mux_local_decoder_addr_size(mux_graph.num_memory_bits());
  }
  return num_config_bits;
}
static size_t find_rram_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 : num_config_bits = mux_graph . num_levels ( ) ; break ; case CONFIG_MEM_SCAN_CHAIN : case CONFIG_MEM_STANDALONE : num_config_bits = size_t ( -1 ) ; break ; default : VTR_LOG_ERROR ( " \n " ) ; exit ( 1 ) ; } if ( true == circuit_lib . mux_use_local_encoder ( mux_model ) ) { return find_mux_local_decoder_addr_size ( mux_graph . num_memory_bits ( ) ) ; } return num_config_bits ; }
Find the number of configuration bits for a RRAM multiplexer
 In general, the number of configuration bits is
 the number of levels for a mux_graph
 This is due to only the last BL/WL of the multiplexer is
 independent from each other
 However, when local decoders are used,
 the number of configuration bits should be consider all the
 shared(reserved) configuration bits and independent bits
Find the number of configuration bits for a RRAM multiplexer In general the number of configuration bits is the number of levels for a mux_graph This is due to only the last BL / WL of the multiplexer is independent from each other However when local decoders are used the number of configuration bits should be consider all the shared ( reserved ) configuration bits and independent bits
/* In memory bank, by intensively share the Bit/Word Lines,
     * we only need 1 additional BL and WL for each MUX level.
     */ /* 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!!! 
     */