SPEC7 Tools
-------------------

This is a software collection a various tools related to the SPEC7. Currently it holds 6 items

- PCIe_mm, A debug to quickly read and write memory in one of the BARs of the SPEC7.
- PCIe_rescan, A simple script to reload the PCIe entry. Mandatory after each programming.
- PCIe_vuart, A terminal interface to the uart of the WR core (BAR0).
- SMBus_reset, A simple script to Hard-reset (POR) the SPEC7 over the PCIe SMBus.
- PCIE_load_bitfile, A script to load and flash a bitfile over PCIe (WIP).
- spec7-kernel-module, Provides /dev/spec7_barX entries, and other userspace options. 

PCIe_mm
--------------
This tool can be used to read and write to a certain adress. For example:

    ./spec7-tools/Pcie_mm/spec7_mm.py -a 0x0004
Will read address 0x0004.

    ./spec7-tools/Pcie_mm/spec7_mm.py -a 0x0004 -w 0xABBA 
Will write 0xABBA to adress 0x0004

PCIe_rescan
------------
This scripts automaticly removes and rescans the SPEC7 PCIe device.

    ./spec7-tools/Pcie_rescan/Pcie_rescan.sh
Must be run as root.

PCIe_vuart
------------
A python script to emulate a termios terminal to utilize an uart connection on the White Rabbit ref design.

    ./spec7-tools/Pcie_vuart/spec7_vuart.py

SMBus_reset
------------
This script triggers a POR event on the SPEC7 via the PCIe's SMBus. 

    ./spec7-tools/SMBus_reset/spec7_reset.sh
It uses i2c-tools so make sure you've probed i2c_dev beforehand.

    ./modprobe i2c_dev
    
PCIE_load_bitfile
------------
This script automatticly loads and flashes a new bitfile to the SPEC7.

    ./spec7-tools/Pcie_load_bitfile/Pcie_load_bitfile.sh ./spec7_wr_ref_top.bit
Must be run as root.

spec7-kernel-module
------------
The Kernel module written by the one and only Ton Damen. See that specific readme.md for more info.
It's mandatory to have installed to use all the previous tools (except the SMBus_reset).

Pascal Bos, bosp@nikhef.nl
Ton Damen, tond@nikhef.nl
September 2021




