The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 8th, 2021, 4:09pm
1  Simulators / Circuit Simulators / Is it possible to view the source code of a SpectreRF function?
 on: Apr 30th, 2021, 3:32am 
Started by StevenH | Post by StevenH
There is a function in SpectreRF called "pn", it takes as an argument the results of a noise analysis and outputs the phase noise data at a given frequency (for example, pn('hbnoise)).


Is it possible to view the SKILL source code of this function to see how it's implemented? I'm more interested in the formula/convention that's used to define the phase noise (measured in dBc/Hz) rather than the code itself.

Say I do a PM noise analysis, and let's call the phase modulation magnitude spectrum outputted A in (V/sqrt(Hz)). Which mathematical formula does pn apply on A? Is it 10log(A^2/power(harmonic(1))? or 10log(A^2/harmonic(1)^2)? or is it something else?

2  Design / Analog Design / Capacitive DAC Unit Cell Size in ADC
 on: Apr 27th, 2021, 11:06pm 
Started by niloun | Post by niloun
Hi everyone,

When we want to calculate ADCs sampling capacitor size we choose C such that thermal noise level is less (or equal) than quantization noise

KT/C<Δ2/12

Which leads to

C>12KT◊22b/VFS2

My question is that if "C" here is the total capacitance of the capacitor array or unit cell capacitor? and why?

For example if in the case of an eight bit ADC we find C>20fF from C>12KT◊22b/VFS2
should we divide 20fF by 28 to find the minimum unit cell size or C is the minimum unit cell size itself?

3  Simulators / Circuit Simulators / What does USB mean in a Pnoise analysis?
 on: Apr 26th, 2021, 1:13pm 
Started by StevenH | Post by StevenH
Under the timeaveragge option, in a Pnoise analysis, there are four suboptions: USB, PM, AM, ALL (PM, AM, USB, LSB).

I understand that USB stands for Upper Side Band, but in the context of a Pnoise analysis, what does it mean?

If I run a PSS analysis first with fundamental frequency f0, would an USB mean that only the contributions from the upper harmonics (f0, 2f0, 3f0,...) are taken into account during the Pnoise analysis?


4  Simulators / RF Simulators / Re: Concerning the Noise Figure as measured in a HB analysis in SpectreRF.
 on: Apr 24th, 2021, 12:14pm 
Started by StevenH | Post by StevenH
Anyone please? I could really use some guidance. (This is for a project in my college).

5  Simulators / Circuit Simulators / Re: Plot an oscillator output spectrum
 on: Apr 22nd, 2021, 7:54pm 
Started by polyam | Post by Ken Kundert
You have two choices, you can perform an FFT after the simulation, in which case the FFT will not be synchronous with the oscillation. In this case the period of the FFT will not match that of the oscillator. You can reduce the artifacts of the period mismatch by simulating many cycles while applying windowing.

Or, you can use SpectreRF.  It computes the periodic steady state analysis, and so it directly computes the period.  It can compute the spectrum without the artifacts.

-Ken

6  Simulators / Circuit Simulators / Plot an oscillator output spectrum
 on: Apr 22nd, 2021, 5:36pm 
Started by polyam | Post by polyam
Hi,

I have an oscillator running at fosc. My question is how to plot the spectrum of the time domain output of the oscillator. What I am specifically looking for is the relation between the simulation time (time domain data record), the number of FFT points, and fosc to correctly plot the spectrum. †Does the Coherent Sampling of a periodic waveform apply here? if so, how?

Thanks

7  Simulators / RF Simulators / Concerning the Noise Figure as measured in a HB analysis in SpectreRF.
 on: Apr 21st, 2021, 9:09am 
Started by StevenH | Post by StevenH
Greetings members,

I have a question concerning the Noise Figure computed by SpectreRF in a HBnoise analysis.

For the Noise Figure (NF), there is an option called "Integrated Over Bandwidth" in the form bellow (After I ran an HBnoise analysis on an LNA).

We know that

NF = 10log( Noise Factor ) †......(1)

And, per my understanding, SpectreRF computes the Noise Factor as

Noise Factor = (Noise Power Spectrum at output port - Noise Power Spectrum generated by resistance of output port) / (Noise Power Spectrum at output port due to input port resistance specified over an input frequency range) ......(2)


So my question is, does the "Integrated Over Bandwidth" option integrate the numerator and denominator of (2) over the output frequency range and then apply (1)? Or is it the average value of (1) over the output frequency range?


The documentation wasn't much of a help, it says,

"If the noise figure over a bandwidth is desired, select Integrated Over Bandwidth, and specify the frequency range you desire for the measurement." †

Any input would be more than welcome!

8  Modeling / Behavioral Models / Machine-Learning-based-Behavioral Modelling
 on: Apr 19th, 2021, 6:33am 
Started by rhanna | Post by rhanna
Hello,

I need your help in debugging/tips to debug a Verilog-A module that I created based on the training of a Recurrent Neural Network (RNN).

The model is supposed to solve the non-linear differential system of equations coming from the RNN representation.

I will summarize everything in steps so that it will be easier to discuss it afterward.

1. I created a testbench for a chain of inverters and got the data (Vin,Iout) in .csv format after interpolation to a timestep=1e-9 s.

Attached testbench: https://drive.google.com/file/d/1n5uyi9_nTurEUgIai_yb0RWwVqGcYBIx/view?usp=shari...
and sample of Iout: https://drive.google.com/file/d/1APHkSRnFl5gxAFEDcvrW81Ygpvv7yMO5/view?usp=shari...
and training_data.csv: https://drive.google.com/file/d/1iKuxfxAz4b-mrt8UOs0gPqNqQfSwCnre/view?usp=shari...

2.Train/test datasets are pre-processed (scaled/normalized/standardized ...) to fit the RNN model used.
After tuning model parameters, itís tested against unseen stimuli.

Attached learning curves: https://drive.google.com/file/d/1iF3D_tp4-F8p6B3sVirlBFtKVEoFMdUk/view?usp=shari...
RNN prediction: https://drive.google.com/file/d/1ufzQZsS19DvamE_oCMx9N6YZoM43tYTD/view?usp=shari...
and parameters matrices: https://drive.google.com/file/d/1eXxqaCrzyDqMTLY8N0_7Mp8-7QM1GkNP/view?usp=shari...

3. The parameter arrays are flattened to be used as 1-D vectors in the Verilog-A module (since multi-D is not allowed in Verilog-A)

Below, you will find a listing of my code which is basically using Spectre to solve the continuous non-linear system of equations of the RNN model.

code: https://drive.google.com/file/d/1zbWbgu4UApWolGYfJDxRuryDGtLgmFV1/view?usp=shari...

*** attached summary for the equations and the equivalent circuit of the model.

https://drive.google.com/file/d/1oHXT9a7a_cxw1xfquPQ-Aiv-q2njpI7E/view?usp=shari...

4. results after compiling and running the simulation look like that:

https://drive.google.com/file/d/1wm4wRaL_BK_j0iIwpdDx5-WbwmspQ7h4/view?usp=shari...

which is not really good! I changed alpha to consider different simulation steps but this is the best result.

Sorry for the long post and the many links and thanks in advance to your time.

9  Modeling / Behavioral Models / Machine-Learning-based-Behavioral Modelling
 on: Apr 19th, 2021, 6:30am 
Started by rhanna | Post by rhanna
Hello,

I need your help in debugging/tips to debug a Verilog-A module that I created based on the training of a Recurrent Neural Network (RNN).

The model is supposed to solve the non-linear differential system of equations coming from the RNN representation.

I will summarize everything in steps so that it will be easier to discuss it afterward.

1. I created a testbench for a chain of inverters and got the data (Vin,Iout) in .csv format after interpolation to a timestep=1e-9 s.

Attached testbench: https://drive.google.com/file/d/1n5uyi9_nTurEUgIai_yb0RWwVqGcYBIx/view?usp=shari...
and sample of Iout: https://drive.google.com/file/d/1APHkSRnFl5gxAFEDcvrW81Ygpvv7yMO5/view?usp=shari...
and training_data.csv: https://drive.google.com/file/d/1iKuxfxAz4b-mrt8UOs0gPqNqQfSwCnre/view?usp=shari...

2.Train/test datasets are pre-processed (scaled/normalized/standardized ...) to fit the RNN model used.
After tuning model parameters, itís tested against unseen stimuli.

Attached learning curves: https://drive.google.com/file/d/1iF3D_tp4-F8p6B3sVirlBFtKVEoFMdUk/view?usp=shari...
RNN prediction: https://drive.google.com/file/d/1ufzQZsS19DvamE_oCMx9N6YZoM43tYTD/view?usp=shari...
and parameters matrices: https://drive.google.com/file/d/1eXxqaCrzyDqMTLY8N0_7Mp8-7QM1GkNP/view?usp=shari...

3. The parameter arrays are flattened to be used as 1-D vectors in the Verilog-A module (since multi-D is not allowed in Verilog-A)

Below, you will find a listing of my code which is basically using Spectre to solve the continuous non-linear system of equations of the RNN model.

[code]////////////////////////////////////////////////////////////////////////////////
////////////////////////////////
///7_inv_verilogA_module
////////////////////////////

`include "constants.vams"
`include "disciplines.vams"

module test_inverter2 ( Iout, Vin );

//port declaration
input Vin;
output Iout;
electrical Vin, Iout;

//hidden nodes declaration, 2-layer RNN: 1st layer has 3 neurons and 2nd layer has 5 neurons, the temporary nodes used to assign voltage derivatives into it (since itís not allowed to use ddt() inside a function like tanh()) †
parameter integer n1=3; † † † † † † †//n1= hidden layer1 size
parameter integer n2=5; † † † † † † †//n2= hidden layer2 size
electrical [0:n1-1] x1_node; † † † † //hidden nodes
electrical [0:n2-1] x2_node;
electrical [0:n1-1] d1; † † † † † † † † † †//temporary nodes
electrical [0:n2-1] d2; † † † † † † † † † †//temporary nodes
electrical c; † † † † † † † † † † † † † † † † † † † //temporary node

//parameters declaration
parameter real h=1e-9; † † † † † † † † † † † † † † † † † † † † † † † //RNN fixed time step (the one I used for interpolation in the beginning)
parameter real alpha=0.1; † † † † † † † † † † † † † † † † † † † † //a parameter used to control simulation time
parameter real Iout_max=1e-3*1.9939; † † † † † † † †//from SPICE simulation: to transform normalized values to real (mA) values
parameter real Iout_min=1e-3*-2.6195; † † † † † † † † //from SPICE simulation

parameter real w_Vin [0:n1-1]='{0.10170481, †1.1620824 , †1.7734492}; † † † † † † † † //input-to-hidden_layer1 weights
parameter real w_rec1 [0:8]= '{0.10170481, -0.40005976, †0.14853652, 1.1620824 , -0.06963143, †0.05867661, 1.7734492 , †0.31620947, †0.5098805}; † † † † † † † † † † † † † †//hidden_layer1 weights
parameter real b_rec1 [0:n1-1]='{-0.50272906, -0.05936602, -0.46315792}; † † † † † † † †//hidden_layer1 bias

parameter real w_rec1_rec2 [0:14]='{-0.67627287, -0.04143657, -1.079608, 0.87122226, †1.3332181 , †0.8582899, 2.5318332 , †1.631965 †, †4.0227246, -0.09900661, †0.00793644, †0.06182678, -0.3101116 , †0.8634078 , -0.19305223}; † † †//hidden_layer1-to-hidden_layer2 weights
parameter real w_rec2 [0:24]= '{1.1629704 , -0.97594476, †0.78621966, †0.11768469, †0.6982709, -0.55858546, -0.84081393, -0.18030712, -0.6326557 , -0.09535989, 0.74122816, †0.4803622 , †1.3021479 , -0.5180566 , †0.01114371, 0.11297118, †0.00577774, †0.18186042, †1.215576 †, -0.34975305, 0.79326946, -0.22687317, -0.12298498, †0.72878057, -0.54428524}; † † //hidden_layer2 weights
parameter real b_rec2 [0:n2-1]='{-1.2327499 , †0.24767102, †0.01692279, -0.07469982, -0.39443454}; † † † † † † † † † †//hidden_layer2 bias
parameter real w_Iout [0:n2-1]='{0.0646118 , †0.08837312, -0.3694181 , †0.6734518 , -0.80057806}; † † † † † † † † † † //hidden_layer2-to-output weights
parameter real b_Iout=0.12989566; † † † † † † † † † † † //output bias

genvar †i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13; † † † † † † † † † † † †//loop iterators
real mul_Vin_w_Vin, mul_c_w_Vin, y, Iout_norm; † † † † † † † † † † † † † †//products of matrices multiplication (for example: mul_Vin_w_Vin : is input voltage * input-to-hidden_layer1 weights)
real mul_x1_node_w_rec1 [0:n1-1];
real mul_x2_node_w_rec2 [0:n2-1];
real mul_x1_node_w_rec1_w_rec2 [0:n2-1];

//the analog process
† † † † † † † analog begin

† † † † † † † † † † † † † † †$strobe("****************************new time step ******************************");
† † † † † † † † † † † † † † †//$debug("****************************new iteration******************************");
† † † † † † † † † † † † † † † † † † † † † †
† † † † † † † † † † † † † † †//1. intialize local variables
† † † † † † † † † † † † † † †mul_Vin_w_Vin= 0;
† † † † † † † † † † † † † † †mul_c_w_Vin= 0;
† † † † † † † † † † † † † † †y=0;
† † † † † † † † † † † † † † †Iout_norm=0;

† † † †

10  Design / RF Design / Re: N-Path Mixer NF
 on: Apr 14th, 2021, 5:26pm 
Started by strawberries52 | Post by Ken Kundert
Ignore the term 'beat frequency'.  This was a misnomer that was put into ADE from the very first days of SpectreRF and was never fixed.  The proper term is 'fundamental frequency'.

In your case the fundamental frequency is the LO frequency (2.485 GHz).

The PNoise choose analysis form helpfully indicates that the refsideband can be computed with: |Fin| = |Fout + refsideband*Ffund|.  I think this formula should not have absolute value bars.  In that case, Fin = 2.485 GHz, Fout = 0 Hz, and Ffund = 2.485 GHz, so refsideband would be 1.  This makes sense because the refsideband is the LO harmonic that the input signal is mixing with to produce the output signal.

-Ken

Copyright 2002-2021 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.