From df597e19cb02797912ac8a6e935b7c09356ade1e Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 24 Jun 2015 23:35:03 +0200 Subject: [PATCH] vhdlpp: Removed conversion of '*_edge(sig)' to 'always begin..end @(*edge sig)'. --- vhdlpp/architec_elaborate.cc | 44 ------------------------------------ 1 file changed, 44 deletions(-) diff --git a/vhdlpp/architec_elaborate.cc b/vhdlpp/architec_elaborate.cc index 327457ef1..e734ce1fc 100644 --- a/vhdlpp/architec_elaborate.cc +++ b/vhdlpp/architec_elaborate.cc @@ -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() begin if ... - // The is the condition. - - if (const ExpFunc*ce_func = dynamic_cast(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() if (rising_edge()) then ... - // and we can convert it to: - // always @(posedge ) ... - - 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 // 'event AND ='1'.