Tuesday, February 15, 2022

Valentines' Day 2022: AMD Acquires Xilinx

AMD Acquires Xilinx

Valentines' Day 2022 witnessed the completion of AMD's acquisition of Xilinx.
It's also my day one with AMD as a Xilinx employee and I felt a strong urge to write down something to mark this day.
This something certainly can't be a technical topic, then what to write?
Recalled it's an all-stock-no-cash acquisition, I thought it could be fun to dig into this CP's stock market past performances.
One of the stories I heard long time ago is about a guy who made a great fortune and was said planning to woo a young but not very rich lady. However, nobody really saw any moves from him and the rumors eventually died down. Half decades later, the same young lady made a big fortune and became much richer than that guy. She, instead of hesitation, proposed to this guy straight away with a great success!
Fancying about happy fairy tales sharing similar story lines, I pulled the historical market values and daily stock prices of AMD and Xilinx (start with the date when AMD appointed Lisa as CEO to take the helm) from the Internet and plotted them on the same chart. Guess what! the stock prices of both companies bear more similarities than differences! And indeed that the guy is much richer than the lady to begin with. Looking at the historical daily stock price, there is a great correlation with a coefficient of 0.93.
A born couple?! 😍
Anyway, on 14, Feb. 2022, AMD and Xilinx united as one! 💕
Together, we advance! 🚀
Go AMD! 💪




Saturday, January 29, 2022

Transmitter FIR Output Waveform Simulation

Transmitter FIR Output Waveform Simulation
3-tap TX FIR

In this notebook, a step-by-step walk through of a 3-tap TX FIR output waveform generation is done to demonstrate the very basic concepts of TX FIR and its impact to signals going through channels. Useful codes are packed into helper functions to be reused in the future to futher explore automatic channel adaptation schemes such as TX FIR, FFE, RX CTLE and DFE etc.




Saturday, January 1, 2022

From S-parameters to Eye Diagrams

From S-parameters to Eye Diagrams
S-parameter to eye diagram
WishinwalHappyHealthyWealthanProsperouYeao2022!

In this notebook, I briefly walked through a bare minimum serial link simulation procedure and demonstrated each step in python for:

  • Remote site S-parameter file loading, pre-processing and system impulse response(IR) extraction
  • IR to single-bit-response (SBR) conversion (where IR is the general system impulse response of the channel while SBR is the output of the single-bit input after going through the channel which is data-rate dependent)
  • Transient simulation through time domain 1d convolution (pay attention to the numpy and the scipy output differences in function call convolve(a,v,"same") mode)
  • Simple and fancier eye diagram plots

Acknowledgment: rainbow text generation tool provided by Rainbow Text Generator Multi Color Text.




Saturday, November 27, 2021

S-parameter conversion and visualization
S-parameters

It's a common practice for RF, microwave and high speed design engineers to pre-process and validate the scattering parameters (S-parameters) reciprocity, passivity and causality before proceed to use it. This notebook will walk through a sample implementation in python to show a simple way of S-parameter manipulation and plot to provide a quick examination through visual inspection. It will cover the following steps:

  • load a sample 4-port S-parameter file hosted on the Internet (load file through its URL)
  • single-ended S-parameter to mixed-mode conversion
  • Output magnitude in dB for specific measured frequency points of interest
  • Insertion loss plot for report and visual inspection quality check purposes




Saturday, July 17, 2021

PRBS13Q and pre-coded PAM4 test pattern generation

PRBS13Q Include contents generated by interactive python notebook in the Blogger post is more difficult than I had thought. Although there are so many suggested solutions out there on the web, it doesn't really work for me. Whether it's a hacking into the particular post template to include the Javascript, or customization of the CSS to display nbconvert created html simply doesn't apply as my Blogger account doesn't even have that "Template" or "Advanced CSS" feature enabled for some reason. Probably because it's a free version, thus only providing bare minimum capabilities? Anyway, after surfing the net for a while, I came out the following procedure through trial and error as a workaround:
  • Upload the ipynb file to gist and create the link as suggested by some of the proposed solutions.
  • Manual create a simple html file and embed the gist link in-between the <body></body>.
  • Create post in "html" instead of "component" view.
  • Preview and publish.
Here comes my first notebook post: not very satisfied, but readable.

Friday, January 31, 2014

Spectrum Analyzer Based Phase Noise/Jitter Measurement with Golden PLL in Excel


