Skip to content

Commit 9255bac

Browse files
committed
wip
1 parent 7622417 commit 9255bac

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

systemverilog-plugin/UhdmAst.cc

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,10 @@ static void simplify_sv(AST::AstNode *current_node, AST::AstNode *parent_node)
12511251
current_node->children.push_back(result);
12521252
}
12531253
}
1254+
if (current_node->id2ast && current_node->id2ast->type == AST::AST_TYPEDEF) {
1255+
log_assert(current_node->id2ast->children.size());
1256+
current_node->id2ast = current_node->id2ast->children[0];
1257+
}
12541258
break;
12551259
case AST::AST_STRUCT:
12561260
case AST::AST_UNION:
@@ -1283,10 +1287,6 @@ static void simplify_sv(AST::AstNode *current_node, AST::AstNode *parent_node)
12831287
if (current_node->str == "$display" || current_node->str == "$write")
12841288
simplify_format_string(current_node);
12851289
break;
1286-
case AST::AST_FCALL:
1287-
while (simplify(current_node, true, false, false, 1, -1, false, false)) {
1288-
};
1289-
break;
12901290
case AST::AST_COND:
12911291
case AST::AST_CONDX:
12921292
case AST::AST_CONDZ:
@@ -1339,14 +1339,6 @@ static void clear_current_scope()
13391339
AST_INTERNAL::current_ast_mod = nullptr;
13401340
}
13411341

1342-
static void visit_uhdm_obj(const UHDM::any *object)
1343-
{
1344-
UHDM::VisitedContainer visited = UHDM::VisitedContainer();
1345-
vpiHandle handle = NewVpiHandle(object);
1346-
UHDM::visit_object(handle, 1, "", &visited, std::cout);
1347-
vpi_release_handle(handle);
1348-
}
1349-
13501342
void UhdmAst::visit_one_to_many(const std::vector<int> child_node_types, vpiHandle parent_handle, const std::function<void(AST::AstNode *)> &f)
13511343
{
13521344
for (auto child : child_node_types) {
@@ -4303,6 +4295,18 @@ void UhdmAst::process_logic_var()
43034295

43044296
void UhdmAst::process_sys_func_call()
43054297
{
4298+
const uhdm_handle *const handle = (const uhdm_handle *)obj_h;
4299+
const auto *tfcall = (const UHDM::tf_call *)handle->object;
4300+
4301+
std::cout << "tfcall:\n";
4302+
UHDM::visit_object(NewVpiHandle(tfcall), std::cout);
4303+
std::cout << "parent:\n";
4304+
UHDM::visit_object(NewVpiHandle(tfcall->VpiParent()), std::cout);
4305+
4306+
UHDM::expr * result = reduce_expression(tfcall, tfcall, tfcall->VpiParent());
4307+
std::cout << "after redeuce_expr:\n";
4308+
UHDM::visit_object(NewVpiHandle(result), std::cout);
4309+
43064310
current_node = make_ast_node(AST::AST_FCALL);
43074311

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

0 commit comments

Comments
 (0)