-- jtag_req latch. Could be split into 3 processes but it's probably
-- not worthwhile.
--
- shifter: process(jtag_clk, jtag_reset)
+ shifter: process(jtag_clk, jtag_reset, sys_reset)
begin
- if jtag_reset = '1' then
+ if jtag_reset = '1' or sys_reset = '1' then
shiftr <= (others => '0');
jtag_req <= '0';
+ request <= (others => '0');
elsif rising_edge(jtag_clk) then
-- Handle jtag "commands" when sel is 1
if rising_edge(clk) then
if rst = '1' then
r <= reg_type_init;
+ ctrl.tb <= (others => '0');
+ ctrl.dec <= (others => '0');
ctrl.msr <= (MSR_SF => '1', MSR_LE => '1', others => '0');
ctrl.irq_state <= WRITE_SRR0;
else
sck_send <= '0';
sck_recv <= '0';
clk_div <= 0;
+ counter := 0;
elsif counter = clk_div then
counter := 0;
count_bit: process(clk)
begin
if rising_edge(clk) then
- if start_cmd = '1' then
- bit_count <= cmd_clks_i;
- elsif state /= DATA then
- bit_count <= (others => '1');
- elsif sck_recv = '1' then
- bit_count <= std_ulogic_vector(unsigned(bit_count) - 1);
+ if rst = '1' then
+ bit_count <= (others => '0');
+ else
+ if start_cmd = '1' then
+ bit_count <= cmd_clks_i;
+ elsif state /= DATA then
+ bit_count <= (others => '1');
+ elsif sck_recv = '1' then
+ bit_count <= std_ulogic_vector(unsigned(bit_count) - 1);
+ end if;
end if;
end if;
end process;