Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 4.32 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3. USE work.tse_ddio_out;
  4.  
  5. ENTITY top IS
  6.   PORT
  7.     (
  8.       clk   : IN std_logic;
  9.       res_n : IN std_logic;
  10.      
  11.       ...
  12.  
  13.       enet0_gtx_clk : OUT std_logic;
  14.       enet0_mdc     : OUT std_logic;
  15.       enet0_mdio    : INOUT  std_logic;
  16.       enet0_res_n   : OUT std_logic;
  17.       enet0_rx_clk  : IN std_logic;
  18.       enet0_rx_data : IN std_logic_vector(3 DOWNTO 0);
  19.       enet0_rx_dv   : IN std_logic;
  20.       enet0_tx_data : OUT std_logic_vector(3 DOWNTO 0);
  21.       enet0_tx_en   : OUT std_logic;
  22.  
  23.       ...
  24.     );
  25. end ENTITY;
  26.  
  27. architecture arch OF top IS
  28.  
  29.   COMPONENT camera IS
  30.     PORT (
  31.       ...
  32.      
  33.       clk_clk : IN std_logic := 'X'; -- clk
  34.       reset_reset_n : IN    std_logic := 'X'; -- reset_n
  35.      
  36.       tse_mac_mdio_connection_mdc         : OUT   std_logic;                                        -- mdc
  37.       tse_mac_mdio_connection_mdio_in     : IN    std_logic                     := 'X';             -- mdio_in
  38.       tse_mac_mdio_connection_mdio_out    : OUT   std_logic;                                        -- mdio_out
  39.       tse_mac_mdio_connection_mdio_oen    : OUT   std_logic;                                        -- mdio_oen
  40.       tse_mac_rgmii_connection_rgmii_in   : IN    std_logic_vector(3 DOWNTO 0)  := (OTHERS => 'X'); -- rgmii_in
  41.       tse_mac_rgmii_connection_rgmii_out  : OUT   std_logic_vector(3 DOWNTO 0);                     -- rgmii_out
  42.       tse_mac_rgmii_connection_rx_control : IN    std_logic                     := 'X';             -- rx_control
  43.       tse_mac_rgmii_connection_tx_control : OUT   std_logic;                                        -- tx_control
  44.       tse_mac_status_connection_set_10    : IN    std_logic                     := 'X';             -- set_10
  45.       tse_mac_status_connection_set_1000  : IN    std_logic                     := 'X';             -- set_1000
  46.       tse_mac_status_connection_eth_mode  : OUT   std_logic;                                        -- eth_mode
  47.       tse_mac_status_connection_ena_10    : OUT   std_logic;                                        -- ena_10
  48.       tse_pcs_mac_rx_clock_connection_clk : IN    std_logic                     := 'X';             -- clk
  49.       tse_pcs_mac_tx_clock_connection_clk : IN    std_logic                     := 'X';             -- clk
  50.      
  51.       ...
  52.      
  53.       tse_pll_125_clk               : OUT std_logic;        -- clk
  54.       tse_pll_25_clk                : OUT std_logic;        -- clk
  55.       tse_pll_2p5_clk               : OUT std_logic;        -- clk
  56.       tse_pll_areset_conduit_export : IN  std_logic := 'X'; -- export
  57.      
  58.       ...
  59.     );
  60.   end COMPONENT;
  61.  
  62.   ...
  63.  
  64.   SIGNAL mdc, mdio_in, mdio_oen, mdio_out : std_logic;
  65.   SIGNAL tse_125_clk, tse_25_clk, tse_2p5_clk, locked : std_logic;
  66.   SIGNAL eth_mode, ena_10 : std_logic;
  67.   SIGNAL tx_clk : std_logic;
  68.  
  69. BEGIN
  70.  
  71.   mdio_in     <= enet0_mdio;
  72.   enet0_mdc   <= mdc;
  73.   enet0_mdio  <= 'Z' WHEN mdio_oen = '1' ELSE mdio_out;
  74.   enet0_res_n <= res_n;
  75.  
  76.   tx_clk <= tse_125_clk WHEN eth_mode = '1' ELSE -- Gb mode
  77.         tse_2p5_clk WHEN eth_mode = '0' and ena_10 = '1' ELSE -- 10Mb mode
  78.             tse_25_clk; -- 100Mb mode
  79.  
  80.   ddio_out : ENTITY tse_ddio_out
  81.     PORT MAP(
  82.       datain_h   => "1",
  83.       datain_l   => "0",
  84.       outclock   => tx_clk,
  85.       dataout(0) => enet0_gtx_clk
  86.     );
  87.  
  88.   u0 : COMPONENT camera
  89.     PORT MAP (
  90.       clk_clk                             => clk,
  91.       reset_reset_n                       => res_n,
  92.      
  93.       ...
  94.      
  95.       tse_mac_mdio_connection_mdc         => mdc,
  96.       tse_mac_mdio_connection_mdio_in     => mdio_in,
  97.       tse_mac_mdio_connection_mdio_out    => mdio_out,
  98.       tse_mac_mdio_connection_mdio_oen    => mdio_oen,
  99.       tse_mac_rgmii_connection_rgmii_in   => enet0_rx_data,
  100.       tse_mac_rgmii_connection_rgmii_out  => enet0_tx_data,
  101.       tse_mac_rgmii_connection_rx_control => enet0_rx_dv,
  102.       tse_mac_rgmii_connection_tx_control => enet0_tx_en,
  103.       tse_mac_status_connection_set_10    => 'X',
  104.       tse_mac_status_connection_set_1000  => 'X',
  105.       tse_mac_status_connection_eth_mode  => eth_mode,
  106.       tse_mac_status_connection_ena_10    => ena_10,
  107.       tse_pcs_mac_rx_clock_connection_clk => enet0_rx_clk,
  108.       tse_pcs_mac_tx_clock_connection_clk => tx_clk,
  109.      
  110.       ...
  111.   );
  112.  
  113. ...
  114.  
  115. END ARCHITECTURE;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement