diff options
-rw-r--r-- | frontend/json/jsonparse.cc | 2 | ||||
-rw-r--r-- | python/dump_design.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/frontend/json/jsonparse.cc b/frontend/json/jsonparse.cc index d3696909..fe6a17cb 100644 --- a/frontend/json/jsonparse.cc +++ b/frontend/json/jsonparse.cc @@ -348,7 +348,7 @@ void json_import_cell_attributes(Design *design, string &modname, pId = param_node->data_dict_keys[param_id]; if (param->type == 'N') { - cell->params[pId] = std::to_string(param_node->data_number);; + cell->params[pId] = std::to_string(param->data_number);; } else if (param->type == 'S') cell->params[pId] = param->data_string; else diff --git a/python/dump_design.py b/python/dump_design.py index 5bac140d..1850d509 100644 --- a/python/dump_design.py +++ b/python/dump_design.py @@ -15,7 +15,11 @@ for cell in sorted(design.cells, key=lambda x: x.first): if len(cell.second.params) > 0: print("\tParams:") for param in cell.second.params: - print("\t\t{}: {}".format(param.first, param.second)) + val = param.second + if val.isdigit(): + val = bin(int(val))[2:] + val = "{}'b{}".format(len(val), val) + print("\t\t{}: {}".format(param.first, val)) if not cell.second.bel.nil(): print("\tBel: {}".format(chip.getBelName(cell.second.bel))) |