Skip to content
Snippets Groups Projects

Resolve L2SDP-901

Merged Reinier van der Walle requested to merge L2SDP-901 into master
1 file
+ 0
242
Compare changes
  • Side-by-side
  • Inline
-------------------------------------------------------------------------------
--
-- Copyright (C) 2009
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-------------------------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.ALL;
ARCHITECTURE str OF jtag_top IS
COMPONENT bscan2 IS
-- enter the number of BSCAN2 blocks to create. This is the only place that
-- needs to be modified to control the number of local scan ports created.
GENERIC (
bscan_ports : POSITIVE := 2
);
PORT (
TDI, TCK, TMS : IN STD_LOGIC;
TRST : IN STD_LOGIC;
-- Turn on slow slew in fitter for output signals
TDO : OUT STD_LOGIC;
-- OE control for MSP ports (Active high)
ENABLE_MSP : IN STD_LOGIC;
MSPTCK : OUT STD_LOGIC_VECTOR(4*bscan_ports-1 DOWNTO 0);
MSPTDI : IN STD_LOGIC_VECTOR(4*bscan_ports-1 DOWNTO 0);
MSPTDO : OUT STD_LOGIC_VECTOR(4*bscan_ports-1 DOWNTO 0);
MSPTMS : OUT STD_LOGIC_VECTOR(4*bscan_ports-1 DOWNTO 0);
MSPTRST : OUT STD_LOGIC_VECTOR(4*bscan_ports-1 DOWNTO 0);
-- one set of addresses to check for device
IDN : IN STD_LOGIC_VECTOR(3 DOWNTO 0)
);
END COMPONENT bscan2;
-- internal enable signal for tri-stating the scanbridge
CONSTANT jtag_chains : NATURAL := 5;
SIGNAL ENABLE_SB : STD_LOGIC;
SIGNAL TDO_BSCAN : STD_LOGIC;
SIGNAL TDA : STD_LOGIC;
SIGNAL TDB : STD_LOGIC;
SIGNAL TDC : STD_LOGIC;
SIGNAL MSPTDO_BSCAN : STD_LOGIC_VECTOR(jtag_chains-1 DOWNTO 0);
SIGNAL MSPTCK_BSCAN : STD_LOGIC_VECTOR(jtag_chains-1 DOWNTO 0);
SIGNAL MSPTMS_BSCAN : STD_LOGIC_VECTOR(jtag_chains-1 DOWNTO 0);
SIGNAL MSPTRST_BSCAN : STD_LOGIC_VECTOR(jtag_chains-1 DOWNTO 0);
BEGIN
bscan : COMPONENT bscan2
PORT MAP (
TDI => TDI,
TCK => TCK,
TMS => TMS,
TRST => TRST,
TDO => TDO_BSCAN,
ENABLE_MSP => ENABLE_SB,
MSPTCK(jtag_chains-1 DOWNTO 0) => MSPTCK_BSCAN,
MSPTDI(jtag_chains-1 DOWNTO 0) => MSPTDI,
MSPTDO(jtag_chains-1 DOWNTO 0) => MSPTDO_BSCAN,
MSPTMS(jtag_chains-1 DOWNTO 0) => MSPTMS_BSCAN,
MSPTRST(jtag_chains-1 DOWNTO 0) => MSPTRST_BSCAN,
IDN => IDN
);
p_jtagselect: PROCESS(TDI,MSPTDI(jtag_chains-1 DOWNTO 0),TCK,TMS,TRST)
BEGIN
ENABLE_SB <= '0';
MSPTDO(jtag_chains-1 DOWNTO 0) <= "ZZZZZ";
MSPTCK(jtag_chains-1 DOWNTO 0) <= "ZZZZZ";
MSPTMS(jtag_chains-1 DOWNTO 0) <= "ZZZZZ";
MSPTRST(jtag_chains-1 DOWNTO 0) <= "ZZZZZ";
IF LPSEL(4) = '0' THEN
ENABLE_SB <= ENABLE_MSP;
MSPTDO <= MSPTDO_BSCAN;
TDO <= TDO_BSCAN;
MSPTCK <= MSPTCK_BSCAN;
MSPTMS <= MSPTMS_BSCAN;
MSPTRST <= MSPTRST_BSCAN;
else
IF LPSEL(0) = '0' THEN
MSPTDO(0) <= TDI;
TDA <= MSPTDI(0);
MSPTCK(0) <= TCK;
MSPTMS(0) <= TMS;
MSPTRST(0) <= TRST;
ELSE
TDA <= TDI;
END IF;
IF LPSEL(1) = '0' THEN
MSPTDO(1) <= TDA;
TDB <= MSPTDI(1);
MSPTCK(1) <= TCK;
MSPTMS(1) <= TMS;
MSPTRST(1) <= TRST;
ELSE
TDB <= TDA;
END IF;
IF LPSEL(2) = '0' THEN
MSPTDO(2) <= TDB;
TDC <= MSPTDI(2);
MSPTCK(2) <= TCK;
MSPTMS(2) <= TMS;
MSPTRST(2) <= TRST;
ELSE
TDC <= TDB;
END IF;
IF LPSEL(3) = '0' THEN
MSPTDO(3) <= TDC;
TDO <= MSPTDI(3);
MSPTCK(3) <= TCK;
MSPTMS(3) <= TMS;
MSPTRST(3) <= TRST;
ELSE
TDO <= TDC;
END IF;
END IF;
-- old
-- CASE LPSEL IS
-- WHEN "00000" =>
-- ENABLE_SB <= '0';
-- MSPTDO(0) <= TDI;
-- MSPTDO(jtag_chains-1 DOWNTO 1) <= "ZZZZ";
-- TDO <= MSPTDI(0);
-- MSPTCK(0) <= TCK;
-- MSPTCK(jtag_chains-1 DOWNTO 1) <= "ZZZZ";
-- MSPTMS(0) <= TMS;
-- MSPTMS(jtag_chains-1 DOWNTO 1) <= "ZZZZ";
-- MSPTRST(0) <= TRST;
-- MSPTRST(jtag_chains-1 DOWNTO 1) <= "ZZZZ";
-- WHEN "00001" =>
-- ENABLE_SB <= '0';
-- MSPTDO(1) <= TDI;
-- MSPTDO(jtag_chains-1 DOWNTO 2) <= "ZZZ";
-- MSPTDO(0) <= 'Z';
-- TDO <= MSPTDI(1);
-- MSPTCK(1) <= TCK;
-- MSPTCK(jtag_chains-1 DOWNTO 2) <= "ZZZ";
-- MSPTMS(1) <= TMS;
-- MSPTMS(jtag_chains-1 DOWNTO 2) <= "ZZZ";
-- MSPTRST(1) <= TRST;
-- MSPTRST(jtag_chains-1 DOWNTO 2) <= "ZZZ";
-- WHEN "00010" =>
-- ENABLE_SB <= '0';
-- MSPTDO(2) <= TDI;
-- MSPTDO(jtag_chains-1 DOWNTO 3) <= "ZZ";
-- MSPTDO(1 DOWNTO 0) <= "ZZ";
-- TDO <= MSPTDI(2);
-- MSPTCK(2) <= TCK;
-- MSPTCK(jtag_chains-1 DOWNTO 3) <= "ZZ";
-- MSPTMS(2) <= TMS;
-- MSPTMS(jtag_chains-1 DOWNTO 3) <= "ZZ";
-- MSPTRST(2) <= TRST;
-- MSPTRST(jtag_chains-1 DOWNTO 3) <= "ZZ";
-- WHEN "00011" =>
-- ENABLE_SB <= '0';
-- MSPTDO(3) <= TDI;
-- MSPTDO(4) <= 'Z';
-- MSPTDO(2 DOWNTO 0) <= "ZZZ";
-- TDO <= MSPTDI(3);
-- MSPTCK(3) <= TCK;
-- MSPTCK(2 DOWNTO 0) <= "ZZZ";
-- MSPTMS(3) <= TMS;
-- MSPTMS(2 DOWNTO 0) <= "ZZZ";
-- MSPTRST(3) <= TRST;
-- MSPTRST(2 DOWNTO 0) <= "ZZZ";
-- WHEN "00100" =>
-- ENABLE_SB <= '0';
-- MSPTDO(4) <= TDI;
-- MSPTDO(3 DOWNTO 0) <= "ZZZZ";
-- TDO <= MSPTDI(4);
-- MSPTCK(4) <= TCK;
-- MSPTCK(3 DOWNTO 0) <= "ZZZZ";
-- MSPTMS(4) <= TMS;
-- MSPTMS(3 DOWNTO 0) <= "ZZZZ";
-- MSPTRST(4) <= TRST;
-- MSPTRST(3 DOWNTO 0) <= "ZZZZ";
-- WHEN "00101" =>
-- ENABLE_SB <= '0';
-- MSPTDO(0) <= TDI;
-- MSPTDO(1) <= MSPTDI(0);
-- MSPTDO(2) <= MSPTDI(1);
-- MSPTDO(3) <= MSPTDI(2);
-- TDO <= MSPTDI(3);
-- MSPTDO(jtag_chains-1 DOWNTO 4) <= "Z";
-- MSPTCK(0) <= TCK;
-- MSPTCK(1) <= TCK;
-- MSPTCK(2) <= TCK;
-- MSPTCK(3) <= TCK;
-- MSPTCK(jtag_chains-1 DOWNTO 4) <= "Z";
-- MSPTMS(0) <= TMS;
-- MSPTMS(1) <= TMS;
-- MSPTMS(2) <= TMS;
-- MSPTMS(3) <= TMS;
-- MSPTMS(jtag_chains-1 DOWNTO 4) <= "Z";
-- MSPTRST(0) <= TRST;
-- MSPTRST(1) <= TRST;
-- MSPTRST(2) <= TRST;
-- MSPTRST(3) <= TRST;
-- MSPTRST(jtag_chains-1 DOWNTO 4) <= "Z";
-- WHEN "00111" =>
-- ENABLE_SB <= 'Z';
-- MSPTDO(4 DOWNTO 0) <= "ZZZZZ";
-- TDO <= 'Z';
-- MSPTCK(4 DOWNTO 0) <= "ZZZZZ";
-- MSPTMS(4 DOWNTO 0) <= "ZZZZZ";
-- MSPTRST(4 DOWNTO 0) <= "ZZZZZ";
-- WHEN OTHERS =>
-- ENABLE_SB <= ENABLE_MSP;
-- MSPTDO <= MSPTDO_BSCAN;
-- TDO <= TDO_BSCAN;
-- MSPTCK <= MSPTCK_BSCAN;
-- MSPTMS <= MSPTMS_BSCAN;
-- MSPTRST <= MSPTRST_BSCAN;
-- END CASE;
END PROCESS;
END str;
Loading