Skip to content

Commit f28596f

Browse files
committed
wip
1 parent 9255bac commit f28596f

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
@@ -2024,6 +2024,7 @@ void UhdmAst::process_design()
20242024
pair.second = nullptr;
20252025
}
20262026
}
2027+
//simplify_sv(current_node, nullptr);
20272028
}
20282029

20292030
void UhdmAst::simplify_parameter(AST::AstNode *parameter, AST::AstNode *module_node)
@@ -4298,16 +4299,23 @@ void UhdmAst::process_sys_func_call()
42984299
const uhdm_handle *const handle = (const uhdm_handle *)obj_h;
42994300
const auto *tfcall = (const UHDM::tf_call *)handle->object;
43004301

4301-
std::cout << "tfcall:\n";
4302+
std::cout << "\ntfcall:\n";
43024303
UHDM::visit_object(NewVpiHandle(tfcall), std::cout);
4303-
std::cout << "parent:\n";
4304-
UHDM::visit_object(NewVpiHandle(tfcall->VpiParent()), std::cout);
43054304

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

43104317
current_node = make_ast_node(AST::AST_FCALL);
4318+
current_node->dumpAst(nullptr, "++++");
43114319

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

@@ -5157,9 +5165,12 @@ AST::AstNode *UhdmAst::process_object(vpiHandle obj_handle)
51575165
case vpiLogicVar:
51585166
process_logic_var();
51595167
break;
5160-
case vpiSysFuncCall:
5168+
case vpiSysFuncCall: {
51615169
process_sys_func_call();
5170+
std::cout<< "func call processed:\n";
5171+
current_node->dumpAst(nullptr, " ");
51625172
break;
5173+
}
51635174
case vpiFuncCall:
51645175
process_tf_call(AST::AST_FCALL);
51655176
break;

0 commit comments

Comments
 (0)