The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> Spectre PWLF sources
https://designers-guide.org/forum/YaBB.pl?num=1127843168

Message started by Jess Chen on Sep 27th, 2005, 10:46am

Title: Spectre PWLF sources
Post by Jess Chen on Sep 27th, 2005, 10:46am

I need to drive a transmitter chain with stored data.  Spectre's PWLF sources would do the job nicely except that they connect the data points with straight lines. The straight line filter is a first order hold. The real source is a DAC, which is only a zero order hold. The extra filtering introduced by the PWLF source gives me an optimistic output spectrum.  Does anyone know how to change the PWLF to a zero order hold instead of a first order hold?  


Title: Re: Spectre PWLF sources
Post by Ken Kundert on Sep 27th, 2005, 2:12pm

Follow the PWL source with a Verilog-A sample-and-hold model.

-Ken

Title: Re: Spectre PWLF sources
Post by Jess Chen on Sep 27th, 2005, 2:51pm

I was hoping to avoid an extra VerilogA block. Also, it seems that for convergence I must add a small delay to the VerilogA ZOH. The small delay introduces a small error in the sample. I can make the delay small enough to make the error negligible. I just wanted to make sure I was not missing something in the pwlf source.

There are other applications for the ZOH pwlf source. Sometimes the data in the file is not uniformly sampled in time.  For example, if I could not afford AMS and my system had no digital feedback, I might use Verilog to generate a file containing a set of digital control signals and then try to import those control signals into my analog simulation using the pwlf sources. In that case, the data is not necessarily clocked uniformly. I am sure I code up some sort of trigger in VerilogA to sample the data from the pwlf source but it would be so much easier if the pwlf source had an option that simply held each sample until the next one came along.

Title: Re: Spectre PWLF sources
Post by Andrew Beckett on Sep 27th, 2005, 10:40pm

Jess,

How about using a zvcvs? Of course, then you've got a hidden state problem if you're using any RF analyses, but it was a thought...

Andrew.

Title: Re: Spectre PWLF sources
Post by Jess Chen on Sep 28th, 2005, 10:12am

Thanks for the suggestions guys.

The zvcvs is also uniformly sampled. I have used this to create a sample-and-hold before but I don't remember if I had to introduce the small delay to avoid convergence errors.  You raise a good point about SpectreRF. One important application of the zoh pwlf is to drive a device level transmitter model and simulate with envelope following to assess spectral mask. The z-domain approach would not work and the veriloga solution would have implement the sample and hold with switches and capacitors or a resettable integrator. I still think this is a less-than-optimal solution because it seems like such a simple thing to fix at the source.

I filed a service request with Cadence to see if they had any ideas. They suggested duplicating each data point with a slight delay to create the same effect as a ZOH. This approach shifts the work onto the program that generated the data file but it is compatible with SpectreRF. I still think it would be so much cleaner to enhance the pwlf but I fully understand the balance of priorities and resources.

I checked the spectre -h zvcvs response and saw that there is a "sxz" feature that automatically transforms s-domain filters into a equivalent z-domain filters.  This is cool and I don't remember seeing it before. Is it new?

Title: Re: Spectre PWLF sources
Post by Andrew Beckett on Sep 28th, 2005, 1:25pm

Hi Jess,

I think this would be a useful option on the source. I'll encourage a PCR to be filed. I had an enhancement fairly recently to add a new parameter "edgetype" which means that each transition - primarily for pulse sources, but it works for PWL source too - is represented as a half-sine wave - to make the transition smooth... although with PWL sources that is really just for pulse trains. Perhaps we could another value for edgetype to indicate that each transition should be stepped - although you'd have to specify the rise/fall time (perhaps via the rise and fall parameters, since they exist?). Anyway, I'll locate your SR tomorrow morning.

As for the sxz parameter, that's been there since at least 4.3.4 - so more than 10 years (I checked in 4.3.4; the earliest version I have installed which still runs on the hardware/OS that I have which still works...). I'd not noticed it either!

Regards,

Andrew.

Title: Re: Spectre PWLF sources
Post by Ken Kundert on Sep 28th, 2005, 3:40pm

An alternative would be to generate the entire waveform in Verilog-A. You could then use the transition function to get the behavior you need.

-Ken

Title: Re: Spectre PWLF sources
Post by Jess Chen on Sep 28th, 2005, 5:53pm

Ken,

Generating the waveforms completely with VerilogA would work with some simple cases but in others, it defeats the purpose of the simulation. For example, we might want to simulate the power up sequence by applying the commands directly from the Verilog simulation to the analog circuits. Generating the commands within VerilogA would only test the VerilogA code, not the code the will be taped out. Furthermore, if the simulation involves SpectreRF, it would be next to impossible to generate the command sequence without using hidden states. Assigning a capacitor for each state might work but it would be incredibly cumbersome. Also, the SpectreRF (i.e. envelope following) example is a case where not even AMS would help because AMS does not support SpectreRF. If SpectreRF is involved, I think the pwlf approach may be the only practical solution.

-Jess

Title: Re: Spectre PWLF sources
Post by Ken Kundert on Sep 28th, 2005, 10:30pm

Are you aware of the use of the (* instrument_module *) attribute? Placing it in front of a module defintion instructs SpectreRF to treat the module as a test bench module, which has loosen hidden state constraints. I have gotten envelope to work with some very sophisticated sources with all kinds of hidden state when using this attribute.

-Ken

Title: Re: Spectre PWLF sources
Post by Jess Chen on Sep 29th, 2005, 8:07am

Ken,

I had heard of the *instrument_module* attribute but I was not sure it was formally released yet.  It is not available in the version of the Cadence software to which I have access. The new feature sounds great. However, if it is possible to solve the hidden state problem, why wouldn't Cadence just solve the problem for all modules? Why force the user to identify different kinds of modules? Is there some advantage to NOT using the *instrument_module* attribute?

-Jess

Title: Re: Spectre PWLF sources
Post by Andrew Beckett on Sep 29th, 2005, 10:12am

Jess,

It's available from IC5141 onwards. You use it by putting


Code:
(* instrument_module *) module myModuleName...


What it does is disable the checks for hidden states - which is fine for a baseband signal source in envelope analysis, and for measurement blocks in envelope analysis - but not if the model is (say) a sample and hold, or divider in a PSS analysis.

In other words, you don't want to disable the check for cases where the hidden state will affect the results. In a signal generator for envelope this wouldn't affect the results.

Similarly it is possible to mark particular variables as not being state variables by using the (*ignore_state*) attribute. For example:


Code:
(*ignore_state*) real myVar;


This might be useful if the variable is just used for (say) informational messages, but does not affect the true circuit state.

Regards,

Andrew.

Title: Re: Spectre PWLF sources
Post by Jess Chen on Sep 29th, 2005, 8:20pm

Thanks Andrew. That clears things up.

-Jess

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.