Fix handling of parameters in JSON
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
9b87f132c8
commit
41b949832c
@ -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
|
||||
|
@ -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)))
|
||||
|
Loading…
Reference in New Issue
Block a user