Demo of the GUI
Today is a big day to all Chinese in the world, the Lunar Chinese New Year, and I’d like to wish all a lucky, happy, healthy and wealthy year of horse ahead!
It’s a time for many Chinese to party and eat to the heart’s content with good excuses to avoid feeling guilty and at the same time make the resolution for the whole new year. More than often, we tend to wait for a “proper” time for the real action to follow for reasons such as “busy to clear things on hand first”, “need to wait for a good chunk of time” and in the end, the chances are "the right time" never comes. But sometimes, if we chose to “slot it in” and “start it now”, we could be amazed at how easy it can be done (relative to what we had thought) and how much we can achieve with small steps a time. The excel sheet to be described can do a lot of things for an engineer who are interested in phase noise and/or jitter measurement. More importantly, the concept can be extended and applied to integrate test and measurement automation with automatic report generation (data post processing and visualization) in Excel. However, it get started only as a simple worksheet to calculate the RMS RJ value from the user supplied phase noise data which took less than 5 minutes to create. It is then fairly easily expanded into what it is now with the capabilities to:
  1. Take in phase noise in “frequency-phase noise” data pairs and calculate the RMS RJ value. This is the spectrum analyzer based clock source random jitter measurement method described in FC-MJSQ and can be used to study the characteristics of different kinds of clock sources.
  2. Pass the phase noise data through PLL and calculate the PLL filtered RMS RJ value. It can be used to study the PLL characteristics and its jitter shaping effect on clock sources.
  3. Pass the phase noise data through PLL first and then a golden PLL. It can be used for transmitter compliance test.
  4. One-button click to perform phase noise measurement from the clock source directly if spectrum analyzer is connected to the host PC through GPIB. This will automate the phase noise raw data acquisition into the Excel instead of manually cut/paste.
  5. One-button click to perform screen capture of the spectrum analyzer for documentation and reporting purposes.
Here is the step-by-step guide on how to make this Excel sheet:

To achieve capability 1:
Cut/paste or import from text-based files such as “*.txt” or “*.csv” for the raw phase noise data into the Excel sheet column A and B and key in the trapezoidal integration equation in column C (start from C3) as shown in Figure 2. You can drag the equation that is filled into C3 all the way down to fill in the column C with the same equation.
Figure 2: trapezoidal integration equation
The summation of column C is the SSB noise power and the RMS phase noise Phi (in unit of radius) is the square root of twice the SSB power, in Excel, Phi = SQRT(2*SUM(C:C)).

To achieve capability 2:
You can calculate the transfer function of your PLL and put the data into column D in dB, the phase noise output through the PLL is simply the addition of raw phase noise and the PLL transfer function in dB and is presented in column E as shown in Figure 3. As an example, the second order PLL transfer function for PCIe described in [1] is used with a 3dB loop bandwidth of 15MHz and a damping factor of 0.54.

Figure 3: TX PLL transfer function
The trapezoidal integration equation is used in column F to calculate the SSB noise power after the raw data goes through the PCIe PLL.
Figure 4: SSB noise power at the TX PLL output

To achieve capability 3:
Use the same method and integration equation as before to implement the first type golden PLL defined in [2]. The completed input is shown in Figure 5 as below.
Figure 5: first type golden PLL transfer function
The SSB noise power for the raw phase noise, the output from (TX) PLL and the output from the golden PLL are calculated and presented in K2 to M2 as shown in Figure 6.
Figure 6: SSB noise power calculation
To make the phase noise/jitter results more presentable, a new sheet is used as GUI with the layout shown in Figure 7, where the phase jitter in second is dependent on the carrier frequency.
Figure 7: calculated phase noise output
At this point, you can also plot all the transfer functions as shown in Figure 8 and the phase noise as shown in Figure 9.
Figure 8: transfer function plots

Figure 9: phase noise plots
To achieve capability 4:
I had thought that this feature could take some time to figure out on how to implement. However, a quick search brings me to the Agilent website, where a very good article is presented on exactly the same topic “Controlling instruments with Excel and the bundled Visual Basic forApplications”.
Of course, I certainly don’t want to hard code the GPIB port and address for the spectrum analyzer. Thus, the input interface as in Figure 10 is provided. Instead of using the cell values directly, the named ranges are used so that when the “GUI” is reformatted, there is no need to change the codes because of the shifting of the cell positions.
Figure 10: named ranges for GPIB interface information
Put a command button onto the Excel sheet and “assign Macros” Button1_Click() as shown below will automate the phase noise data downloading into the Excel.

