mirror of https://github.com/YosysHQ/yosys.git
Fixed a bug in AST frontend for cases with non-blocking assigned variables as case values
This commit is contained in:
parent
c6198ea5a8
commit
e0c408cb4a
|
@ -337,9 +337,9 @@ struct AST_INTERNAL::ProcessGenerator
|
||||||
reg.sort_and_unify();
|
reg.sort_and_unify();
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove all assignments to the given signal pattern in a case and all its children
|
// remove all assignments to the given signal pattern in a case and all its children.
|
||||||
// when the last statement in the code "a = 23; if (b) a = 42; a = 0;" is processed this
|
// e.g. when the last statement in the code "a = 23; if (b) a = 42; a = 0;" is processed this
|
||||||
// function is acalled to clean up the first two assignments as they are overwritten by
|
// function is called to clean up the first two assignments as they are overwritten by
|
||||||
// the third assignment.
|
// the third assignment.
|
||||||
void removeSignalFromCaseTree(RTLIL::SigSpec pattern, RTLIL::CaseRule *cs)
|
void removeSignalFromCaseTree(RTLIL::SigSpec pattern, RTLIL::CaseRule *cs)
|
||||||
{
|
{
|
||||||
|
@ -461,7 +461,7 @@ struct AST_INTERNAL::ProcessGenerator
|
||||||
} else if (node->type == AST_BLOCK) {
|
} else if (node->type == AST_BLOCK) {
|
||||||
processAst(node);
|
processAst(node);
|
||||||
} else if (!generated_default_case)
|
} else if (!generated_default_case)
|
||||||
current_case->compare.push_back(node->genWidthRTLIL(sw->signal.width));
|
current_case->compare.push_back(node->genWidthRTLIL(sw->signal.width, &subst_rvalue_from, &subst_rvalue_to));
|
||||||
}
|
}
|
||||||
sw->cases.push_back(current_case);
|
sw->cases.push_back(current_case);
|
||||||
current_case = backup_case;
|
current_case = backup_case;
|
||||||
|
|
|
@ -1,4 +1,23 @@
|
||||||
|
|
||||||
|
module blocking_cond (in, out);
|
||||||
|
|
||||||
|
input in;
|
||||||
|
output reg out;
|
||||||
|
reg tmp;
|
||||||
|
|
||||||
|
always @* begin
|
||||||
|
tmp = 1;
|
||||||
|
out = 1'b0;
|
||||||
|
case (1'b1)
|
||||||
|
tmp: out = in;
|
||||||
|
endcase
|
||||||
|
tmp = 0;
|
||||||
|
end
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
|
||||||
module uut(clk, arst, a, b, c, d, e, f, out1);
|
module uut(clk, arst, a, b, c, d, e, f, out1);
|
||||||
|
|
||||||
input clk, arst, a, b, c, d, e, f;
|
input clk, arst, a, b, c, d, e, f;
|
||||||
|
|
Loading…
Reference in New Issue