... | @@ -25,9 +25,96 @@ following repositories (branch master). |
... | @@ -25,9 +25,96 @@ following repositories (branch master). |
|
inside "SPEC-SW" repository as a git submodule. If you use that, you
|
|
inside "SPEC-SW" repository as a git submodule. If you use that, you
|
|
don't need to download it from FMC bus repository.
|
|
don't need to download it from FMC bus repository.
|
|
|
|
|
|
## Installation
|
|
## Download
|
|
|
|
|
|
*To be done\>*
|
|
To download the sources, you should execute the following
|
|
|
|
command:
|
|
|
|
|
|
|
|
$ git clone git:https://www.ohwr.org/fmc-projects/fmc-tdc/fmc-tdc-sw.git
|
|
|
|
|
|
|
|
## Compile
|
|
|
|
|
|
|
|
To compile the sources, you should execute the following command:
|
|
|
|
|
|
|
|
$ make
|
|
|
|
|
|
|
|
The spec-tdc.ko driver has several parameters, you can discover them
|
|
|
|
exe-
|
|
|
|
cuting:
|
|
|
|
|
|
|
|
modinfo ./spec-tdc.ko.
|
|
|
|
|
|
|
|
\* lun: Logical unit number.
|
|
|
|
|
|
|
|
\* bus: PCI bus number where the SPEC+TDC is plugged on.
|
|
|
|
|
|
|
|
\* slot: PCI slot where the SPEC+TDC is plugged on.
|
|
|
|
To know which are the bus and slot numbers, one can use the command
|
|
|
|
*lspci*:
|
|
|
|
|
|
|
|
$ lspci
|
|
|
|
[...]
|
|
|
|
00:04.0 Non-VGA unclassified device: CERN/ECP/EDU Device 018d (rev 03)
|
|
|
|
|
|
|
|
In the previous output, the parameters will be: bus=0 slot=4.
|
|
|
|
|
|
|
|
## Loading the drivers
|
|
|
|
|
|
|
|
To load the drivers, we should load the dependencies first:
|
|
|
|
|
|
|
|
# insmod <path_zio>/zio.ko
|
|
|
|
# insmod <path_fmc-bus>/kernel/fmc.ko
|
|
|
|
# insmod <path_spec-sw>/kernel/spec.ko
|
|
|
|
|
|
|
|
Once the dependencies are loaded, we load the drivers:
|
|
|
|
|
|
|
|
# insmod <path_fmc-tdc-sw>/drivers/zio-trigger-tdc.ko
|
|
|
|
# insmod <path_fmc-tdc-sw>/drivers/spec-tdc.ko <parameters>
|
|
|
|
|
|
|
|
## libtdc, an user-space library
|
|
|
|
|
|
|
|
### Introduction
|
|
|
|
|
|
|
|
As the driver uses the ZIO framework, it is provided an C/C** user-space
|
|
|
|
library to manage the FMC TDC devices. The user should use it instead of
|
|
|
|
accesing directly to the driver.
|
|
|
|
|
|
|
|
### API
|
|
|
|
|
|
|
|
As the API description is quite long, it is recommended to read the
|
|
|
|
documentation files generated by the "make" command in your local copy
|
|
|
|
of the repository.
|
|
|
|
|
|
|
|
## Test program
|
|
|
|
|
|
|
|
### Introduction
|
|
|
|
|
|
|
|
The test program is used to check the proper behavior of the board in
|
|
|
|
case of failure or to check if there is a bug in the driver or in the
|
|
|
|
library.
|
|
|
|
The test program has an CLI interface due to some limitations when
|
|
|
|
accessing remotely to the machine. It is designed to allow the execution
|
|
|
|
of the program under SSH.
|
|
|
|
|
|
|
|
### Dependencies
|
|
|
|
|
|
|
|
- Python 2.7 or higher.
|
|
|
|
|
|
|
|
First of all, before execute it, you should compile the shared object
|
|
|
|
library:
|
|
|
|
|
|
|
|
$ cd <path_fmc-tdc-sw>/lib
|
|
|
|
$ make libtdc.so
|
|
|
|
|
|
|
|
### How to use it
|
|
|
|
|
|
|
|
To execute it:
|
|
|
|
$ cd <path_fmc-tdc-sw>/test
|
|
|
|
$ ./test-fmctdc.py
|
|
|
|
|
|
|
|
If you want the help, you can execute:
|
|
|
|
|
|
|
|
$ ./test-fmctdc.py -h
|
|
|
|
|
|
## Links
|
|
## Links
|
|
|
|
|
... | | ... | |