Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

how to start a multicycle process correctly

hi, i would do a large bit subtractor with a multicycle process to relax setup timing.

when i receive new data to be subtracted(A ,B), i store them in 2 registers clocked @ 100MHz. Once i have stored these values, i would start the multicycle process to do the subtraction @ 25MHz.

How i code the start signal that goes from the 100 MHz process to the multicycle process correctly? i have applied the constraint from the altera clock enable multicycle example:

# Setup multicycle of 4 to enabled driven destination registers

set_multicycle_path 4 -to [get_fanouts [get_pins enable_reg|q*] -through [get_pins -hierarchical *|*ena*]] -end -setup

# Hold multicycle of 3 to enabled driven destination registers

set_multicycle_path 3 -to [get_fanouts [get_pins enable_reg|q*] -through [get_pins -hierarchical *|*ena*]] -end –hold

i see in time quest that the path from the start signal to the multicycle process is included in the slow path, but i think it should be analyzed in the fast domain...

process(clk 100)

begin

if rising_edge(clk100) then

if new_data = '1' then

a_reg <= A;

b_reg <= B;

start_sub_process <= "1111"; -- How should this signal be done?

else

start_sub_process <= '0'&start_sub_process(2 downto 0);

end if;

end if,

end process;

sub_proc : process (clk100)

begin

if rising_edge(clk100) then

if enable_reg='1' then

if start_sub_process(0) = '1' then -- path from start_sub_process to multicycle process is analyzed in 40 ns

out_sub <= a_reg - b_reg;

end if;

end if;

end if;

end process;

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I think you mean if start_sub_process(0) = '0' then

    Anyway, why do you have two enables(enable_reg and start_sub_process(0). One is enough at the rate of 1/4
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you for your reply. I wrote here a simplified process. I do a slightly different thing.

    I have 1 process that puts out 6 terms @100MHz to be subtracted (A,B,C,D,E,F).

    Since i have a lot of time to do these subtraction ( A-B, C-D, E-F), i would use a single subtractor in multicycle.

    So when data arrive, i store them in registers then i would start my multicycle process, (start_sub_process) the multicycle process loads data in the sub inputs (in0<= A in1 <=B) and does the subtraction (out <= in0-in1).

    I repeat this for all the data until i have 3 results that i push out with a "done" singnal.

    Since the start_sub_process belongs to a 100MHz process, i would expect that this path is analyzed with normal constraints.

    If i apply constraints from clock enable multicycle example, this path is multicycled
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I expect the path to end register will be multicycled and that is what you want.

    The start_sub_process itself being generated in a register somewhere prior is not involved. So I don't see anything wrong here.

    Remember a path is from reg to reg and your multicycle defines "end" correctly. So when you say start_sub_process is multicycled do you mean its start register or end register is multicycled?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The path from "start_sub_process" to "out_sub" has the constraint applied (40 ns)

    I think that all paths from start_sub_process shouldn't have the multicycle constraint applied, because it's a 100MHz signal that goes in a slower process. start_sub_process will be high for 4 periods @ 100MHz to be correctly catched by the multicycled process, but the setup requirement remains 10 ns.

    Am i wrong?

    I modified the constraint given by example:

    set_multicycle_path 4 -from [get_fanouts [get_pins enable_reg|q*] -through [get_pins -hierarchical *|*ena*]] to [get_fanouts [get_pins enable_reg|q*] -through [get_pins -hierarchical *|*ena*]] -end -setup

    same thing i did for hold requirement.

    In this way, i hope, only paths from/to enable_reg are multicycled
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    In short, you the user design the multicycle and insert constraints. With enable based constraint you are asking to deconstraint all enabled registers. Your enable is both en_reg ANDed with start_sub_process. deconstraints are defined in terms of registers, not processes.