Altera_Forum
Honored Contributor
18 years agoDefine internal signal as a base clock?
I have a problem performing timing analysis on a design. I'm using the Classic timing analyser.
Suppose I have a device which has many (low speed) inputs on seprate physical pins, and I need to be able to select any one of them to use as the clock for some downstream logic. The selection between them is made by an external CPU writing a register over a separate, high speed, synchronous interface. The code the might look like this: PROCESS (everything...) BEGIN IF clk_cpu'event AND clk_cpu = '1' THEN IF addr = clk_mux_addr THEN clk_mux_setting <= data; END IF; END IF; clk_logic <= clk_array (clk_mux_setting); END PROCESS; All the clocks in clk_array are asychronous to each other and to the CPU. I know I'll get glitches in clk_logic when the CPU changes settings and this is OK. Further on I then have: PROCESS (clk_logic, clk_cpu) BEGIN IF clk_logic'event AND clk_logic = '1' THEN result <= (stuff); END IF; IF clk_cpu'event AND clk_cpu = '1' THEN result_meta <= result; result_cpu <= result_meta; END IF; END PROCESS; ie. I'm double sampling the result to get it back into the clk_cpu domain, and have no expectation at all of any relationship between clk_cpu and clk_logic. However... When running the timing analysis, Quartus picks up on the fact that clk_logic does depend on clk_cpu, because it depends on clk_mux_setting. Moreover, this is quite a long path, so the fitter is wasting effort and my Fmax is greatly reduced. What I see in the report is a setup time violation between result and result_meta. This is a false path, of course, and I could just specify cut_timing_path between these two registers. But, the real code is considerably more complex, and it would mean that the timing constraints are closely tied in with the workings of the process. So, what I really want to do is insist that clk_logic be treated as a base clock - ie. as though it came in from an external pin, with its own Fmax and no implied relationship to any other clock. Is this possible without actually routing it out to a physical pin and back in again through another pin?