Mobile
VHDL Online Help Prev Page Prev Page
Table of Contents
Access Type
Aggregate
Alias
Allocator
Architecture
Array
Assertion Statement
Attributes (predefined)
Attributes (user-defined)
Bit
Bit_Vector
Block Statement
Boolean
Case Statement
Character Type
Component Declaration
Component Instantiation
Composite Type
Concatenation
Configuration Declaration
Configuration Specification
Constant
Delay
Driver
Entity
Enumeration Type
Event
Exit Statement
Expression
File Declaration
File Type
Floating Point Type
Function
Generate Statement
Generic
Group
Guard
Identifier
If Statement
Integer Type
Library Clause
Literal
Loop Statement
Name
Next Statement
Null Statement
Operator Overloading
Operators
Package
Package Body
Physical Type
Port
Procedure
Process Statement
Range
Record Type
Report Statement
Reserved Word
Resolution Function
Resume
Return Statement
Scalar Type
Sensitivity List
Signal Assignment
Signal Declaration
Slice
Standard Package
Std_Logic
Std_Logic_1164 Package
Std_Logic_Vector
String
Subtype
Suspend
Testbench
Type
Type Conversion
Use Clause
Variable Assignment
Variable Declaration
Vector
VITAL
Wait Statement
Waveform

Next Statement

Formal Definition

The next statement is used to complete execution of one of the iterations of an enclosing loop statement. The completion is conditional if the statement includes a condition.

Simplified Syntax

next;

next loop_label;

next loop_label when condition;

Description

The next statement allows to skip a part of an iteration loop. If the condition specified after the when reserved word is TRUE, or if there is no condition at all, then the statement is executed. This results in skipping all statements below it until the end of the loop and passing the control to the first statement in the next iteration (example 1).

A next statement may specify the name of the loop it is expected to influence. If no label is supported then the statement applies to the innermost enclosing loop (example 2)

Examples

Example 1

Loop_Z:  for count_value in 1 to 8 loop
Assign_1:  A(count_value) := '0';
           next when condition_1;
Assign_2:  A(count_value + 8) := '0';
         end loop Loop_Z;

 
If the condition_1 in the iteration count_value is TRUE, then the next statement will be executed. The next statement to be executed will be Assign_1 in the iteration count_value+1. Otherwise, the sequence of operations is as specified, i.e. Assign_2 is executed.

Example 2

Loop_X: for count_value in 1 to 8 loop
           Assign_1: A(count_value) := '0';
           k := 0;
Loop_Y:    loop
              Assign_2: B(k) := '0';
              next Loop_X when condition_1;
              Assign_3: B(k + 8) := '0';
              k := k + 1;
           end loop Loop_Y;
        end loop Loop_X;

 
If condition_1 is TRUE, then the next statement is executed and the control goes to the assignment statement labeled Assign_1 in the next iteration of Loop_X. If not, then the iteration is continued with Assign_3, causing incrementing k.

Important Notes

  • The next statement is often confused with the exit statement. The difference between the two is that the exit statement "exits" the loop entirely, while the next statement skips to the "next" loop iteration (in other words, it "exits" the current iteration of the loop).

 

Powered by IXwebhosting