diff --git a/generic_ip/generic_sequencer/18/src/generic_sequencer_18.vhd b/generic_ip/generic_sequencer/18/src/generic_sequencer_18.vhd index 9c57312..2ed4786 100644 --- a/generic_ip/generic_sequencer/18/src/generic_sequencer_18.vhd +++ b/generic_ip/generic_sequencer/18/src/generic_sequencer_18.vhd @@ -61,7 +61,7 @@ entity generic_sequencer_18 is trigger_in : in std_logic_vector(TRIGGER_WIDTH - 1 downto 0); pos_in : in std_logic_vector(POS_WIDTH - 1 downto 0); -- - busy : out std_logic; + busy : out std_logic := '1'; -- vector_out : out std_logic_vector(VECTOR_WIDTH - 1 downto 0); -- @@ -116,7 +116,7 @@ architecture rtl of generic_sequencer_18 is signal pos_store_csr : std_logic_vector(31 downto 0) := (others => '0'); signal pos_store : std_logic_vector(POS_WIDTH - 1 downto 0); signal pos_target : std_logic_vector(POS_WIDTH - 1 downto 0); - signal pos_comp_msbs : std_logic_vector(7 downto 0) := (others => '0'); + signal pos_comp_msbs : std_logic_vector(7 downto 0); signal trig_mask : std_logic_vector(TRIGGER_WIDTH - 1 downto 0); signal trig_sel : std_logic_vector(3 downto 0); @@ -138,7 +138,8 @@ architecture rtl of generic_sequencer_18 is signal r1_data_valid : std_logic; -- strobe to cause R1 to be updated with R1_data value signal decode, clr_vec, ld_vec : std_logic; - signal bus_valid_i, busy_i : std_logic; + signal bus_valid_i : std_logic; + signal busy_i : std_logic := '1'; signal ld_start_addr, inc_ram_addr : std_logic; signal ld_trig_mask, ld_trig_sel : std_logic; signal ld_pos, ld_ramp : std_logic; @@ -263,9 +264,16 @@ begin begin if reset_n = '0' then debug_mode <= '0'; + vector_val_cpu <= '0'; + vector_cpu <= (others => '0'); clr_seq_queue <= '0'; clr_seq_queue_exe <= '0'; seq_queue_empty <= '0'; + r1_data_valid <= '0'; + r1_data <= (others => '0'); + queue_add_flag <= '0'; + queue_add <= (others => '0'); + pos_comp_msbs <= (others => '0'); elsif clk'event and clk = '1' then -- vector_val_cpu <= '0'; @@ -287,6 +295,11 @@ begin debug_mode <= debug_mode_r; end if; + if fsm = s_pos_wait and subcode = x"4" then + -- capture the comparator top bits + pos_comp_msbs <= operand_1(pos_comp_msbs'range); + end if; + if (QUEUE_EN = true) then clr_seq_queue <= clr_seq_queue_r; clr_seq_queue_exe <= clr_seq_queue_exe_r; @@ -360,7 +373,8 @@ begin pFSM_SR : process(reset_n, clk) begin if (reset_n = '0') then - fsm <= s_idle; + fsm <= s_idle; + opcode <= (others => '0'); elsif (clk = '1' and clk'event) then fsm <= fsm_nxt; opcode <= ram_rd_data(31 downto 28); @@ -509,9 +523,8 @@ begin when s_pos_wait => if subcode = x"4" then - -- don't wait - just set the comparator top bits - fsm_nxt <= s_fetch; - pos_comp_msbs <= operand_1(pos_comp_msbs'range); + -- don't wait - comparator top bits will be set in REG_PROC + fsm_nxt <= s_fetch; elsif (pos_in = pos_target) then fsm_nxt <= s_fetch; end if; @@ -555,6 +568,20 @@ begin begin if (reset_n = '0') then vector_out_i <= (others => '0'); + start_req_d <= '0'; + fetch_enable <= '0'; + pc_value <= (others => '0'); + ram_rd_addr <= (others => '0'); + operand_comp <= (others => '0'); + subcode <= (others => '0'); + busy <= '1'; + trig_mask <= (others => '0'); + trig_sel <= (others => '0'); + clr_vec_ii <= '0'; + ramp_to_val <= '0'; + return_addr <= (others => '0'); + op_cnt <= (others => '0'); + loop_active <= '0'; elsif (clk = '1' and clk'event) then start_req_d <= start_req; fetch_enable <= (not debug_mode) or (debug_mode and step_req); @@ -791,7 +818,7 @@ begin r1_next := std_logic_vector(signed(r1) + signed(operand_1)); when x"4" => r1_next := std_logic_vector(signed(r1) - signed(operand_1)); - when others => null; + when others => null; -- r1_next and therefore r1 retain current value end case; r1 <= r1_next; end if;