EDT PCD SDK Documentation 6.2.0
EDT PCD Quick Start Guide

Engineering Design Team (EDT), Inc. https://edt.com

SPDX-License-Identifier: BSD-3-Clause Copyright (C) 2014 Engineering Design Team, Inc.

Revised: Oct. 2023

Location of files

By default, the PCD package is installed to:

  • On Windows: C:\EDT\pcd
  • On Linux: /opt/EDTpcd

This directory will be referred to as the "installation directory."

Quick Start Guide

To check whether the EDT PCD kernel driver is loaded and has found EDT PCI cards installed in the system, try running pciload -p to enumerate the cards and show their firmware versions.

sslooptest is a test application to exercise a board's DMA engine. For S5 and A5 type cards, it will configure the board to generate PRBS data internally, then DMA that data to the host PC where the PRBS pattern will be checked.

Source code for basic examples, demonstrating how to setup and run DMA with the EDT API are provided in the examples/ directory. Refer to the "EDT DMA Library" module in the SDK documentation for a detailed description of essential DMA API functions.

Also see the other README.xxx files in the installation directory for information on specific tasks.

Windows

Open Device Manager and expand the "PCI Devices" entry to see which EDT PCD devices you may have installed in a given system.

Most PCD utilities are command line applications. Open PowerShell or Command Prompt and navigate to the installation directory to launch these applications. For example, to launch pciload to list all installed PCD boards in the system:

./bin/pciload.exe -p

Linux

Most PCD utilities are command line applications. Open your favorite terminal and navigate to the installation directory to find the binary applications. For example, to launch pciload to list all installed PCD boards in the system:

./pciload -p

If the "pciutils" package is installed, run lspci -d 123d: to list any EDT PCI devices installed in your system.

If the "kmod" package is installed, run lsmod | grep edt_pci to check if the edt_pci_pcd kernel module is currently loaded.

Linux Kernel Module

The PCD kernel module (edt_pci_pcd) is compiled during installation of the PCD package with the help of Dynamic Kernel Module Support (DKMS). The DKMS tooling should automatically sign the module during install.

However, it is possible your kernel may fail to load the module due to UEFI Secure Boot being enabled, kernel signature enforcement being enabled, the DKMS signing certificate is not yet trusted by your system, or some combination thereof. EDT PCI devices will be inaccessible until the kernel module can be properly loaded.

There are two options to correct this issue:

  1. For temporary testing purposes, ensure both UEFI Secure Boot and your kernel's signature enforcement are disabled.
    • Not ideal, for system security reasons.
    • Disable UEFI Secure Boot via the BIOS Settings.
    • Disable signature enforcement via kernel parameter "CONFIG_MODULE_SIG_FORCE".
    • Re-run (as sudo/root) the setup.sh script within the installation directory.
  2. EDT is happy to help diagnose a kernel module loading problem.
    • Collect the install.log from the installation directory.
    • Collect the DKMS log, either install_dkms_make.log from the installation directory or from /var/lib/dkms/edt_pci_pcd/<package_version>/make.log
    • Submit a service request and attach both log files at: https://edt.com/technical-support-request/

Updating Firmware

The firmware of EDT's FPGA-based products may be updated occasionally. These firmware files are provided as separate add-on packages.

To compare the current FPGA firmware running on the board with any firmware files you may have additionally installed to the installation directory, navigate to the PCD directory in a command window (terminal) and run:

./pciload verify

The program will output the dates, revision numbers, and file ID of the FPGA firmware. If they match then there is no need for an upgrade. If they differ, upgrade the firmware by running:

./pciload update

Note that the FPGA only reloads firmware during power-up, so after loading new firmware with pciload, it won't be active until the system has power cycled. This requires shutting down, waiting a few seconds, then powering back on. Rebooting is not sufficient; PCI devices are often not powered off during a reboot.

pciload has several options that can be used in other than the default case (e.g. -u 1 to update the second of 2 boards in the system). For a list of all options, run:

./pciload -h

IMPORTANT: The features and functionality of an FPGA-based EDT product are dependent on the firmware variant and version. For details, refer to the user guide for your product.

Multi-threaded programming with the EDT driver

The EDT driver is thread-safe with the following constraints:

  1. All DMA operations must be performed in the same thread as edt_open() and edt_close() with respect to each channel. Other threads may open the same channel concurrently with DMA, but should perform no DMA related operations.

    This is because kernel DMA resources are allocated on a per-thread basis and must be allocated and released in the same thread.

  2. Upon program exit, one of the following two conditions must be met before the EDT driver is used again:

    a. All threads spawned by a main program must be joined with the main program after they exit and before the main program exits.

    b. If the main program does not wait for the child threads to exit, then any program that is run following the main program must wait for all of the child threads to exit. This waiting period depends on system load and availability of certain system resources, such as a hardware memory management unit.

Failure to meet one of these conditions results in undefined program and system behavior. Program and system crashes are commonly observed side effects.

Partial List of Included Files

(Note: Linux versions don't have the .exe extension on executables.)

README
This file.
VERSION
Version number of this package.
edtinc.h
libedt.h
libpcd.so (unix/linux)
libpcd.lib (windows)
EDT DMA library and associated C header files.
initpcd.exe
Program to configure PCI CD and GP boards.
pciload.exe
Utility program for doing a field upgrade of the
PCI FPGA's flash.
pdb.exe
Diagnostic program for reading and writing onboard
PCI CD/GP registers.
setdebug.exe
Diagnostic program that sets the device driver debug level.
speedtest.exe
Utility to test the speed of the interface/PCI bus.
sslooptest.exe
Diagnostic program for boards such as the A5, S5 or CDA. Enables
internal data generators, inits and starts DMA from the device, then
checks if the data matches a known (PRBS) pattern.
wr16.exe
rd16.exe
Test programs for PCI GP-SSD16 boards.
examples/simple_getdata.c
examples/simple_putdata.c
Sample program for continuous DMA input and output (respectively).