blob: 5292ada0cc28141a9b6485f3c59ed279e5ba67bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
library ieee;
use ieee.std_logic_1164.all;
entity SINGLE_SRL is
generic (SRL_WIDTH : integer := 24);
port (
clk : in std_logic;
inp : in std_logic;
outp : out std_logic);
end SINGLE_SRL;
architecture beh of SINGLE_SRL is
signal shift_reg : std_logic_vector (SRL_WIDTH-1 downto 0);
begin
assert SRL_WIDTH <= 17
report "The size of Shift Register exceeds the size of a single SRL"
severity FAILURE;
process (clk)
begin
if rising_edge(clk) then
shift_reg <= shift_reg (SRL_WIDTH-2 downto 0) & inp;
end if;
end process;
outp <= shift_reg(SRL_WIDTH-1);
end beh;
library ieee;
use ieee.std_logic_1164.all;
entity TOP is
port (
clk : in std_logic;
inp1, inp2 : in std_logic;
outp1, outp2 : out std_logic);
end TOP;
architecture beh of TOP is
component SINGLE_SRL is
generic (SRL_WIDTH : integer := 16);
port(
clk : in std_logic;
inp : in std_logic;
outp : out std_logic);
end component;
begin
inst1: SINGLE_SRL
generic map (SRL_WIDTH => 13)
port map(
clk => clk,
inp => inp1,
outp => outp1 );
inst2: SINGLE_SRL
generic map (SRL_WIDTH => 18)
port map(
clk => clk,
inp => inp2,
outp => outp2 );
end beh;
|