Skip to content

Commit e00acb5

Browse files
committed
Fail when range is unsized
Signed-off-by: Kamil Rakoczy <[email protected]>
1 parent b79ad0d commit e00acb5

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

uhdm-plugin/UhdmAst.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,10 +2686,20 @@ void UhdmAst::process_case_item()
26862686
});
26872687
}
26882688

2689-
void UhdmAst::process_range()
2689+
void UhdmAst::process_range(const UHDM::BaseClass *object)
26902690
{
26912691
current_node = make_ast_node(AST::AST_RANGE);
26922692
visit_one_to_one({vpiLeftRange, vpiRightRange}, obj_h, [&](AST::AstNode *node) { current_node->children.push_back(node); });
2693+
if (current_node->children.size() > 0) {
2694+
if (current_node->children[0]->str == "unsized") {
2695+
log_error("%s:%d: Currently not supported object of type 'unsized range'\n", object->VpiFile().c_str(), object->VpiLineNo());
2696+
}
2697+
}
2698+
if (current_node->children.size() > 1) {
2699+
if (current_node->children[1]->str == "unsized") {
2700+
log_error("%s:%d: Currently not supported object of type 'unsized range'\n", object->VpiFile().c_str(), object->VpiLineNo());
2701+
}
2702+
}
26932703
}
26942704

26952705
void UhdmAst::process_return()
@@ -3554,7 +3564,7 @@ AST::AstNode *UhdmAst::process_object(vpiHandle obj_handle)
35543564
current_node = process_value(obj_h);
35553565
break;
35563566
case vpiRange:
3557-
process_range();
3567+
process_range(object);
35583568
break;
35593569
case vpiReturn:
35603570
process_return();

uhdm-plugin/UhdmAst.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class UhdmAst
114114
void process_gen_scope();
115115
void process_case();
116116
void process_case_item();
117-
void process_range();
117+
void process_range(const UHDM::BaseClass *object);
118118
void process_return();
119119
void process_function();
120120
void process_logic_var();

0 commit comments

Comments
 (0)