I want to setup a 27 MHz clock signal in ModelSim. I usually setup a clock by right clicking that signal -> clock -> setup period. For example, 50 MHz clock -> 20 ns or I used the force statement.
Because the 27 MHz clock is special, it is not a integer period, if I setup the clock with a appx value, it always having timing issues.
So, how do I setup this clock?
Your clocks are asynchronous. You will always have “timing issues” – if your two clock edges come very close to each other (as they inevitably will sometimes) some of your flops will exhibit metastability.
You need to resynchronise your 27 MHz domain signals to the 50 MHz domain, accept and mitigate for the fact that occasionally the synchronisation will be wrong. There are techniques to reduce the value of “occasionally” to as small a value as you think is appropriate for your system, but you’ll never get rid of it.
See FPGA-FAQ 0017, Tell me about Metastability.