I created a verilogA module.
What it basically does is as below:-
It is a simple sine wave generator.
I stored the sine wave time & amplitude in a text file for one period of the sine wave.
The verilog A code reads the file and generates the sine wave for the entire transient simulation time.
But the problem is:-
If I am not using the strobeperiod, the curve is NOT smooth at all.
But when I use stobeperiod=1ps then it becomes smooth.
I was thinking that the transient simulation will be evaluated at each time point stored in the file.
Can anybody please tell why this is happening.
The simulator will only place timesteps that are sufficient to resolve the equations, not necessarily enough that the sine wave looks like a sine wave. One way to help the simulator take more timesteps is to use the bound_step() function - this should be a little nicer to the simulator (than strobeperiod) as it still has flexibility on the time points, but now they are limited to a maximum time between steps. Work out how many samples/points you wantper cycle and work out the max timestep from there.
I hope that this helps.
In reply to skillUser:
Also, a simple sine wave generator would use the sin() function in the language rather than generating a piece-wise waveform from an external file. It's hard to give a precise answer (Lawrence is correct, of course) without seeing your code - it depends how you're doing it...
In reply to Andrew Beckett:
Thanks a lot Lawrence & Andrew.
I have never come across the bound_step() function.
What it is actually ? Is it a OCEAN function . I searched in OCEAN document but couldn't find this one.
Can you please explain how it actually work or point me to the doc or link where I can know about this function.
In reply to RFStuff:
$bound_step is a function in the VerilogA language. It's covered in the language reference manual (both those we ship with the software, plus the official Accellera LRM).
I actually read through the document.
What I understood is:- bound_step( ) enforces the maximum timestep( that is the upper limit of the time gap between two points) in the verilogA module.
But the actual step can still be lesser than the specified bound_step() value depending upon what the simulator needs to solve the equations. Please tell whether I am correct.
Actually, I need to create a Oscillator marcomodel. I want to add noise and other stuff to it. So I stored only one period of the actual ring-oscillator in a file and teh verilogA module uses it to produce the full waveform.
Yes, $bound_step tells the simulator that the next timestep should be no more than the specified delta time from the current timestep. The simulator is free to take shorter timesteps if it needs to though to maintain accuracy.