Documentation for architecture MGTEVB/AdrRom/a0
VHDL Contents
1 architecture a0 of AdrRom is
24
25 signal EnAdr : std_logic;
26 signal MaxCount : std_logic;
27 signal Address : std_logic_vector(8 downto 0);
28 constant MaxAdr : std_logic_vector(8 downto 0) := std_logic_vector(to_unsigned(maxv,9));
30
31 begin
32
33 MaxCount <= '1' when (Address = MaxAdr) else '0';
34 Addr <= Address;
35
36 pr1:
41 process (Clk, Rst_n)
42 begin
43 if (Rst_n = '0') then
44 EnAdr <= '0';
45 elsif (rising_edge(Clk)) then
46 if (MaxCount = '1') then
47 EnAdr <= '0';
48 elsif (Start = '1') then
49 EnAdr <= '1';
50 end if;
51 end if;
52 end process;
53
54 pr2:
55 process (Clk, Rst_n)
56 variable count : unsigned(8 downto 0);
57 variable phase : std_logic_vector(2 downto 0);
58 begin
59 if (Rst_n = '0') then
60 count := (others => '1');
61 phase := "000";
62 EnReg <= '0';
63 LWDEN <= '0';
64 elsif (rising_edge(Clk)) then
66 if (EnAdr = '0') then
67 if (phase(2) = '1' or phase(1) = '1' or phase(0) = '1') then
68 if (FullD = '0' and Ena = '1') then
69 if (phase = "110") then
70 EnReg <= '1';
72 else
73 EnReg <= '0';
74 end if;
75 if (phase = "110" or phase = "100") then
76 LWDEN <= '1';
78 else
79 LWDEN <= '0';
80 end if;
81 phase := phase(1 downto 0) & '0';
82 end if;
84 else
85 count := (others => '1');
87 EnReg <= '0';
88 LWDEN <= '0';
89 end if;
90 else
92 if (MaxCount = '0' and FullD = '0' and Ena = '1') then
93 count := count + 1;
94 if (phase(1 downto 0) = "01") then
95 EnReg <= '1';
97 end if;
99 if (phase(1 downto 0) = "11") then
100 EnReg <= '1';
102 LWDEN <= '1';
103 end if;
104 phase := phase(1 downto 0) & EnAdr;
105 else
107 EnReg <= '0';
108 LWDEN <= '0';
109 end if;
111 end if;
112 end if;
113 Address <= std_logic_vector(count);
114 end process;
115
116 end architecture a0 ;