rashmi.imhsar
Junior Member level 2
- Joined
- Mar 13, 2014
- Messages
- 20
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1
- Activity points
- 270
error while using "for generate"
I want to run the two components one after the other , for 15 times. the for generate is showing the following errors:
** Error: Nonresolved signal 'led' has multiple sources.
** Error: Nonresolved signal 'q_main' has multiple sources.
** Error: VHDL Compiler exiting
Here is my code:
--
-- A 4-bit Linear feedback shift-register (LFSR)-PRBS & BERT.
--
-- ----------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
-- ----------------------------------------------------------------
entity lfsr4_txrrxr is
port
(
rstN_main : in std_logic;
clk_main : in std_logic;
-- Load the LFSR register
load_main : in std_logic;
-- transmitter LFSR seed value (eg, 0001)
--seed1 : in bit_vector(3 downto 0);
-- Enable the LFSR register
enable_main : in std_logic;
-- LFSR register (1-bit of this is the PRBS signal)
led : out bit_vector(3 downto 0)
);
end entity;
-- ----------------------------------------------------------------
architecture basic of lfsr4_txrrxr is
-- Internal LFSR register
signal data, data02 : bit_vector(3 downto 0);
signal seed : bit_vector(3 downto 0):="0001";
signal n : integer:=0;
signal q_main : bit_vector(3 downto 0);
component lfsr4 is
port (
rstN : in std_logic;
clk : in std_logic;
-- Load the LFSR register
load : in std_logic;
-- transmitter LFSR seed value (eg, 0001)
seed1 : in bit_vector(3 downto 0);
-- Enable the LFSR register
enable : in std_logic;
-- LFSR register (1-bit of this is the PRBS signal)
--data : inout bit_vector(3 downto 0);
q : inout bit_vector(3 downto 0)
);
end component;
component rxr4 is
port (
rstN : in std_logic;
clk : in std_logic;
-- Load the LFSR register
q : in bit_vector(3 downto 0);
-- LFSR register (1-bit of this is the PRBS signal)
led : out bit_vector(3 downto 0)
);
end component;
begin
l1: for i in 1 to 15 generate
p1: lfsr4 port map
(
rstN => rstN_main,
clk => clk_main,
load => load_main,
seed1 => seed,
enable => enable_main,
q => q_main
);
p2: rxr4 port map
(
rstN => rstN_main,
clk => clk_main,
q => q_main,
led => led
);
end generate l1;
end architecture;
I want to run the two components one after the other , for 15 times. the for generate is showing the following errors:
** Error: Nonresolved signal 'led' has multiple sources.
** Error: Nonresolved signal 'q_main' has multiple sources.
** Error: VHDL Compiler exiting
Here is my code:
--
-- A 4-bit Linear feedback shift-register (LFSR)-PRBS & BERT.
--
-- ----------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
-- ----------------------------------------------------------------
entity lfsr4_txrrxr is
port
(
rstN_main : in std_logic;
clk_main : in std_logic;
-- Load the LFSR register
load_main : in std_logic;
-- transmitter LFSR seed value (eg, 0001)
--seed1 : in bit_vector(3 downto 0);
-- Enable the LFSR register
enable_main : in std_logic;
-- LFSR register (1-bit of this is the PRBS signal)
led : out bit_vector(3 downto 0)
);
end entity;
-- ----------------------------------------------------------------
architecture basic of lfsr4_txrrxr is
-- Internal LFSR register
signal data, data02 : bit_vector(3 downto 0);
signal seed : bit_vector(3 downto 0):="0001";
signal n : integer:=0;
signal q_main : bit_vector(3 downto 0);
component lfsr4 is
port (
rstN : in std_logic;
clk : in std_logic;
-- Load the LFSR register
load : in std_logic;
-- transmitter LFSR seed value (eg, 0001)
seed1 : in bit_vector(3 downto 0);
-- Enable the LFSR register
enable : in std_logic;
-- LFSR register (1-bit of this is the PRBS signal)
--data : inout bit_vector(3 downto 0);
q : inout bit_vector(3 downto 0)
);
end component;
component rxr4 is
port (
rstN : in std_logic;
clk : in std_logic;
-- Load the LFSR register
q : in bit_vector(3 downto 0);
-- LFSR register (1-bit of this is the PRBS signal)
led : out bit_vector(3 downto 0)
);
end component;
begin
l1: for i in 1 to 15 generate
p1: lfsr4 port map
(
rstN => rstN_main,
clk => clk_main,
load => load_main,
seed1 => seed,
enable => enable_main,
q => q_main
);
p2: rxr4 port map
(
rstN => rstN_main,
clk => clk_main,
q => q_main,
led => led
);
end generate l1;
end architecture;
Last edited: