vhdlpp: Removed conversion of '*_edge(sig)' to 'always begin..end @(*edge sig)'.
This commit is contained in:
parent
7597270939
commit
df597e19cb
|
|
@ -195,50 +195,6 @@ int ProcessStatement::rewrite_as_always_edge_(Entity*, Architecture*)
|
|||
return -1;
|
||||
|
||||
const Expression*ce_raw = stmt->peek_condition();
|
||||
// Now we have matched this pattern:
|
||||
// process(<expr>) begin if <ce_raw>...
|
||||
// The <ce_raw> is the condition.
|
||||
|
||||
if (const ExpFunc*ce_func = dynamic_cast<const ExpFunc*>(ce_raw)) {
|
||||
if (ce_func->func_args() != 1)
|
||||
return -1;
|
||||
if (ce_func->func_name()!="rising_edge" && ce_func->func_name()!="falling_edge")
|
||||
return -1;
|
||||
|
||||
if (! se->symbolic_compare(ce_func->func_arg(0)))
|
||||
return -1;
|
||||
|
||||
// We've matched this pattern:
|
||||
// process(<se>) if (rising_edge(<se>)) then ...
|
||||
// and we can convert it to:
|
||||
// always @(posedge <se>) ...
|
||||
|
||||
ExpEdge::fun_t use_edge;
|
||||
if (ce_func->func_name()=="rising_edge")
|
||||
use_edge = ExpEdge::POSEDGE;
|
||||
else if (ce_func->func_name()=="falling_edge")
|
||||
use_edge = ExpEdge::NEGEDGE;
|
||||
else
|
||||
use_edge = ExpEdge::ANYEDGE;
|
||||
|
||||
// Replace the sensitivity expression with an edge
|
||||
// expression. The ExpEdge expression signals that this
|
||||
// is an always-@(edge) statement.
|
||||
ExpEdge*edge = new ExpEdge(use_edge, se);
|
||||
assert(sensitivity_list_.size() == 1);
|
||||
sensitivity_list_.pop_front();
|
||||
sensitivity_list_.push_front(edge);
|
||||
|
||||
// Replace the statement with the body of the always
|
||||
// statement, which is the true clause of the top "if"
|
||||
// statement. There should be no "else" clause.
|
||||
assert(statements_list_.size() == 1);
|
||||
statements_list_.pop_front();
|
||||
stmt->extract_true(statements_list_);
|
||||
|
||||
delete stmt;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Here we expect the condition to be
|
||||
// <name>'event AND <name>='1'.
|
||||
|
|
|
|||
Loading…
Reference in New Issue