OSC_RelaxOSC2O : A relaxation oscillator with dual outputs
A relaxation oscillator generates a periodic clock output by integrating a signal to a given threshold. When the integrated value reaches the threshold, the value is reset to zero and the integration starts again.
This relaxation oscillator model generates two complementary clock outputs out and outb by employing a pair of integrators that alternate between the integrate and reset operations. That is, when one is integrating, the other is resetting, and vice versa. The integ_rst primitive models the integrate and reset operation. The input freq sets the rate of the integration and hence the output clock frequency. Since the slice primitives and SR latch add extra delays, the output clock frequency can be slightly lower than the value of the input freq.
Input/Output Terminals
| Name | I/O | Type | Description |
| out | output | xbit | clock output (pos) |
| outb | output | xbit | clock output (neg) |
| freq | input | xreal | frequency input |
List of Children Cells
| BLK_SRLatch : A set-reset (SR) latch |
List of Testbenches
| tb_check : A testbench for checking the basic operation of a relaxation oscillator |
| tb_meas_tfdc : A testbench for measuring the input-to-frequency characteristic of an oscillator |
tb_check : A testbench for checking the basic operation of a relaxation oscillator
This testbench checks the basic functionality of a relaxation oscillator by supply a constant freq input and observing the internal signal waveforms alternating between the integration and reset operations.
`include "xmodel.h" module tb_check (); xreal freq; xbit out, outb; dc_gen #(.value(1e9)) I0 (freq); OSC_RelaxOSC2O DUT (.*); // waveform recording initial begin $xmodel_dumpfile(); $xmodel_dumpvars(); end endmodule
Simulation Results
Figure. input and output waveforms.
tb_meas_tfdc : A testbench for measuring the input-to-frequency characteristic of an oscillator
This testbench measures the input-to-frequency characteristic of an oscillator by applying a gradually-varying input and measuring the frequency of the output clocks.
The measured frequency is expected to be equal to the input level.
`include "xmodel.h" module tb_meas_tfdc(); xreal freq; // frequency input xbit out, outb; // clock outputs // stimuli pwl_gen #(.data('{0.0, 0.8e9, 100e-9, 1.2e9})) freq_gen(freq); // DUT (device-under-test) OSC_RelaxOSC2O DUT(.*); // measurements probe_freq probe_out(out); probe_freq probe_outb(outb); initial begin $xmodel_dumpfile(); $xmodel_dumpvars(); end endmodule
Simulation Results
Figure. the input-to-frequency characteristic of the oscillator.