mirror of
https://github.com/antonblanchard/microwatt.git
synced 2026-01-11 23:43:15 +00:00
This adds a simple bus that can be mastered from an external system via JTAG, which will be used to hookup various debug modules. It's loosely based on the RiscV model (hence the DMI name). The module currently only supports hooking up to a Xilinx BSCANE2 but it shouldn't be too hard to adapt it to support different TAPs if necessary. The JTAG protocol proper is not exactly the RiscV one at this point, though I might still change it. This comes with some sim variants of Xilinx BSCANE2 and BUFG and a test bench. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
40 lines
851 B
VHDL
40 lines
851 B
VHDL
library ieee;
|
|
use ieee.std_logic_1164.all;
|
|
use ieee.numeric_std.ALL;
|
|
|
|
library unisim;
|
|
use unisim.vcomponents.all;
|
|
|
|
entity BSCANE2 is
|
|
generic(jtag_chain: INTEGER);
|
|
port(capture : out std_logic;
|
|
drck : out std_logic;
|
|
reset : out std_logic;
|
|
runtest : out std_logic;
|
|
sel : out std_logic;
|
|
shift : out std_logic;
|
|
tck : out std_logic;
|
|
tdi : out std_logic;
|
|
tms : out std_logic;
|
|
update : out std_logic;
|
|
tdo : in std_logic
|
|
);
|
|
end BSCANE2;
|
|
|
|
architecture behaviour of BSCANE2 is
|
|
alias j : glob_jtag_t is glob_jtag;
|
|
begin
|
|
sel <= j.sel(jtag_chain);
|
|
tck <= j.tck;
|
|
drck <= tck and sel and (capture or shift);
|
|
capture <= j.capture;
|
|
reset <= j.reset;
|
|
runtest <= j.runtest;
|
|
shift <= j.shift;
|
|
tdi <= j.tdi;
|
|
tms <= j.tms;
|
|
update <= j.update;
|
|
j.tdo <= tdo;
|
|
end architecture behaviour;
|
|
|