2 use ieee.std_logic_1164.all;
3 use ieee.std_logic_unsigned.all;
4 use ieee.numeric_std.all;
5 use work.lx_rocon_pkg.all;
8 -- Increments step in IRC coprocessor
10 entity irc_proc_inc is
13 num_irc_g : positive := 4
19 reset_i : in std_logic;
21 op_o : out std_logic_vector(1 downto 0);
22 axis_o : out std_logic_vector((ceil_log2(num_irc_g)-1) downto 0)
26 architecture Behavioral of irc_proc_inc is
28 signal num_s : std_logic_vector((axis_o'length+1) downto 0);
32 -- higher bits are axis
33 axis_o <= num_s((num_s'length-1) downto 2);
35 op_o <= num_s(1 downto 0);
41 wait until clk_i'event and clk_i = '1';
44 num_s <= std_logic_vector(to_unsigned(4*num_irc_g - 1, num_s'length));
45 elsif num_s = std_logic_vector(to_unsigned(4*num_irc_g - 1, num_s'length)) then
46 num_s <= (others => '0');
48 num_s <= std_logic_vector(num_s + 1);