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