Complex numbers in Cadence Spectre

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.
 
On 4 aoűt, 09:14, as...@yahoo.com wrote:
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.
Hello,
Isnt it available in calculator ?
Isnt it imag(z) and real(z) to separate imaginary from real part of a
complex number ??


Sylvain
 
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, 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

On Aug 4, 8:12 pm, Riad KACED <riad.ka...@gmail.com> wrote:
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.
 
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,

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.

Cadence AE for Solution # 11237228.
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

On Aug 5, 1:27 pm, Riad KACED <riad.ka...@gmail.com> wrote:
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.
 
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

On Aug 5, 2:20 pm, as...@yahoo.com wrote:
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.

Cadence AE for Solution # 11237228.

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

On Aug 5, 1:27 pm, Riad KACED <riad.ka...@gmail.com> wrote:

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.
 
On Aug 5, 10:34 pm, as...@yahoo.com wrote:
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

On Aug 5, 2:20 pm, as...@yahoo.com wrote:

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.

Cadence AE for Solution # 11237228.

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

On Aug 5, 1:27 pm, Riad KACED <riad.ka...@gmail.com> wrote:

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.
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,

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

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).
 
aspwy@yahoo.com wrote, on 08/06/09 10:58:
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

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).
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.
 

Welcome to EDABoard.com

Sponsor

Back
Top