Complex numbers in Cadence Spectre

Discussion in 'Cadence' started by aspwy, Aug 4, 2009.

  1. aspwy

    aspwy Guest

    Hi all,

    is anyone aware about any workaround how to work with complex numbers
    in Cadence Spectre? How about separating real and imaginary part of
    complex number (e.g. during AC analysis)?

    Any help is appreciated.

    Kind regards,
    A.W.
     
    aspwy, Aug 4, 2009
    #1
  2. aspwy

    Sylvain Guest

    Hello,
    Isnt it available in calculator ?
    Isnt it imag(z) and real(z) to separate imaginary from real part of a
    complex number ??


    Sylvain
     
    Sylvain, Aug 4, 2009
    #2
  3. aspwy

    Riad KACED Guest

    Hi,

    Yes, they are imag() and real().
    these functions respectively return the imaginary and the real parts
    of their argument. The argument may be a waveform, a vector object or
    a complex number.
    Please look at the Cadence's OCEAN Reference manual for more
    information. Use cdsdoc/cdnshelp. It is also available from your MMSIM
    stream.

    Cheers,
    Riad.
     
    Riad KACED, Aug 4, 2009
    #3
  4. aspwy

    aspwy Guest

    Riad, Sylvain,

    thanks for replying!

    I would like to access the complex number arithmetic for behavioral
    modeling purposes (i.e. not after the simulation, but during the
    simulation).

    Kind regards,
    aspwy
     
    aspwy, Aug 5, 2009
    #4
  5. aspwy

    Riad KACED Guest

    Hi aspwy ,

    It looks like you want to deal with complex numbers in verilog-A,
    aren't you. Well I’m afraid verilog-A does not handle any complex
    arithmetic. verilog-A is HDL language and is not meant for this
    anyway. All numbers in verilog-A are either integer or real. This
    makes it hard to deal with frequency domain signals as they are
    complex numbers. Having said that, you can write your own function
    that deals with complex numbers as a pair of real numbers: real part
    and imaginary part. But don’t reinvent the wheel, there is already a
    solution available from cadence’s sourceLink. Just ask your favourite
    Cadence AE for Solution # 11237228.

    Cheers,
    Riad.
     
    Riad KACED, Aug 5, 2009
    #5
  6. aspwy

    aspwy Guest

    Riad,

    thanks for your reply!

    Yes, you seem to be a mind reader, I would love to deal with complex
    numbers in Verilog A :). I know that is impossible, so I am trying to
    make workaround; to make some sort of Spectre complex number interface
    for Verilog A. It would be great if I could split real and imaginary
    parts of complex voltage/current during AC analysis and "feed" it to
    Verilog A code. Unfortunately, its seems that Spectre does not support
    complex number arithmetic.
    Thanks for this, I really do appreciate any help, but this really does
    not solve any problems. IF, and only IF you define complex number
    INSIDE the Verilog A code as its real part ReX and imaginary part ImX
    than you could calculate magnitude as sqrt(ReX^2+ImX^2) and that is
    all that you can do with that solution. In AC analysis, you cant
    access real and imaginary part of your input signal, neither you can
    output an complex number, so its a bummer.

    Thanks,
    aspwy
     
    aspwy, Aug 5, 2009
    #6
  7. aspwy

    aspwy Guest

    Thinking of it, all I really need is a way to split real and imaginary
    part of signal during AC analysis. I could then rewrite code to handle
    such split "complex" number.

    Kind regards,
    aswpy
     
    aspwy, Aug 5, 2009
    #7
  8. aspwy

    Mobil Guest

    I think it's better to follow Riad suggestion which creates two
    separate parts of real and imaginary signal. You can use component of
    'multiplier' in 'ahdlLib' library to compile them. It looks like you
    deal with the problem like the mixer. There is an example in
    'rfExamples'->'EF_example' about setup a schematic of a transmitter
    circuit (but it may be too complicated here since envelop simulation
    is used in that circuit).
     
    Mobil, Aug 6, 2009
    #8
  9. aspwy

    aspwy Guest

    Mobil,

    thanks for your reply and suggestions.

    Using and doing math with separate parts of real and imaginary signal
    is not a problem. The problem is how to split AC signal into its real
    and imaginary part during AC analysis. Due to the other parts of the
    system, I can't use Riad's solution and define every complex number as
    its real and imaginary part.

    Thanks,
    aspwy
     
    aspwy, Aug 6, 2009
    #9
  10. The difficulty is that the philosophy of VerilogA is that you describe models in
    the time domain, as you can always get to the frequency domain. Vice versa is
    not generally possible (you can end up with causality problems).

    If you're dealing with frequency domain, it should be possible to create
    s-parameter files (using nport) to filter the real and imaginary parts (I think
    - I've not tried). Would need a bit of thought though.

    You'd have to ensure you only ever simulated in the frequency domain though -
    trying to do a time domain simulation with such a component in place would
    almost certainly have convergence problems!

    Regards,

    Andrew.
     
    Andrew Beckett, Aug 16, 2009
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.