sun_ray
Advanced Member level 3
- Joined
- Oct 3, 2011
- Messages
- 772
- Helped
- 5
- Reputation
- 10
- Reaction score
- 5
- Trophy points
- 1,298
- Activity points
- 6,828
pulses are coming from a domain with 200 mhz clock1 to a domain of 50 mhz clock2 where clock1 and clock2 are asynchronous to each other. Now two such consecutive pulses can have minimum two clock cycles of clock1 gap and maximum eight clock cycles of clock1 gap.
What will be the digital logic that can safely transfer these pulses from clock1 to clock2?
A repeated 1 0 0 sequence in clock1 domain can't be "safely" transferred, I presume.
It looks more like an interview question...given the other questions posted by sun_ray today.It looks to be a purely academic question.
Is it presumed that 50MHz is derived from the 200MHz domain, so that they are harmonically synchronous but asynchronous in phase?
Then we can ignore aliasing frequency effects.
Is it "safe" to assume that only pulse count is being transferred or is it the sequential pattern?
Is it "safe" to assume each pulse has the same width as the clock with some small latency?
It looks to be a purely academic question.
a cdc fifo
I completely agree. The problem is the lack of a clear specfication.
Without additional constraints, there's no other or even better solution than a dc fifo.
As ads-ee explained, you can't transfer more than 1 pulse per 20 ns on average, or you'll lose pulses. A more exact specification of expectable pulse sequences is necessary to define the fifo depth.
Specification about the pulse sequence is clear. The gap between two consecutive pulses in clock1 domain can be minimum 2 clock cycles and maximum 8 clock cycles. So the gap between to consecutive pulses can be 2 or 3 or 4 or 5 or 6 or 7 or 8 clock cycles of clock1. Is it clear now? If not clear please let me know so that I can clarify.
How do you say even using an asynchronous fifo we cannot transfer more than 1 pulse per 20 ns on average?
How is it clear? You must not know how to write specifications if you think that was clear...
For instance.
To just to name a few of the most obvious specifications that are missing.
- what is the ppm accuracy of both the 200 MHz and the 50 MHz?
- what is the gap duration distribution of the pulses in the 200 MHz domain?
- what is the maximum contiguous sequence of a gap duration of 2?
And FvM is saying you can't deal with more than 1 pulse per 20 ns on average as there are 4 clock cycle of 200 MHz for every 1 clock cycle of 50 MHz. This brings up the issue in my second bullet...if suppose four 2-cycle gap pulse occur together...
View attachment 119370
as you can see there are more pulses than there are 50 MHz clock cycles and the longer you keep generating 2-cycle gap pulses the more storage you need to not lose any pulses.
If on average there is exactly one pulse per 20 ns, then if the 200 MHz clock is +ppm faster and the 50 MHz is +0ppm to -ppm slower than eventually pulses will have to be dropped as the clocks are not an exact 4:1 ratio. What is the mitigation scheme for that?
It makes me think that there isn't a true senior level lead engineer on the project, otherwise such a technical lead would have said use a CDC FIFO. And if the aggregate rate is exactly one pulse per 20 ns then that same technical lead would have said we have to use a 200 MHz and 50 MHz that are frequency locked as any frequency drift in the wrong direction will eventually result in a missed pulse.
The ****
I do not know the ppm difference. It is also not needed. The clock1 and clock2 are async to each other are sufficient. I will like to know how ppm difference helps here. The gap duration distribution of the pulses in the 200 MHz domain is clear, it is mimimum of 2 clock cycles and maximum of 8 clock cycles of clock1. What do you mean by * what is the maximum contiguous sequence of a gap duration of 2???
The spec is clear and we are looking for a better solution than a cdc fifo.
You could implement handshaking..(I've not done it myself)
Also these flame wars make me a sad panda
What is the minimum pulse width? T= 1/f1 with min gap = 2/f1 and max gap 8/f1 thus pulse frequency f=1/(1+2) *f1 to 1/(1+8) *f1Pulses are coming from a domain with 200 Mhz clock1 to a domain of 50 Mhz clock2 where clock1 and clock2 are asynchronous to each other. Now two such consecutive pulses can have minimum two clock cycles of clock1 gap and maximum eight clock cycles of clock1 gap.
What will be the digital logic that can safely transfer these pulses from clock1 to clock2?
What is the minimum pulse width? T= 1/f1 with min gap = 2/f1 and max gap 8/f1 thus pulse frequency f=1/(1+2) *f1 to 1/(1+8) *f1
What is the output format ?
....serial? not enough bandwidth
.... parallel? what format?
What is the purpose? just count pulses only? or duplicate the pattern at a slower rate? ( the latter cannot be sustained)
the problem is "safely transfer" is not a engineering measurable parameter. It is a vague qualitative riddle.
Pulses are being generated in clock1 domain. So It has the width of 2.5 ns.
In a CDC problem safely transferring the pulses means that when these pulses reach clock2 domain then they do not cause any problem that can arise die to cdc.
Pulses are coming from a domain with 200 Mhz clock1
Pulses are being generated in clock1 domain. So It has the width of 2.5 ns.
Pulses are being generated in clock1 domain. So It has the width of 2.5 ns.
In a CDC problem safely transferring the pulses means that when these pulses reach clock2 domain then they do not cause any problem that can arise due to cdc.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?