29 FsmPass() :
Pass(
"fsm",
"extract and optimize finite state machines") { }
34 log(
" fsm [options] [selection]\n");
36 log(
"This pass calls all the other fsm_* passes in a useful order. This performs\n");
37 log(
"FSM extraction and optimiziation. It also calls opt_clean as needed:\n");
39 log(
" fsm_detect unless got option -nodetect\n");
40 log(
" fsm_extract\n");
46 log(
" fsm_expand if got option -expand\n");
47 log(
" opt_clean if got option -expand\n");
48 log(
" fsm_opt if got option -expand\n");
50 log(
" fsm_recode unless got option -norecode\n");
54 log(
" fsm_export if got option -export\n");
55 log(
" fsm_map unless got option -nomap\n");
59 log(
" -expand, -norecode, -export, -nomap\n");
60 log(
" enable or disable passes as indicated above\n");
62 log(
" -encoding tye\n");
63 log(
" -fm_set_fsm_file file\n");
64 log(
" passed through to fsm_recode pass\n");
69 bool flag_nomap =
false;
70 bool flag_norecode =
false;
71 bool flag_nodetect =
false;
72 bool flag_expand =
false;
73 bool flag_export =
false;
74 std::string fm_set_fsm_file_opt;
75 std::string encoding_opt;
77 log_header(
"Executing FSM pass (extract and optimize FSM).\n");
81 for (argidx = 1; argidx < args.size(); argidx++) {
82 std::string arg = args[argidx];
83 if (arg ==
"-fm_set_fsm_file" && argidx+1 < args.size() && fm_set_fsm_file_opt.empty()) {
84 fm_set_fsm_file_opt =
" -fm_set_fsm_file " + args[++argidx];
87 if (arg ==
"-encoding" && argidx+1 < args.size() && fm_set_fsm_file_opt.empty()) {
88 encoding_opt =
" -encoding " + args[++argidx];
91 if (arg ==
"-nodetect") {
95 if (arg ==
"-norecode") {
99 if (arg ==
"-nomap") {
103 if (arg ==
"-expand") {
107 if (arg ==
"-export") {
130 Pass::call(design,
"fsm_recode" + fm_set_fsm_file_opt + encoding_opt);
void log_header(const char *format,...)
virtual void execute(std::vector< std::string > args, RTLIL::Design *design)
#define PRIVATE_NAMESPACE_BEGIN
#define PRIVATE_NAMESPACE_END
#define USING_YOSYS_NAMESPACE
void log(const char *format,...)
void extra_args(std::vector< std::string > args, size_t argidx, RTLIL::Design *design, bool select=true)
static void call(RTLIL::Design *design, std::string command)