Let me simplify a common clock network structure used in my company:
Firstly, there're multiple true clock sources (PLLs, external input, or RC OSCs).
Right at the beginning when these sources are "born", they are MUXed, and we call this generated clock "system clock".
Then this system clock travels through a lot of clock divider modules. All these DIV
s have the same internal structure: the output clock is selected between the input clock and a divided input clock (using D-FFs). Each DIV
outputs a clock which clocks certain digital logic, and can drive the next DIV
.
DIV(1)
+-----+ +----------------------+
clk src 1 -->| | | |
clk src 2 -->| MUX |--------+--------->+---+ |
clk src N -->| | | | +--+ |MUX|-------+--------------------------> block 1
+-----+ | +--|FF|--->+---+ | | +------+
| +--+ | +->|DIV(2)|---+------------> block 2
+----------------------+ +------+ | +------+
+->|DIV(N)|--> block N
+------+
Then, how can I constrain this clock structure correctly and neatly?
Can I create
a "system clock" at the first MUX
output? Or should I let all the sources pass?
And how am I supposed to handle all these DIV
s? The number of SDC CLOCKs will grow rapidly if I write SDC like this:
(suppose there's only one SDC CLOCK at the entry of DIV(1))
generate a clock after DIV(1)'s FF ----> so, block 1 get 2 SDC CLOCKs
generate a clock after DIV(2)'s FF from DIV(1)'s bypass path
generate a clock after DIV(2)'s FF from DIV(1)'s FF path ----> so, block 2 get 4 SDC CLOCKs
so on.
Or, how can I improve this structure?