Monday, March 3, 2014

Process: Basic Functional Unit in VHDL

basic-functional-unit-VHDL
The process in VHDL is the mechanism by which sequential statements can be executed in the correct sequence, and with more than one process, concurrently. Each process consists of a sensitivity list, declarations and statements. The basic process syntax is given below:

     process sensitivity_list is
          ... declaration part
        
     begin
          ... statement part
         
     end process;


The sensitivity list allows a process to be activated when a specific signal changes value, for example a typical usage would be to have a global clock (clk) and reset (rst) signal to control the activity of the process, for example:

     process (clk, rst) is
        
     begin
          ...process statements
         
     end process;


In this example, the process would only be activated when either clk or rst changed value. Another way of encapsulating the same behavior is to use a wait statement in the process so that the process is automatically activated once, and then waits for activity on either signal before running the process again. The same process could then be written as follows:


     process 
     begin
          ...process statements
          wait on clk, rst;
         
     end process;


In fact, the location of the wait statement is not important, as the VHDL simulation cycle executes each process once during initialization, and so the wait statement could be at the start or the end of the process and the behavior would be the same in both cases.

In the declaration section of the process, signals and variables can be defined locally as described previously; for example, a typical process may look like the following:

     process (a) is
          signal na : bit;
        
     begin
          na <= not a;
         
     end process;


With the local signal na and the process activated by changes on the signal a that is externally declared (with respect to the process).




References:

  • FPGAs World Class Designs, Clive "Max" Maxfield, Elsevier, 2009  
  • http://www.xputers.informatik.uni-kl.de (source of image)

No comments:

Post a Comment