Skip to content

Commit

Permalink
Merge pull request #308 from antmicro/unknown_operators
Browse files Browse the repository at this point in the history
systemverilog: add dedicated wildcard operator errors
  • Loading branch information
tgorochowik authored Apr 25, 2022
2 parents 55c26d7 + e79caaa commit 0434b84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions systemverilog-plugin/UhdmAst.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2417,7 +2417,7 @@ void UhdmAst::process_begin(bool is_named)
});
}

void UhdmAst::process_operation()
void UhdmAst::process_operation(const UHDM::BaseClass *object)
{
auto operation = vpi_get(vpiOpType, obj_h);
switch (operation) {
Expand All @@ -2437,6 +2437,11 @@ void UhdmAst::process_operation()
case vpiAssignmentPatternOp:
process_assignment_pattern_op();
break;
case vpiWildEqOp:
case vpiWildNeqOp: {
report_error("%s:%d: Wildcard operators are not supported yet\n", object->VpiFile().c_str(), object->VpiLineNo());
break;
}
default: {
current_node = make_ast_node(AST::AST_NONE);
visit_one_to_many({vpiOperand}, obj_h, [&](AST::AstNode *node) {
Expand Down Expand Up @@ -2628,8 +2633,6 @@ void UhdmAst::process_operation()
default: {
delete current_node;
current_node = nullptr;
const uhdm_handle *const handle = (const uhdm_handle *)obj_h;
const UHDM::BaseClass *const object = (const UHDM::BaseClass *)handle->object;
report_error("%s:%d: Encountered unhandled operation type %d\n", object->VpiFile().c_str(), object->VpiLineNo(), operation);
}
}
Expand Down Expand Up @@ -3895,7 +3898,7 @@ AST::AstNode *UhdmAst::process_object(vpiHandle obj_handle)
break;
case vpiCondition:
case vpiOperation:
process_operation();
process_operation(object);
break;
case vpiTaggedPattern:
process_tagged_pattern();
Expand Down
2 changes: 1 addition & 1 deletion systemverilog-plugin/UhdmAst.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class UhdmAst
void process_event_control(const UHDM::BaseClass *object);
void process_initial();
void process_begin(bool is_named);
void process_operation();
void process_operation(const UHDM::BaseClass *object);
void process_stream_op();
void process_list_op();
void process_cast_op();
Expand Down

0 comments on commit 0434b84

Please sign in to comment.