The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 6:14am
Pages: 1
Send Topic Print
Verilog-AMS Aysnchronous reset of ring-oscillator phase (Read 3845 times)
sal
New Member
*
Offline



Posts: 2

Verilog-AMS Aysnchronous reset of ring-oscillator phase
Feb 03rd, 2015, 1:42pm
 
I'm fairly new to Verilog-AMS and trying to model a gated ring-oscillator. I'd like to be able to freeze, reset and then re-enable the oscillator with the reset phase using input signals. I generate the phase using

Code:
phase = 2*`M_PI*idtmod(freq*fv,0.0,1.0,-0.5); 



and my oscillator output is

Code:
V(OUT) <+ offset + ampl*sin(phase); 



where frequency is my output frequency and fv is a variable I set depending on the crossing of enable. Once the enable signal goes low, fv becomes 0 and the state of the ring-oscillator is frozen. When enable goes high, the phase continues to integrate.

I have tried to apply a reset of the phase by detecting the crossing of my reset signal but since idtmod is outside of this, the phase of the oscillator always returns to the phase it was at before I froze its state - rather than continue from the reset state.

I'd much appreciate advice on the following - Whether it is possible to reset the phase of idtmod? And if not, is there another way to model a ring-oscillator with this function using verilog-ams?

Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Verilog-AMS Aysnchronous reset of ring-oscillator phase
Reply #1 - Feb 3rd, 2015, 1:51pm
 
Perhaps consider a discrete event implementation using disable. Take a look at the synchronouse oscillator found at http://verilogams.com/refman/modules/discrete-procedural/misc.html for inspiration.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: Verilog-AMS Aysnchronous reset of ring-oscillator phase
Reply #2 - Feb 5th, 2015, 3:44am
 
sal wrote on Feb 3rd, 2015, 1:42pm:
...
I'd much appreciate advice on the following - Whether it is possible to reset the phase of idtmod? And if not, is there another way to model a ring-oscillator with this function using verilog-ams?

If you cannot use Ken's suggestion for your application and you need an analog oscillation, I'd suggest to add a phase offset, which changes on reset, e.g. Code:
V(OUT) <+ offset + ampl*sin(phase - phase_offset);  


- B O E
Back to top
 
 
View Profile   IP Logged
sal
New Member
*
Offline



Posts: 2

Re: Verilog-AMS Aysnchronous reset of ring-oscillator phase
Reply #3 - Feb 6th, 2015, 1:42am
 
Thanks, I managed to get the behavior I wanted by calculating a phase offset using @cross and then subtracting this from the current phase of the oscillator.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.