3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-22 13:53:40 +00:00

Merge pull request #5158 from georgerennie/george/task_inout

read_verilog/astsimplify: copy inout ports in and out of functions/tasks
This commit is contained in:
George Rennie 2025-06-04 14:23:08 +01:00 committed by GitHub
commit 0fcf5c080d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 146 additions and 6 deletions

View file

@ -4100,16 +4100,24 @@ skip_dynamic_range_lvalue_expansion:;
delete arg;
continue;
}
AstNode *wire_id = new AstNode(AST_IDENTIFIER);
wire_id->str = wire->str;
AstNode *assign = child->is_input ?
new AstNode(AST_ASSIGN_EQ, wire_id, arg) :
new AstNode(AST_ASSIGN_EQ, arg, wire_id);
assign->children[0]->was_checked = true;
if (child->is_input)
if (child->is_input) {
AstNode *assign = new AstNode(AST_ASSIGN_EQ, wire_id->clone(), arg->clone());
assign->children[0]->was_checked = true;
new_stmts.push_back(assign);
else
}
if (child->is_output) {
AstNode *assign = new AstNode(AST_ASSIGN_EQ, arg->clone(), wire_id->clone());
assign->children[0]->was_checked = true;
output_assignments.push_back(assign);
}
delete arg;
delete wire_id;
}
}