Skip to content

Commit bbca3dd

Browse files
authored
Merge pull request chipsalliance#510 from antmicro/wsip/value_size
do not get value size of a constant from its typespec
2 parents a08c529 + b4b3bd8 commit bbca3dd

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

systemverilog-plugin/UhdmAst.cc

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,19 +1470,7 @@ AST::AstNode *UhdmAst::process_value(vpiHandle obj_h)
14701470
break;
14711471
}
14721472

1473-
int size = -1;
1474-
// Surelog sometimes report size as part of vpiTypespec (e.g. int_typespec)
1475-
// if it is the case, we need to set size to the left_range of first packed range
1476-
visit_one_to_one({vpiTypespec}, obj_h, [&](AST::AstNode *node) {
1477-
if (node && node->attributes.count(UhdmAst::packed_ranges()) && node->attributes[UhdmAst::packed_ranges()]->children.size() &&
1478-
node->attributes[UhdmAst::packed_ranges()]->children[0]->children.size()) {
1479-
size = node->attributes[UhdmAst::packed_ranges()]->children[0]->children[0]->integer + 1;
1480-
}
1481-
delete node;
1482-
});
1483-
if (size == -1) {
1484-
size = vpi_get(vpiSize, obj_h);
1485-
}
1473+
auto size = vpi_get(vpiSize, obj_h);
14861474
// Surelog by default returns 64 bit numbers and stardard says that they shall be at least 32bits
14871475
// yosys is assuming that int/uint is 32 bit, so we are setting here correct size
14881476
// NOTE: it *shouldn't* break on explicite 64 bit const values, as they *should* be handled

0 commit comments

Comments
 (0)