mirror of
https://github.com/verilator/verilator.git
synced 2026-09-03 16:28:53 +02:00
This patch implements #6480. All loop statements are represented using AstLoop and AstLoopTest. This necessitates rework of the loop unroller to handle loops of arbitrary form. To enable this, I have split the old unroller used for 'generate for' statements and moved it into V3Param, and subsequently rewrote V3Unroll to handle the new representation. V3Unroll can now unroll more complex loops, including with loop conditions containing multiple variable references or inlined functions. Handling the more generic code also requires some restrictions. If a loop contains any of the following, it cannot be unrolled: - A timing control that might suspend the loop - A non-inlined call to a non-pure function These constructs can change the values of variables in the loop, so are generally not safe to unroll if they are present. (We could still unroll if all the variables needed for unrolling are automatic, however we don't do that right now.) These restrictions seem ok in the benchmark suite, where the new unroller can generally unroll many more loops than before.
This commit is contained in:
+1
-2
@@ -338,8 +338,7 @@ protected:
|
||||
void visit(AstAlways* nodep) override = 0;
|
||||
void visit(AstNodeIf* nodep) override = 0;
|
||||
|
||||
// We don't do AstWhile loops, due to the standard question
|
||||
// of what is before vs. after
|
||||
// We don't do AstLoop, due to the standard question of what is before vs. after
|
||||
|
||||
void visit(AstAssignDly* nodep) override {
|
||||
VL_RESTORER(m_inDly);
|
||||
|
||||
Reference in New Issue
Block a user