Altera_Forum
Honored Contributor
11 years agoprocess inside another process?
Can there be a process inside another process ?
I want to put a process inside a for loop. so since the for loop cannot be written outside a process, i weanted to put the for loop also in one process. What can be the alternative solution for this ? my code: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.numeric_std.all; entity ber is port ( clk : in std_logic ); end ber; architecture ar of ber is type data is array (0 to 11) of std_ulogic; signal d: data; -- give the input data bit by bit signal q:std_logic_vector(0 to 3):="0001"; --signal rxd_bit:std_logic_vector(0 to 3):="1010"; -- shd be received from the txr signal k:std_logic_vector(0 to 3):="0000"; signal j,t: std_ulogic:='0'; begin p1: process(j) variable count : integer := -1; begin for j in 0 to 3 loop p2: process(t) -----------> ERROR : Illegal sequential statements variable m: integer := 0; begin m:=m+1; exit when m=5; q<=(q(2)xor q(3)) &q(0)&q(1)&q(2); k<=q; for t in 0 to 3 loop if (k(t) /= d(t+(4*(j-1)))) then count := count+1; end if; end loop; end process p2; end loop ; end process p2; end ar;