I've to constraints an Lattice Semiconductor FPGA and I've some doubts about the multicycle constraint described here. I've the following RTL :
Basically it is a counter that is driven by a rising edge detector. Each times that a signal rise from 0 to 1 an impulse is generated and the counter increases. This is also the VHDL code, just to be clear :
type COM_PACKETS_COUNTER is array ( 7 downto 0) of std_logic_vector(31 downto 0);
signal capture_com_tx_packet_counter : COM_PACKETS_COUNTER;
signal capture_com_rx_packet_counter : COM_PACKETS_COUNTER;
signal capture_com_tx_data_reg : std_logic_vector(7 downto 0);
signal capture_com_rx_data_reg : std_logic_vector(7 downto 0);
signal capture_com_tx_start_byte_reg : std_logic_vector(7 downto 0);
signal capture_com_rx_start_byte_reg : std_logic_vector(7 downto 0);
signal capture_com_tx_start_byte_reg_delay : std_logic_vector(7 downto 0);
signal capture_com_rx_start_byte_reg_delay : std_logic_vector(7 downto 0);
signal capture_com_tx_start_byte_reg_edge : std_logic_vector(7 downto 0);
signal capture_com_rx_start_byte_reg_edge : std_logic_vector(7 downto 0);
..........................
COM_COUNTER_PROCESS :
for i in 0 to capture_com_tx_data_reg'length-1 generate
process(clk_i, rst_i)
begin
if rst_i = '1' then
capture_com_rx_start_byte_reg_delay(i) <= '0';
capture_com_rx_start_byte_reg_edge(i) <= '0';
capture_com_tx_start_byte_reg_delay(i) <= '0';
capture_com_tx_start_byte_reg_edge(i) <= '0';
elsif clk_i = '1' and clk_i'event then
capture_com_rx_start_byte_reg_delay(i) <= capture_com_rx_start_byte_reg(i);
capture_com_rx_start_byte_reg_edge(i) <= not ( capture_com_rx_start_byte_reg_delay(i) ) and capture_com_rx_start_byte_reg(i) and CAPTURE_COM_RX_SELECTED_FILTER(i);
capture_com_tx_start_byte_reg_delay(i) <= capture_com_tx_start_byte_reg(i);
capture_com_tx_start_byte_reg_edge(i) <= not ( capture_com_tx_start_byte_reg_delay(i) ) and capture_com_tx_start_byte_reg(i) and CAPTURE_COM_TX_SELECTED_FILTER(i);
end if;
end process;
process(clk_i,rst_i)
begin
if rst_i = '0' then
capture_com_tx_packet_counter(i) <= (others => '0');
elsif clk_i'event and clk_i = '1' then
if capture_com_tx_start_byte_reg_edge(i) = '1' then
capture_com_tx_packet_counter(i) <= capture_com_tx_packet_counter(i) + 1;
end if;
if capture_com_rx_start_byte_reg_edge(i) = '1' then
capture_com_rx_packet_counter(i) <= capture_com_rx_packet_counter(i) + 1;
end if;
end if;
end process;
end generate;
I have several counter in my design. Now I want to relax the timing, so I'm wondering if I can use a "Multicycle constraint" between the source register ( capture_com_rx_start_byte_reg_edge ) and the destination register ( capture_com_rx_packet_counter ) because I don't need that the counter is updated after the rising of capture_com_tx_start_byte_reg.
My only concern is that the generated impulse could last more than a clock cycle that could be a problem because the counter could be increased more than 1 unit.