Fix input/output attributes when resolving typedef of wire

Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
This commit is contained in:
Kamil Rakoczy 2020-06-09 09:53:00 +02:00
parent 09071afe15
commit 61501e3266
1 changed files with 3 additions and 0 deletions

View File

@ -1330,6 +1330,9 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
if (template_node->type == AST_STRUCT || template_node->type == AST_UNION) { if (template_node->type == AST_STRUCT || template_node->type == AST_UNION) {
// replace with wire representing the packed structure // replace with wire representing the packed structure
newNode = make_packed_struct(template_node, str); newNode = make_packed_struct(template_node, str);
// add original input/output attribute to resolved wire
newNode->is_input = this->is_input;
newNode->is_output = this->is_output;
current_scope[str] = this; current_scope[str] = this;
goto apply_newNode; goto apply_newNode;
} }