2020-02-16 13:21:59 -06:00
|
|
|
#ifndef OPENFPGA_DECODE_H
|
|
|
|
#define OPENFPGA_DECODE_H
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* Include header files that are required by function declaration
|
|
|
|
*******************************************************************/
|
2020-09-14 19:55:21 -05:00
|
|
|
#include <stddef.h>
|
2020-02-16 13:21:59 -06:00
|
|
|
#include <vector>
|
2020-10-30 22:19:20 -05:00
|
|
|
#include <string>
|
2020-02-16 13:21:59 -06:00
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
* Function declaration
|
|
|
|
*******************************************************************/
|
|
|
|
/* namespace openfpga begins */
|
|
|
|
namespace openfpga {
|
|
|
|
|
2020-10-30 22:19:20 -05:00
|
|
|
/****************************************
|
|
|
|
* Constants
|
|
|
|
*/
|
|
|
|
constexpr char DONT_CARE_CHAR = 'x';
|
|
|
|
|
2020-02-16 13:21:59 -06:00
|
|
|
std::vector<size_t> ito1hot_vec(const size_t& in_int,
|
|
|
|
const size_t& bin_len);
|
|
|
|
|
|
|
|
std::vector<size_t> itobin_vec(const size_t& in_int,
|
|
|
|
const size_t& bin_len);
|
|
|
|
|
2020-07-02 16:56:50 -05:00
|
|
|
std::vector<char> itobin_charvec(const size_t& in_int,
|
|
|
|
const size_t& bin_len);
|
|
|
|
|
2020-07-03 16:12:29 -05:00
|
|
|
size_t bintoi_charvec(const std::vector<char>& bin);
|
|
|
|
|
2020-10-30 22:19:20 -05:00
|
|
|
std::vector<std::string> expand_dont_care_bin_str(const std::string& input_str);
|
|
|
|
|
2020-02-16 13:21:59 -06:00
|
|
|
} /* namespace openfpga ends */
|
|
|
|
|
|
|
|
#endif
|