X-Git-Url: https://git.libre-soc.org/?p=c4m-jtag.git;a=blobdiff_plain;f=c4m%2Fvhdl%2Fjtag%2Fc4m_jtag_idblock.vhdl;h=a8c4ac995da3a787e3a75d10e94bf47018defa81;hp=303959aed81a74e9fa3dc9c97d7e36914d9280d1;hb=87e7318e31ead7c6cb939aed7df5d28bfe05ef82;hpb=39779cf22cd24dc5c63bbb223e8b46d0ad9b3baf diff --git a/c4m/vhdl/jtag/c4m_jtag_idblock.vhdl b/c4m/vhdl/jtag/c4m_jtag_idblock.vhdl index 303959a..a8c4ac9 100644 --- a/c4m/vhdl/jtag/c4m_jtag_idblock.vhdl +++ b/c4m/vhdl/jtag/c4m_jtag_idblock.vhdl @@ -20,13 +20,13 @@ entity c4m_jtag_idblock is TDO: out std_logic; TDO_EN: out std_logic := '0'; - -- JTAG state - STATE: in TAPSTATE_TYPE; - NEXT_STATE: in TAPSTATE_TYPE; - DRSTATE: in std_logic; - -- The instruction - IR: in std_logic_vector(IR_WIDTH-1 downto 0) + IR: in std_logic_vector(IR_WIDTH-1 downto 0); + + -- actions + CAPTURE: in std_logic; + SHIFT: in std_logic; + UPDATE: in std_logic ); end c4m_jtag_idblock; @@ -42,31 +42,22 @@ begin process (TCK) begin if rising_edge(TCK) then - if DRSTATE = '1' then - case STATE is - when Capture => - SR_ID <= IDCODE; - - when Shift => - if IR = CMD_IDCODE then - SR_ID(30 downto 0) <= SR_ID(31 downto 1); - SR_ID(31) <= TDI; - elsif IR = CMD_BYPASS then - SR_ID(0) <= TDI; - else - null; - end if; - - when others => - null; - end case; + if CAPTURE = '1' then + SR_ID <= IDCODE; + elsif SHIFT = '1' then + if IR = CMD_IDCODE then + SR_ID(30 downto 0) <= SR_ID(31 downto 1); + SR_ID(31) <= TDI; + elsif IR = CMD_BYPASS then + SR_ID(0) <= TDI; + end if; end if; end if; end process; - EN_TDO <= STATE = Shift and DRSTATE = '1' and (IR = CMD_IDCODE or IR = CMD_BYPASS); TDO <= SR_ID(0) when EN_TDO else '0'; + EN_TDO <= SHIFT = '1' and (IR = CMD_IDCODE or IR = CMD_BYPASS); TDO_EN <= '1' when EN_TDO else '0'; end rtl;