Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] irrational clk period

Status
Not open for further replies.

nsgil85

Member level 4
Joined
Dec 11, 2012
Messages
73
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,833
Hi evryone

I need to simulate 73Mhz clock, 50% DC, then i wrote this procedure:
Code:
procedure cgen(signal clk : out std_logic; constant FREQ : real) is
constant P: time := 1 sec / FREQ;        
constant HIGH_T : time := P/ 2;          
constant LOW_T  : time := P- HIGH_T;  
begin
   loop
   clk <= '1';
   wait for HIGH_T;
   clk <= '0';
   wait for LOW_T;
   end loop;
end procedure;
The output for it is round number, any suggestions for simulate 73Mhz clock

Best
Gil
 

Hi,

The output of what is a rounded number?

Rounded timing? To an integer value seems to be impossible because 0.00000x will become 0.
Rounded frequency to an integer seems not to be the case, too, because it will give 73000000.

I don't know what's the problem.

Klaus
 

Let me rephrase my question.

Is it possible to simulate clk with iritional period ? if so how will you simulate 73Mhz

Gil
 

1. P can be only accurate according to the simulation time resolution in effect. It can be adjusted in wide range.

2. It's not clear if and why you need the 73 MHz frequency to be exact, and which error would be acceptable. The only understandable reason I can imagine is that you want to implement a certain clock frequency ratio.

3. To realize an exact average frequency with limited time resolution, consider a DDS approach.
 

What are you simulating that needs such a precise clock in simulation?
I dont usually need anything other than 100mhz, as using this frequency make it easy to measure the number of clocks between events.
 

2. It's not clear if and why you need the 73 MHz frequency to be exact, and which error would be acceptable. The only understandable reason I can imagine is that you want to implement a certain clock frequency ratio
What are you simulating that needs such a precise clock in simulation?

I do need it for communicating with a custom asic that runs at 73Mhz that do encryption.
So what is the syntex for running 73Mhz on simulation?
 
Last edited:

I do need it for communicating with a custom asic that runs at 73Mhz that do encryption.
So what is the syntex for running 73Mhz on simulation?

It's simulation. Clock frequency doesn't matter. It's all virtual.
 

Have you ever done timing simulation?

... pleeease.

OP is clueless. He is not doing timing simulation. He is either trying to implement a 73MHz clock and doesn't know how to code an SDC file or he is doing functional simulation.
 

Although it's probably useless, you can make the clock as accurate as you want. But apparently the OP has no idea about the required precision.
 

The OP just wants to generate a 73MHz signal as accurately as possible with 50% DC. He will use it for simulation. Thats it I think.
 

I do need it for communicating with a custom asic that runs at 73Mhz that do encryption.
So what is the syntex for running 73Mhz on simulation?

What is the time resolution for your simulator ?
 

Saying as accurate as possible is another word for mental laziness, I think. Industry standard simulators, e.g. have configurable time resolution, it's no problem to chose 1 ps if required. Using default 1 ns resolution gives still only 2 % error (period 14 ns instead of 13.7 ns) , should be usually sufficient.
 

Hi guys,

The OP just wants to generate a 73MHz signal as accurately as possible with 50% DC. He will use it for simulation. Thats it I think.
Correct,
Sorry if I annoyed some of you but the question is very simple, I'm doing timing simulation,
to those who asked, my acurrcy is 3 digits after the dot.

Thanks
 

Hi,

I'm doing timing simulation,
to those who asked, my acurrcy is 3 digits after the dot.
Does this make sense?
Timing is measured in s (seconds)
So 0.001s (three digits after the dot) is just one millisecond.

I doubt this is what you mean....

Klaus
 

Hi,

If you mean 3rd digit of 1ns....
You could simply say you want "1ps" of resolution.

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top