Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17267 Discussions

How to specify timing constraints between 2 memory ports

Altera_Forum
Honored Contributor II
1,566 Views

I have a design with 2 memory read ports (M1 and M2) connected as follows 

 

M1 ---> combinational-gates----> M2 

 

i.e. M1's data out feeds the address of M2. 

 

M1 and M2 are clocked by the outputs of a counter so I know exactly how much 

delay is allowed between the data launch at M1 and capture at M2. 

I don't know how to constrain this in SDC. 

Can I do this: 

 

1. call M1 and M2's clocks as exclusive or unrelated 

2. set_max_delay -from M1's data-out -to M2's inputs <my-known-value> 

 

Will quartus report if it cannot place the gates to honor my constraint?
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
860 Views

The "more correct" way would be to put generated clock assignments(where the -source is whatever drives the counter's clock) on the counter bit that creates the clock. That way skew will be accounted for back to the clock source.  

If you make the exclusive/unrelated, there is no way to re-relate them, as false paths, clock groups always have priority.
0 Kudos
Altera_Forum
Honored Contributor II
860 Views

Hi Rsyc, 

 

many thanks. I considered that idea, but here is the problem. 

suppose m1 is clocked by step 5 of the counter and m2 is clocked by step 8 of 

the counter. Then I know I have 3 clock cycles between m1 and m2. 

If I do a generated clock, then how would quartus know about this. 

Would it not infer that the m1->m2 path is very short (due to being generated 

by same clock) and hence fail constraint? 

 

thanks.
0 Kudos
Altera_Forum
Honored Contributor II
860 Views

The generated clocks will have a slower period when you create them. For example, if you had a 10ns clock as your base clock, then one generated clock might have a "-divide_by 32" option set, making it a 320ns period, and another with a "-divide by 128", making it 1,280ns. The setup relationship between those clocks would now be 320ns. If you don't like that, multicycles can change it.

0 Kudos
Altera_Forum
Honored Contributor II
860 Views

My interpretation of post# 3 is that M1 and M2 have the same frequency but they're phase shifted. 

So, "-divide_by X -phase Y" for M1 and "-divide_by X -phase Z" for M2.
0 Kudos
Altera_Forum
Honored Contributor II
860 Views

hi: 

 

I have a follow up question: Will the generated clock trick in SDC work 

for clock enables as well? If I move the logic to enables such that the 2 state 

devices have the same clock but 2 derived clock enables, How can I specify 

this in SDC?
0 Kudos
Altera_Forum
Honored Contributor II
860 Views

Use multi-cycle exceptions for that. 

 

You need to figure out how many clock cycles the path has to propagate a change. 

Ie, if M1 is enabled at clock 5 and M2 is enabled at clock 8, then a change is always launched by M1 3 cycles before M2 captures it. 

That's your setup multiplier: 3. 

 

Your hold multiplier is always N-1 (for enabled related multi-cycles). In this case, 2.
0 Kudos
Altera_Forum
Honored Contributor II
860 Views

Use get_fanouts. There should be a number of posts in this forum, but something like: 

 

set fouts [get_fanouts {enable_register_name}] 

set_multicycle_path -setup 2 -from $fouts -to $fouts 

set_multicycle_path -hold 1 -from $fouts -to $fouts 

 

If it's a divide-by-2 register(i.e. it feeds back on itself), you might need to remove it from the group using remove_from_collection. Also, many designs don't use the -from, just the -to, since all paths to these registers are multicycles.
0 Kudos
Altera_Forum
Honored Contributor II
860 Views

rbugalho, rysc: makes a lot of sense! I will try this and update.

0 Kudos
Reply