Skip to content

Commit bb783c3

Browse files
committed
wip
1 parent aea4580 commit bb783c3

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

systemverilog-plugin/UhdmAst.cc

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,6 +2027,7 @@ void UhdmAst::process_design()
20272027
pair.second = nullptr;
20282028
}
20292029
}
2030+
//simplify_sv(current_node, nullptr);
20302031
}
20312032

20322033
void UhdmAst::simplify_parameter(AST::AstNode *parameter, AST::AstNode *module_node)
@@ -4301,16 +4302,23 @@ void UhdmAst::process_sys_func_call()
43014302
const uhdm_handle *const handle = (const uhdm_handle *)obj_h;
43024303
const auto *tfcall = (const UHDM::tf_call *)handle->object;
43034304

4304-
std::cout << "tfcall:\n";
4305+
std::cout << "\ntfcall:\n";
43054306
UHDM::visit_object(NewVpiHandle(tfcall), std::cout);
4306-
std::cout << "parent:\n";
4307-
UHDM::visit_object(NewVpiHandle(tfcall->VpiParent()), std::cout);
43084307

43094308
UHDM::expr * result = reduce_expression(tfcall, tfcall, tfcall->VpiParent());
4310-
std::cout << "after redeuce_expr:\n";
4311-
UHDM::visit_object(NewVpiHandle(result), std::cout);
4309+
std::cout << "\nafter reduce_expr:\n";
4310+
4311+
vpi_release_handle(obj_h);
4312+
obj_h = NewVpiHandle(result);
4313+
UHDM::visit_object(obj_h, std::cout);
4314+
4315+
if(result->VpiType() != vpiSysFuncCall) {
4316+
current_node = process_object(obj_h);
4317+
return;
4318+
}
43124319

43134320
current_node = make_ast_node(AST::AST_FCALL);
4321+
current_node->dumpAst(nullptr, "++++");
43144322

43154323
std::string task_calls[] = {"\\$display", "\\$monitor", "\\$write", "\\$time", "\\$readmemh", "\\$readmemb", "\\$finish", "\\$stop"};
43164324

@@ -5160,9 +5168,12 @@ AST::AstNode *UhdmAst::process_object(vpiHandle obj_handle)
51605168
case vpiLogicVar:
51615169
process_logic_var();
51625170
break;
5163-
case vpiSysFuncCall:
5171+
case vpiSysFuncCall: {
51645172
process_sys_func_call();
5173+
std::cout<< "func call processed:\n";
5174+
current_node->dumpAst(nullptr, " ");
51655175
break;
5176+
}
51665177
case vpiFuncCall:
51675178
process_tf_call(AST::AST_FCALL);
51685179
break;

0 commit comments

Comments
 (0)