Procedures may be called concurrently within an architecture. When procedures are called concurrently, they must appear as independent statements within the concurrent area of the architecture.

 

You can think of procedures in the same way you think of processes within an architecture: as independent sequential programs that execute whenever there is a change (an event) on any of their inputs. The advantage of a procedure over a process is that the body of the procedure (its sequential statements) can be kept elsewhere (in a package, for example) and used repeatedly throughout the design.

 

In the following example, the procedure dff is called within the concurrent area of the architecture:

 

architecture shift2 of shift is

    signal D,Qreg: std_logic_vector(0 to 7);

begin

 

    D <= Data when (Load = ‘1’) else

                  Qreg(1 to 7) & Qreg(0);

 

    dff(Rst, Clk, D, Qreg);

 

    Q <= Qreg;

 

end shift2;