The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> Variable Freq generator for testbenching
https://designers-guide.org/forum/YaBB.pl?num=1165980166

Message started by thamiral on Dec 12th, 2006, 7:22pm

Title: Variable Freq generator for testbenching
Post by thamiral on Dec 12th, 2006, 7:22pm

Dear all,

Does anyone have any ideas on the best way of creating a variable/run-time-Programmable frequency clock/source for test benching mixed signal circuits using the spectre circuit simulator?

Unfortunately, using the events that verilogA comes with (example the timer event), I was unable to come up with a run-time programmable frequency source and I'd prefer not to have to create a PLL in a CSU mode :)...

Thanks,

Sincerely,

Taha

Title: Re: Variable Freq generator for testbenching
Post by thamiral on Dec 12th, 2006, 8:31pm

Just a quick addition to my previous post... I had forgotten to include my temporary solution...

I am currently using a Vpulse set at a certain frequency along with a verilogA frequency divider (this module counts edges in the Vpulse object based on the voltage value read from a Vpwl source and outputs an edge when the correct number of edges in Vpulse have been encountered)

This temporary solution obviously has a few drawbacks such as being limited to pulses since a sinusoid does not have 'edges'.

Hopefully the members of this forum will be able to suggest a better solution :) ....

Sincerely,

Taha

Title: Re: Variable Freq generator for testbenching
Post by achim.graupner on Dec 12th, 2006, 10:14pm

Dear thamiral,

I am not sure whether that help, but below a verilogA snip from a VCO:

analog begin
 bound_step(0.02/gain);
 V(fout) <+ amplitude * sin(2*`M_PI*idt(gain*V(vin), 0));
end

the idea behind is that the phase is definded as
phi(t) = amplitude * int( f(t') dt', 0, t)

the output frequency of the circuit is
gain*V(in)
if a constant voltage is applied

Regards,
Achim

Title: Re: Variable Freq generator for testbenching
Post by thamiral on Dec 13th, 2006, 5:15am

Thanks for your interest in the problem Achim,

Yes I have seen that verilogA snippet from one of the VCO behavioral models that I have encountered. It definately seems like it will do the trick for sinusoids.

I was hoping for a more elegant and effcient method for generating all kinds of waves. Basically a replacement for vsource that could look up frequencies from a lookup table. It seems like a common enough application that I'd assume circuit simulators would allow for :)

For now, I guess,  I'll keep using either the VCO snippet you had suggested in conjuction with either my first attempt on the problem or use an analog mux (written in verilogA) and connect it to the sources I need.

Thanks,

Sincerely,

Taha

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.