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.

Ideal Sampler in Cadence

Status
Not open for further replies.

terryssw

Full Member level 3
Joined
Apr 18, 2004
Messages
176
Helped
20
Reputation
40
Reaction score
6
Trophy points
1,298
Activity points
2,312
fstrobe example

I want to simulate a Switched-Capacitor circuits and I only want the samples at the end of one of the two clock phases. Do someone know the method to build an ideal discrete sampler in Cadence? (Not Sample-and-Hold, Since I don't want the sin(x)/x coloring effect, I want an discrete point sampler)

Or in other ways, I want to directly evaluate the output spectrum in Cadence. If I plot the transient waveform of SC-circuit and then use fft function, it will output the spectrum with sin(x)/x coloring effect. Is it possible to remove such effects? Thanks to all in advance!
 

cadence transient spectrum

Hi,
I think you can use the verilog-A sampler provided by Kundert on is site:
**broken link removed**
It take the value of the signal and write it in a file. Therefore you have a discrete stream and can perform FFT analisys using matlab(or octave, or excel...). I think the Sinc effect doesn't appear in that case.
Hope it helps.
 

fstrobe

Thanks for your information. Actually I have already have a look on the documentation on that website, It is a ideal Sample and Hold model and the output does have Sinc coloring effects. Do you have other ideas?
 

pss frequency resolution

Are we refering to the same model?
There are indeed two SH models (one for SpectreRF), which are in fact a switch and a capacitor. They are called 'Ideal sample and holds' (in 'Functional Models') and 'Periodic track and hold' (in 'RF Models'). Those introduce the Sinc spec, because there is an hold time. I was refering to the 'Periodic sampler' (in 'Functional Models'), which is not an electrical model, but take the voltage value and save it in a file. Therefore, we don't have the hold time. I used it before, and I didn't have the Sinc.
In case we were refering to the same model, I'm sorry to say that I have no other idea.
Regards.
 

spectrerf ideal sample and hold sh

Is it really? Could you tell me how can I use this in Spectre? This is just a Verlog-A lanugage, how can I use it as Schematic Instances?

Also I want to simulate a PSS analysis using this model. Do it have hidden-state problems?
 

track and hold verilog a model

For using the Sampler, download the Verilog-A (spectre compliant version). Create a new cell-view, and select "VerilogA Editor" as a tool (instead os Schematic Composer). Your text editor should open, and you just need to copy the content of the model inside. You might want to change the output format, file name, so I think in that case the best is to refer to the Verilog-A documentation. When you exit the text editor, Cadence will ask you if you want to create a symbol view. Say yes, and it will generate the pin from the module parameters. Then you can use it in you schematics.
As for using it with a pss, I'm not sure. I would say there is no hidden state, so you could do it. However, I'm not sure there is a merit using it in a pss. As far as I understand, pss do a short transient, then some math. So using this model, you will have only a few points. I recommend you'd do a transient analisys do get enough points to do the FFT (2^12 to 2^14 give nice results).

Another thing, the default model has a differential input. Personnaly I used a modified version. I copied it here.
Regards.

---------------------
// VerilogA for global, outSampler, veriloga

`include "constants.h"
`include "discipline.h"

module outSampler(clk, in0);
input clk, in0;
electrical clk, in0;

parameter integer log_time=1;
parameter real vtrans_clk = 1;
parameter integer dir = -1 from [-1:1];

integer fileID;
integer count;

analog begin
@(initial_step) begin
fileID = $fopen( "~/%C:t:r_%I.dat" );
$fstrobe(fileID,"# Generated by Spectre from instance `%M'");
$fstrobe(fileID,"# name: sigout");
$fstrobe(fileID,"# type: matrix");
$fstrobe(fileID,"# rows: ");
if (log_time == 1 )
$fstrobe(fileID,"# columns: 3");
else
$fstrobe(fileID,"# columns: 2");
count = 0;
end

@( final_step)
$fclose(fileID);

@ ( cross(V(clk) - vtrans_clk, dir, 1.0, clk.potential.abstol)) begin
if (log_time == 1 ) begin
$fstrobe(fileID,
"%d\t%-.10g\t%-.10g\t",
count,$abstime,V(in0));
end else begin
$fstrobe(fileID,
"%d\t%-.10g\t",
count,V(in0));
end
count = count + 1;
end

end

endmodule
 

    terryssw

    Points: 2
    Helpful Answer Positive Rating
veriloga fopen designer guide

Thanks for your replys, and it works well!

As a thanks to you, the following is some informations about PSS and QPSS:
In normal FFT simulation one would need to simulate long cycles to get enough points to resolved the resolution in obtaining FFT. This is especially costly simulations when you want to resolved very fined frequency (those in very-narrow band systems such as sigma-delta modulators), in which normally at least 10 (normally 20 cycles) of the lowest frequency components is required. However if you use PSS or QPSS, The simulator found its steady-state solution directly, and now all the spectral power are concentrated only on fundamental frequency and its harmonics (thus you don't have any leakage, and you have only one bin at the fundamental frequency). Usually PSS simulation can take 3-4 iteration such that its converges, and this equivalent to you have a transient simulation of 3-4 cycles. In narrow-band simulation this would save you much more time. However, if you want a niceful pictures of spectrum (i.e contain some noise floor of FFT), you still have to do transient simulation.
 

cadence transient

I came to this old post from a link in the other post.

In the last post of terryssw I did not understand the ideas about PSS & delta-sigma modulators. As far as I understand, SDM's output is not a periodic sequence, so PSS can not be used for getting output spectra.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top