openfpga/src/utils/mux_utils.cpp
/**************************************************
 * Find the number of levels for a tree-like multiplexer implementation
 *************************************************/
Find the number of levels for a tree-like multiplexer implementation
Find the number of levels for a tree - like multiplexer implementation
size_t find_treelike_mux_num_levels(const size_t& mux_size) {
  size_t level = (size_t)(log((double)mux_size)/log(2.));
  while (mux_size > pow(2.,(double)level)) {
    level++;
  }
  return level;
}
size_t find_treelike_mux_num_levels ( const size_t & mux_size ) { size_t level = ( size_t ) ( log ( ( double ) mux_size ) / log ( 2. ) ) ; while ( mux_size > pow ( 2. , ( double ) level ) ) { level ++ ; } return level ; }
Find the number of levels for a tree-like multiplexer implementation
Find the number of levels for a tree - like multiplexer implementation
/* Do log2(mux_size), have a basic number */ /* Fix the error, i.e. mux_size=5, level = 2, we have to complete */