Home > VHDL > Concurrent Statements > Block Statement

Block Statement :

Block statement contains concurrent statements. The main purpose of Block Statement is to improve readability and disable signals. Block statement is also preceded by header and declarative part. Block header has port and generic declarations. It also has port map whose purpose is to map signals declared outside. The declarative part declares subprograms, types, subtypes, constants, signals, shared variables, files, aliases, components, attributes, configurations, disconnections and use clauses. The syntax is:

 block [
(expression) ]
 begin
 {
concurrent_statements }
 end
block;

Example :

architecture block_arch of testing is
		type data_path is … ;
		signal internal_cont : data_path;
	begin
	block
		port (clk : in bit;
			bus_cont : out proc_cont;
			bus_ready : in bit;
			control : out data_path_cont);
		port map (clk => clock,
			bus_cont => control, bus_ready => ready;
			control => internal_cont);
			declarations for cont
	begin
			statements for cont
	end block;
          block
		port (address : out integer;
			data : inout word_32;
			cont : in data_path_cont)
		port map (address => address, data => data,
			control => internal_cont);
			declarations for data_path
	begin
			statements for data_path
	end block;
	end block_arch;