blob: 66b2830621d9d86e570a9e79116fe57e2bcd6fdf [file] [log] [blame]
#ifndef PARAMETERS_H
#define PARAMETERS_H
#include "netlist_writer.h"
namespace fasm {
// Utility class emit parameters from eblif
class Parameters {
public:
// Adds a parameter mapping between an eblif parameter (e.g. .param <param> <value>)
// to FASM feature.
void AddParameter(const std::string &eblif_parameter, const std::string &fasm_feature);
// Return a FASM feature directive for the given parameter and value.
std::string EmitFasmFeature(const std::string &eblif_parameter, const std::string &value);
private:
struct FeatureParameter {
size_t width;
std::string feature;
};
std::unordered_multimap<std::string, FeatureParameter> features_;
size_t FeatureWidth(const std::string &feature) const;
};
} // namespace fasm
#endif // PARAMETERS_H