mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 00:55:32 +00:00
Added "int ceil_log2(int)" function
This commit is contained in:
parent
a75f94ec4a
commit
0d7fd2585e
5 changed files with 58 additions and 10 deletions
|
@ -85,7 +85,7 @@ static void fsm_recode(RTLIL::Cell *cell, RTLIL::Module *module, FILE *fm_set_fs
|
|||
fsm_data.state_bits = fsm_data.state_table.size();
|
||||
} else
|
||||
if (encoding == "binary") {
|
||||
int new_num_state_bits = ceil(log2(fsm_data.state_table.size()));
|
||||
int new_num_state_bits = ceil_log2(fsm_data.state_table.size());
|
||||
if (fsm_data.state_bits == new_num_state_bits) {
|
||||
log(" existing encoding is already a packed binary encoding.\n");
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue