-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathN64_CIC.vhd
53 lines (45 loc) · 1.23 KB
/
N64_CIC.vhd
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
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity N64_CIC is
port (
CLK_I : in STD_LOGIC;
REGION_I : in STD_LOGIC;
N64_CIC_DCLK_I : in STD_LOGIC;
N64_CIC_D_IO : inout STD_LOGIC;
N64_CIC_RESET_I : in STD_LOGIC
);
end N64_CIC;
architecture Behavioral of N64_CIC is
component lm8_cic
port (
clk_i : in std_logic
; reset_n : in std_logic
; ioPIO_BOTH_IN : in std_logic_vector(2 downto 0)
; ioPIO_BOTH_OUT : out std_logic_vector(0 downto 0)
);
end component;
signal cic_in : std_logic_vector(2 downto 0);
signal cic_out : std_logic_vector(0 downto 0);
begin
lm8_inst : lm8_cic
port map (
clk_i => CLK_I
,reset_n => N64_CIC_RESET_I
,ioPIO_BOTH_IN => cic_in
,ioPIO_BOTH_OUT => cic_out
);
cic_in <= REGION_I & N64_CIC_DCLK_I & N64_CIC_D_IO;
process (cic_out, N64_CIC_RESET_I)
begin
if N64_CIC_RESET_I = '0' then
N64_CIC_D_IO <= 'Z';
else
if cic_out(0) = '1' then
N64_CIC_D_IO <= '0';
else
N64_CIC_D_IO <= 'Z';
end if;
end if;
end process;
end Behavioral;