Sub Button1_Click()
    
    Dim ioMgr As VisaComLib.ResourceManager
    Dim instrument As VisaComLib.FormattedIO488
    Dim idn As String
    Dim lpl() As String
    Dim freq() As Double
    Dim dBc() As Double
    Dim rowStart As Integer
    Dim iLastRow As Long
    Dim lpln As Integer
   
    Set ioMgr = New VisaComLib.ResourceManager
    Set instrument = New VisaComLib.FormattedIO488
    Set instrument.IO = ioMgr.Open(Sheets("MainGUI").Range("gpib_port").Value & "::" &   Sheets("MainGUI").Range("gpib_addr").Value) ‘ this is the same as below line
    'Set instrument.IO = ioMgr.Open("GPIB0::03")
    instrument.IO.Timeout = 10000

    lpln = CInt(Sheets("MainGUI").Range("C11").Value) ‘ provide the option to chose the trace
    instrument.WriteString ":FETC:LPL" & lpln & "?"
    lpl = instrument.ReadList(VisaComLib.IEEEASCIIType.ASCIIType_BSTR, ",")
    instrument.IO.Timeout = 5000
   
    rowStart = 2
    For i = (LBound(lpl)) To (UBound(lpl) - 1) Step 2
        ReDim Preserve freq(0 To i / 2)
        ReDim Preserve dBc(0 To i / 2)
        freq(i / 2) = lpl(i)
        dBc(i / 2) = lpl(i + 1)
    Next i
   
   Sheets("LPLData").Range("A" & rowStart & ":A" & (UBound(dBc) + rowStart)).Value = Application.Transpose(freq)
   Sheets("LPLData").Range("B" & rowStart & ":B" & (UBound(dBc) + rowStart)).Value = Application.Transpose(dBc)
   
    'clear the old f-PN contents
    rowStart = UBound(dBc) + rowStart + 1
    iLastRow = Sheets("LPLData").Cells(Rows.Count, "a").End(xlUp).Row
    Sheets("LPLData").Range("A" & rowStart & ":" & "Z" & iLastRow).Clear
    Call TFCalc  ‘ calculate the transfer function
    Call updatePlots  ‘ update the plots

End Sub

To achieve capability 5:
It’s just one more command button with a little bit more coding. You can look into the codes under Button2_Click() if you are interested.
Of course, it’s handy to add in some more features such as the start/stop frequency so that you have the option to change the frequency span for the phase noise measurement. The option to choose which trace to download: raw data trace or the smoothed data trace. And the flexibility of changing the 3dB cut off frequency of the golden PLL.
By now, we are almost done. As all the raw data are organized into one sheet named “LPLData” and the input/output GUI into another sheet named “MainGUI”, automatically download the phase noise raw data doesn’t pose any issue as it has been taken care of by the Macros. However, manually cut/paste the data from external sources into the Excel sheet may risk overwriting the equations inside the cells, thus corrupting the excel sheet. To avoid this situation, instead of input the equations manually into the Excel sheet, the transfer function calculation and the trapezoidal integration equations have been packed into Macros, making this process fully automated. In addition, an extra Excel sheet named as “PNData” is used for external phase noise data manual input as shown in Figure 12.
Figure 12: phase noise manual input interface

A typical procedure for manually input the phase noise data is outlined in the following:
  1. Navigate to sheet “PNData”, click on “Delete PN Data” to clear old data points.
  2. Copy the external data and paste them into column A and B from row 2 onwards.
  3. Navigate to sheet “MainGUI” and click “Manual PN Data”.  All the calculations will be done automatically with results updated instantly.
The sample code used for PCIe PLL transfer function calculation is given as below:
Function HdB(f3db As Double, zeta As Double, f) As Double
    Dim i As Integer
    Dim n As Double
    Dim d As Double
    Dim w As Double
    Dim w2 As Double
    Dim wn As Double
    Dim H As Double
    w = 2 * Application.WorksheetFunction.Pi() * f 'omega
    w3 = 2 * Application.WorksheetFunction.Pi() * f3db  'omega 2
    wn = w3 / Sqr(1 + 2 * zeta ^ 2 + Sqr((1 + 2 * zeta ^ 2) ^ 2 + 1)) 'omega n
    n = wn * Sqr(wn ^ 2 + 4 * w ^ 2 * zeta ^ 2) 'numorator
    d = Sqr((wn ^ 2 - w ^ 2) ^ 2 + (2 * w * wn * zeta) ^ 2) 'denominator
    H = 20 * Application.WorksheetFunction.Log10(n / d)
    HdB = H
End Function

The finished GUI is shown in Figure 13.
Figure 13: finished GUI

References:
1. PCI ExpressTM Jitter Modeling Revision 1.0RD
2. Fiber Channel - Methodologies for Jitter and Signal Quality Specification - MJSQ