87 int state_num = cell->
parameters[
"\\STATE_NUM"].as_int();
88 int state_num_log2 = cell->
parameters[
"\\STATE_NUM_LOG2"].as_int();
89 int trans_num = cell->
parameters[
"\\TRANS_NUM"].as_int();
91 if (reset_state < 0 || reset_state >= state_num)
97 for (
int i = 0; i < state_num; i++) {
100 state_code.
bits.insert(state_code.
bits.begin(), state_table.
bits.begin()+off_begin, state_table.
bits.begin()+off_end);
101 this->state_table.push_back(state_code);
104 for (
int i = 0; i < trans_num; i++)
108 auto off_ctrl_in = off_state_out + state_num_log2;
110 auto off_end = off_state_in + state_num_log2;
113 ctrl_out.
bits.insert(state_in.
bits.begin(), off_ctrl_out, off_state_out);
114 state_out.
bits.insert(state_out.
bits.begin(), off_state_out, off_ctrl_in);
115 ctrl_in.
bits.insert(ctrl_in.
bits.begin(), off_ctrl_in, off_state_in);
116 state_in.
bits.insert(state_in.
bits.begin(), off_state_in, off_end);
119 tr.state_in = state_in.
as_int();
120 tr.state_out = state_out.
as_int();
121 tr.ctrl_in = ctrl_in;
122 tr.ctrl_out = ctrl_out;
124 if (tr.state_in < 0 || tr.state_in >= state_num)
126 if (tr.state_out < 0 || tr.state_out >= state_num)
std::vector< transition_t > transition_table
std::map< RTLIL::IdString, RTLIL::Const > parameters
int as_int(bool is_signed=false) const
std::vector< RTLIL::Const > state_table
std::vector< RTLIL::State > bits