openfpga/src/utils/mux_utils.cpp
/**************************************************
 * Find the structure for a multiplexer implementation
 * 1. In most cases, the structure should follow the 
 * mux_structure defined by users in the CircuitLibrary
 * 2. However, a special case may apply when mux_size is 2 
 * In such case, we will force a TREE structure
 * regardless of users' specification as this is the 
 * most efficient structure  
 *************************************************/
Find the structure for a multiplexer implementation
1. In most cases, the structure should follow the
mux_structure defined by users in the CircuitLibrary
2. However, a special case may apply when mux_size is 2
In such case, we will force a TREE structure
regardless of users' specification as this is the
most efficient structure
Find the structure for a multiplexer implementation 1 . In most cases the structure should follow the mux_structure defined by users in the CircuitLibrary 2 . However a special case may apply when mux_size is 2 In such case we will force a TREE structure regardless of users ' specification as this is the most efficient structure
enum e_circuit_model_structure find_mux_implementation_structure(const CircuitLibrary& circuit_lib,
					                                           const CircuitModelId& circuit_model,
						                                       const size_t& mux_size) {
  VTR_ASSERT(valid_mux_implementation_num_inputs(mux_size));
  if (2 == mux_size) {
    if (CIRCUIT_MODEL_DESIGN_CMOS == circuit_lib.design_tech_type(circuit_model)) {
      return CIRCUIT_MODEL_STRUCTURE_TREE;
    }
    VTR_ASSERT_SAFE(CIRCUIT_MODEL_DESIGN_RRAM == circuit_lib.design_tech_type(circuit_model));
    return CIRCUIT_MODEL_STRUCTURE_ONELEVEL;
  }
  return circuit_lib.mux_structure(circuit_model);
}
enum e_circuit_model_structure find_mux_implementation_structure ( const CircuitLibrary & circuit_lib , const CircuitModelId & circuit_model , const size_t & mux_size ) { VTR_ASSERT ( valid_mux_implementation_num_inputs ( mux_size ) ) ; if ( 2 == mux_size ) { if ( CIRCUIT_MODEL_DESIGN_CMOS == circuit_lib . design_tech_type ( circuit_model ) ) { return CIRCUIT_MODEL_STRUCTURE_TREE ; } VTR_ASSERT_SAFE ( CIRCUIT_MODEL_DESIGN_RRAM == circuit_lib . design_tech_type ( circuit_model ) ) ; return CIRCUIT_MODEL_STRUCTURE_ONELEVEL ; } return circuit_lib . mux_structure ( circuit_model ) ; }
Find the structure for a multiplexer implementation
 1.
Find the structure for a multiplexer implementation 1 .
/* Ensure the mux size is valid ! */ /* Branch on the mux sizes */ /* Tree-like is the best structure of CMOS MUX2 */ /* One-level is the best structure of RRAM MUX2 */