Developer Guide

  • 2021.2
  • 06/11/2021
  • Public
Contents

Output Scenario: Two-Signal Synchronization

In this scenario, you will generate two simultaneous signals with same period and different phase. You will capture the signals with a logic analyzer and calculate the phase shift for every cycle. Calculated statistics (minimum, maximum, average, standard deviation, and jitter) will demonstrate how precisely the signals can be synchronized. You will do this first with software GPIO, then with TGPIO, and compare jitter values.
Command Example
  1. Connect software GPIO pin 0 to the logic analyzer channel 0. Connect software GPIO pin 1 to the logic analyzer channel 1. Connect TGPIO pin 0 to the logic analyzer channel 2. Connect TGPIO pin 1 to the logic analyzer channel 3. Connect the ground pin to the ground of the logic analyzer (any channel).
    The names “software GPIO pin 0/1” and “TGPIO pin 0/1” are placeholders. For information about pins specific to your hardware, see Example Pins.
  2. Open two terminal windows.
  3. In the first terminal, run stress-ng:
    stress-ng -t0 -C 0 -c 0 --taskset 2 --aggressive
  4. Run software GPIO mode:
    1. In the second terminal, go to the following directory:
      cd /usr/share/tcc_tools/samples/tcc_tgpio_samples/tcc_tgpio_advanced_sample/cfg/<BOARD>
      Where
      <BOARD>
      matches your current platform.
    2. Run the sample in software GPIO mode:
      tcc_tgpio_advanced_sample --mode soft --signal_file soft_two_signals.cfg
    3. In the logic analyzer software, start data capture on channels 0 and 1 for 15 seconds.
    4. Wait until the logic analyzer stops capturing data.
    5. Stop the sample (Ctrl+C).
    6. Export the data from the logic analyzer software as
      2ch_swgpio.csv
      .
  5. Run TGPIO mode:
    1. In the second terminal, run the sample in TGPIO mode:
      tcc_tgpio_advanced_sample --mode tgpio --signal_file tgpio_two_signals.cfg
    2. In the logic analyzer software, start data capture on channels 2 and 3 for 15 seconds.
    3. Wait until the logic analyzer stops capturing data.
    4. Stop the sample and stop stress-ng (Ctrl+C).
    5. Export the data from the logic analyzer software as
      2ch_tgpio.csv
      .
  6. Analyze the captured data with the provided script:
    1. Go to the script directory:
      cd ${TCC_ROOT}/samples/plot_scripts
    2. Copy the CSV files from the previous steps to this directory.
    3. Run the script to analyze results:
      ./tcc_signal_analyzer_plotter.py --shift --units ms 2ch_swgpio.csv 2ch_tgpio.csv
Output Example
The output shows the minimum or shortest phase shift, the average phase shift, the maximum or longest phase shift, standard deviation, and jitter (the difference between the minimum phase shift and maximum phase shift). For example:
---- 2ch_swgpio.csv ---- min: 0.249245 ms avg: 0.249747 ms max: 0.254427 ms std: 0.000446 ms jitter: 0.005182 ms ---- 2ch_tgpio.csv ---- min: 0.250010 ms avg: 0.250011 ms max: 0.250012 ms std: 0.000001 ms jitter: 0.000002 ms
The script generates a plot, which appears in a separate window. For example:
In this example, software GPIO data is represented in blue. TGPIO data is represented in orange. TGPIO has lower jitter compared to software GPIO.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.