• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. RF Design
  3. Complex-constant multiplier in VerilogA

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 64
  • Views 18038
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Complex-constant multiplier in VerilogA

RFStuff
RFStuff over 11 years ago

 Dear All,

I am doing a PSS+PNOISE simulation of a circuit in Spectre.

I need to multiply the output voltage of certain terminals with Complex Constant ( exp(j*pi/4)=0.707+0.707i).

This I don't want for post-processing ( which can be easily done using Ocean Script).

I want it on the fly of simulation.

Is there any ways of achieving this in VerilogA.

Kind Regards,

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    In general, this is impossible in the simulator. This is a constant phase shift of 45 degrees, and that would be non-causal in the time domain.

    It could be done in frequency domain analyses only (e.g. ac and hb, including PSS in hb mode), but not by using Verilog-A. Verilog-A cannot be written in the frequency domain - you'd have to translate it into the time domain, and since there is no time domain representation of such behaviour (except maybe over a narrow band), it can't be done that way.

    The way I would do this is to create an s-parameter file representing the complex transfer function, and then use nport with this. Be aware though that simulating it in time domain analyses would either fail or give bad answers, as it is not possible in real life. When creating the s-parameter file, you should make sure there is a dc point which doesn't have a complex transfer function (as that's not possible) to ensure the DC behaviour is correct and it can find an operating point.

    There is an internal implementation of a phaseShift for SpectreRF use (in frequency domain analyses), but it's not really in a state that I'd want to post it on the forum.

    Why can't you do this in the post-processing tool? That works fine - simply multiple your signal by complex(sqrt(2) sqrt(2)) in the calculator.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RFStuff
    RFStuff over 11 years ago

     Dear Andrew,

    In the earlier post you have mtioned regarding  phaseShift for SpectreRF.

    Is it now in  a state to be used by users like us in PAC & PNOISE analysis.

    Kind Regards,

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    I'm not sure I'd want to post it on the forums - you should contact customer support since we would need to check if R&D are happy to release it to selected customers so that they can give us feedback on how appropriate it is in real life situations.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • J S Mason
    J S Mason over 9 years ago

     If you run an ac analysis on a system containing verilogA blocks and use the calculator to implement a multiplier function, is there any way to extract the dc component on the 'multiplier' output? In my example the multiplier inputs have no dc component but the multiplier output will have a dc component. I have simply done a real(VF("/in1")*VF("/in2")) and although I have a result, it does not look correct to me and am wondering about how to fully specify the complex nature of the signals in the calculation.

    Regards, James

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Hi James,

    An AC analysis won't give you the DC component as it is a small-signal analysis and there's no DC component at all. It's doing a small-signal linearisation around the DC operating point, and so the complex values you are getting are representing the magnitude and phase of the signals.

    You could get the DC component from the dcOp, but to be honest if you're really trying to implement a multiplier, you probably should be using a PSS or HB analysis (maybe with PAC/HBAC afterwards - not 100% sure what your objective is) as this will take into account the frequency translation and non-linear effects that cause the frequency translation.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • J S Mason
    J S Mason over 9 years ago

    Hi Andrew,

     I am using the ac simulation just to work with ac values so as you say there are no dc components involved. The outputs are two sinusoidal waveforms, one having a phase shift relative to the other, when you multiply these together then there will be a dc component  in additional to the ac component.

    Using the calculator to do the multiplication should allow this fixed component to measured if the multiplication was actually being done on the two ac inputs as complex variables, eg you were multiplying together Asin(wt) and Bsin(wt-theta) where these represent the multiplier inputs in1 and in2. In the calculator I am doing the multiplication on the signal by using VF("/in1")*VF("/in2") and I am wondering whether this takes into account the complex nature of the two signals fully. 

     In one of your previous appends you mentioned a complex function and I wondered whether I should be referencing the output signals of the simulation ( in1 and in2 ) in a different way to get a correct multiplication of these complex variables. If this was happening correctly then I think just taking the real component of the output should provide this dc component.

    Thanks, James

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Hi James,

    VF() will return the complex waveform versus frequency, and multiplying two complex waveforms together will indeed do a complex multiplication. You can always send the real and imag parts to a table for the input and output waveforms and check the results yourself.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • J S Mason
    J S Mason over 9 years ago

    Hi Andrew,

     Thanks and I can confirm that it does work, I have tried a real operation on the multiplied VF() waveforms for a simplified testcase and it does return the expected d.c component.

    James

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information