Hi tahder
Not sure - but I guess the generate statement not allowed inside a process.
try this instead
Not sure - but I guess the generate statement not allowed inside a process.
try this instead
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity mskgen is
generic( n: natural := 10;
r: natural := 10);
port( clk,maskEn: std_logic);
end mskgen;
architecture bhv of mskGen is
subtype patternArray is std_logic_vector (n-1 downto 0);
type referenceArray is array (r-1 downto 0) of patternArray;
signal memory,maskIn_P,maskIn_R : referenceArray;
begin
process (clk, maskEn)
begin
if clk = '1' and clk'event then
if maskEn = '1' then
for j in 0 to r-1 loop
for i in 0 to n-1 loop
if maskIn_P(i)=maskIn_R(j) then
memory(i)(j) <= '1';
else
memory(i)(j) <= '0;
end if;
end loop;
end loop;
end if;
end if;
end process;
end bhv;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity mskgen is
generic( n: natural := 10;
r: natural := 10);
port( clk,maskEn: std_logic);
end mskgen;
architecture bhv of mskGen is
subtype patternArray is std_logic_vector (n-1 downto 0);
type referenceArray is array (r-1 downto 0) of patternArray;
signal memory,maskIn_P,maskIn_R : referenceArray;
begin
process (clk, maskEn)
begin
if clk = '1' and clk'event then
if maskEn = '1' then
for j in 0 to r-1 loop
for i in 0 to n-1 loop
if maskIn_P(i)=maskIn_R(j) then
memory(i)(j) <= '1';
else
memory(i)(j) <= '0;
end if;
end loop;
end loop;
end if;
end if;
end process;
end bhv;
Regards
Jeppe
Jeppe
No comments:
Post a Comment