...
 
Commits (35)
# .gitignore file # .gitignore file
xcompiler/*
# OS generated files # # OS generated files #
###################### ######################
*.bak *.bak
......
[submodule "spec-sw"] [submodule "spec-sw"]
path = spec-sw path = spec-sw
url = git://ohwr.org/fmc-projects/spec/spec-sw.git url = https://ohwr.org/project/spec-sw.git
[submodule "etherbone"] [submodule "wr-nic"]
path = etherbone path = wr-nic
url = git://ohwr.org/hdl-core-lib/etherbone-core.git url = https://ohwr.org/project/wr-nic.git
[submodule "fmc-dio"]
path = fmc-dio
url = https://ohwr.org/project/fmc-dio-5chttla.git
[submodule "wrpc-sw"]
path = wrpc-sw
url = https://ohwr.org/project/wrpc-sw.git
[submodule "coht-vic"]
path = coht-vic
url = https://gitlab.cern.ch/cohtdrivers/coht-vic.git
...@@ -14,30 +14,40 @@ ...@@ -14,30 +14,40 @@
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
######################################################################## ########################################################################
SUBMOD_DIRS=spec-sw etherbone SUBMOD_DIRS=spec-sw wr-nic fmc-dio coht-vic
MAKE_DIRS = spec-sw etherbone/api #tools MAKE_DIRS = spec-sw wr-nic fmc-dio coht-vic #tools
#RUNME := $(shell test -d $(FMC_DRV) || git submodule update --init) LM32_XCOMPILER_URL="https://www.ohwr.org/project/wrpc-sw/uploads/2776ce0ba43503d1486ae205b48fb450"
LM32_XCOMPILER_NAME="lm32_host_64bit.tar.xz"
XCOMPILER_DIR="xcompiler"
LM32_XCOMPILER_NAME_DIR="lm32-gcc-4.5.3"
#RUNME := $(shell test -d $(FMC_DRV) || git submodule update --init)
## Call the sub folder Makefiles ## Call the sub folder Makefiles
all clean install: init all clean install: init
@for d in $(MAKE_DIRS); do $(MAKE) -C $$d $@ || exit 1; done @for d in $(MAKE_DIRS); do $(MAKE) -C $$d $@ || exit 1; done
@if [ "x$@" = "xinstall" ]; then ./scripts/wr-ssk-get -i; fi @if [ "x$@" = "xinstall" ]; then ./scripts/wr-ssk-get -i; cp wrpc-sw/tools/wrpc-vuart /usr/local/sbin; fi
## Init repo and create the .INIT file to not do it again ## Init repo and create the .INIT file to not do it again
init: .INIT init: .INIT
.INIT: .INIT:
git submodule init git submodule init
@ $(MAKE) update @ $(MAKE) update
@ $(MAKE) patch
@touch .INIT; \ @touch .INIT; \
patch:
./scripts/wr-git-patch
## Force updating the submodules and fetch new gateware ## Force updating the submodules and fetch new gateware
update: update:
./scripts/wr-ssk-get -f ./scripts/wr-ssk-get -f
git submodule update git submodule update
cd spec-sw @rm -rf $(XCOMPILER_DIR)
git submodule update mkdir -p $(XCOMPILER_DIR)
cd $(XCOMPILER_DIR) && wget $(LM32_XCOMPILER_URL)/$(LM32_XCOMPILER_NAME) \
&& tar xvf $(LM32_XCOMPILER_NAME)
cd wrpc-sw && make spec_defconfig && \
CROSS_COMPILE="$(shell pwd)/$(XCOMPILER_DIR)/$(LM32_XCOMPILER_NAME_DIR)/bin/lm32-elf-" make
coht-vic @ 44bb1e7b
Subproject commit 44bb1e7bafdcb82eaf3ce0c89157ba359b08d18c
Intro
==========
The document has been written in markdown format and can be directly
read from github, gitlab or bitbucket
PDF Generation
===============
You might need to install `pandoc` software to generate `.pdf` from `.md`.
sudo apt-get install pandoc
To generate a specific document you should enter its own directory and execute
make
If you have some Latex compilation error please install the following packages
sudo apt-get install texlive texlive-latex-extra
### pandoc.latex
The file pandoc.latex is a latex template in order to add all special latex customization
to the markdown file. In case some of latex package are not working properly, the user
should try to modify this file.
Syntax
===========
> ***NOTES:*** The syntax used in this document is Markdown. We recommand to follow the strict
markdown syntax explained on [bitbucket](https://bitbucket.org/tutorials/markdowndemo).
doc/img/ssk_ txpps.png

61.2 KB | W: | H:

doc/img/ssk_ txpps.png

90.5 KB | W: | H:

doc/img/ssk_ txpps.png
doc/img/ssk_ txpps.png
doc/img/ssk_ txpps.png
doc/img/ssk_ txpps.png
  • 2-up
  • Swipe
  • Onion skin
doc/img/ssk_100Hz.png

191 KB | W: | H:

doc/img/ssk_100Hz.png

140 KB | W: | H:

doc/img/ssk_100Hz.png
doc/img/ssk_100Hz.png
doc/img/ssk_100Hz.png
doc/img/ssk_100Hz.png
  • 2-up
  • Swipe
  • Onion skin
File mode changed from 100755 to 100644
doc/img/ssk_configs.png

72.8 KB | W: | H:

doc/img/ssk_configs.png

40.4 KB | W: | H:

doc/img/ssk_configs.png
doc/img/ssk_configs.png
doc/img/ssk_configs.png
doc/img/ssk_configs.png
  • 2-up
  • Swipe
  • Onion skin
doc/img/ssk_inside.jpg

460 KB | W: | H:

doc/img/ssk_inside.jpg

384 KB | W: | H:

doc/img/ssk_inside.jpg
doc/img/ssk_inside.jpg
doc/img/ssk_inside.jpg
doc/img/ssk_inside.jpg
  • 2-up
  • Swipe
  • Onion skin
File mode changed from 100755 to 100644
doc/img/ssk_playdio.png

15.9 KB | W: | H:

doc/img/ssk_playdio.png

41.4 KB | W: | H:

doc/img/ssk_playdio.png
doc/img/ssk_playdio.png
doc/img/ssk_playdio.png
doc/img/ssk_playdio.png
  • 2-up
  • Swipe
  • Onion skin
doc/img/ssk_pps-setup.png

34.8 KB | W: | H:

doc/img/ssk_pps-setup.png

67 KB | W: | H:

doc/img/ssk_pps-setup.png
doc/img/ssk_pps-setup.png
doc/img/ssk_pps-setup.png
doc/img/ssk_pps-setup.png
  • 2-up
  • Swipe
  • Onion skin
doc/img/ssk_sfp.jpg

351 KB | W: | H:

doc/img/ssk_sfp.jpg

285 KB | W: | H:

doc/img/ssk_sfp.jpg
doc/img/ssk_sfp.jpg
doc/img/ssk_sfp.jpg
doc/img/ssk_sfp.jpg
  • 2-up
  • Swipe
  • Onion skin
File mode changed from 100755 to 100644
This diff is collapsed.
This diff is collapsed.
etherbone @ d1b6b4bd
Subproject commit d1b6b4bd5b1fff8d50adc02665348814c40bb536
Subproject commit cf911ce26c101943edd5b0c6db360dc563147051
Folder to places patches to apply before compiling the starting kit.
If empty calling this folder will do nothing
From 670756fc4c7e62442b43b745239a8a5d7cc03e8e Mon Sep 17 00:00:00 2001
From: Miguel Jimenez Lopez <miguel.jimenez@sevensols.com>
Date: Thu, 12 Sep 2019 09:46:27 +0200
Subject: [PATCH 4/4] Makefile: Add an installation rule.
---
drivers/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/Makefile b/drivers/Makefile
index fbda688..8982385 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -9,6 +9,8 @@ VERSION = $(shell git describe --always --dirty --long --tags)
all: modules
modules:
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) DRV_VERSION="$(VERSION)"
+install modules_install:
+ $(MAKE) -C $(LINUX) M=$(shell /bin/pwd) DRV_VERSION="$(VERSION)" modules_install
clean:
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) clean
--
2.17.1
#! /bin/bash
# ******************************************************************************
# @file eb-mem.sh
# @brief Script to use easy Etherbone tools
#
# Copyright (C) 2013
#
# Memory access with Etherbone tools
#
# @author Miguel Jimenez Lopez <klyone@ugr.es>
#
# @bug none!
#
# ******************************************************************************
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http//www.gnu.org/licenses/>.
# ******************************************************************************
print_help() {
echo ""
echo "############################################################################"
echo ""
echo "Command: eb-mem <options>"
echo ""
echo "--read|-r: Perform a read operation. It needs a IP and memory address."
echo "--write|-w: Perform a write operation. It needs a IP, memory address and value."
echo "--scan|-s: Perform a scan operation. It needs a IP address."
echo "--compact|-c: Use compact format. Perform a read or write operation depending on arguments"
echo "--tcp|-t: Use TCP packets to communication."
echo "--udp|-u: Use UDP packets to communication."
echo "--bytes|-b: Indicates n-bytes alignment of memory."
echo "--ip|-i: Device IP address."
echo "--port|-p: Use a determinate port."
echo "--address|-a: Device address to read/write access."
echo "--value|-v: Value to write into device."
echo "--help|-h: Show this help."
echo ""
echo "NOTE: This script does not try to implement all options of Etherbone tools."
echo "If you want to execute these operations with other options, you must use "
echo "original tools developped by Etherbone team!!"
echo ""
echo "Examples:"
echo ""
echo "eb-mem --scan --ip 10.10.10.10"
echo "eb-mem --read --ip 10.10.10.10 --address 0x64233"
echo "eb-mem --write --ip 10.10.10.10 --address 0x64233 --value 0x123"
echo "(COMPACT READ) => eb-mem --compact --ip 10.10.10.10 --address 0x64233"
echo "(COMPACT WRITE) => eb-mem --compact --ip 10.10.10.10 --address 0x64233 --value 0x124"
echo ""
echo "############################################################################"
echo ""
}
nargs=$#
EB_TOOLS=${EB_TOOLS-../etherbone/api/tools}
n=0
mode='none'
t_transport='udp'
bytes=4
port=''
ip='none'
address='none'
value='none'
while (($n < $nargs)) ;
do
arg=$1
case $arg in
--read|-r) mode='read'; ;;
--write|-w) mode='write' ;;
--scan|-s) mode='scan' ;;
--compact|-c) mode='compact' ;;
--tcp|-t) t_transport='tcp' ;;
--udp|-u) t_transport='udp' ;;
--bytes|-b) shift; bytes=$1 ;;
--ip|-i) shift; ip=$1 ;;
--port|-p) shift; port="/$1";;
--address|-a) shift; address=$1 ;;
--value|-v) shift; value=$1 ;;
--help|-h) print_help ; exit 0;;
esac
n=$n+1
shift
done
if [ "$mode" = 'none' ];
then
echo "You must get access mode: --scan|--read|--write"
exit -1
fi
if [ "$ip" = 'none' ];
then
echo "You must get IP address to connect with Etherbone core"
exit -1
fi
case $mode in
scan) $EB_TOOLS/eb-ls $t_transport/$ip$port;;
read) if [ "$address" = 'none' ];
then
echo "You must get memory address in read operation"
exit -1
fi
$EB_TOOLS/eb-read $t_transport/$ip$port $address/$bytes
;;
write) if [ "$address" = 'none' ];
then
echo "You must get memory address in write operation"
exit -1
fi
if [ "$value" = 'none' ];
then
echo "You must get value in write operation"
exit -1
fi
$EB_TOOLS/eb-write $t_transport/$ip$port $address/$bytes $value
;;
compact) if [ "$address" = 'none' ];
then
echo "You must get memory address in read or write operation"
exit -1
fi
if [ "$value" = 'none' ];
then
$EB_TOOLS/eb-read $t_transport/$ip$port $address/$bytes
else
$EB_TOOLS/eb-write $t_transport/$ip$port $address/$bytes $value
fi
esac
#!/bin/dash
## Script to apply git patches for submodules.
##
## Authors:
## - Miguel Jimenez Lopez (Seven Solutions, www.sevensols.com)
##
## GNU Lesser General Public License Usage
## This file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
#######################################################################################################
### Show help of the function
help ()
{
cat << EOF
Usage: $(basename $0) [Options]
Options:
-h|--help) Show this little help
EOF
exit 0
}
#################################################
### Main execution
GIT_REPOS="spec-sw wrpc-sw wr-nic fmc-dio coht-vic"
MAIN_DIR=".."
PATCHES_DIR="patches"
# setup script dir
sdir=$(dirname $0)
cd $sdir
sdir=$(pwd)
while [ $# -gt 0 ]; do # Until you run out of parameters . . .
case "$1" in
-h|--help) help;;
*) help;;
esac
shift # Check next set of parameters.
done
for i in $GIT_REPOS
do
if [ -e "$sdir/$MAIN_DIR/$PATCHES_DIR/$i" ] ; then
echo "Patching $i submodule"
cd "$sdir/$MAIN_DIR/$i"
git am $sdir/$MAIN_DIR/$PATCHES_DIR/$i/*.patch
cd "$sdir"
fi
done
...@@ -106,7 +106,11 @@ insthdl() ...@@ -106,7 +106,11 @@ insthdl()
if [ ! -d ${installdir} ]; then if [ ! -d ${installdir} ]; then
sudo mkdir -p ${installdir} sudo mkdir -p ${installdir}
fi fi
sudo cp -v ${DOWNLOADDIR}/spec-init.bin ${DOWNLOADDIR}/wr_nic_dio.bin ${installdir} sudo cp -v ${DOWNLOADDIR}/spec-init.bin \
${DOWNLOADDIR}/wr_nic_dio.bin \
${DOWNLOADDIR}/wr_nic.bin \
${DOWNLOADDIR}/wr_nic_lm32_sw.bin \
${installdir}
wr_echoret $? "OK" "ERROR" wr_echoret $? "OK" "ERROR"
checkdrv; checkdrv;
...@@ -290,7 +294,7 @@ exit 0 ...@@ -290,7 +294,7 @@ exit 0
# setup script dir # setup script dir
scriptdir=$(cd $(dirname $0); pwd) scriptdir=$(cd $(dirname $0); pwd)
DOWNLOADDIR=${scriptdir}/../firmware DOWNLOADDIR=${scriptdir}/../firmware
PKGURL="http://www.ohwr.org/attachments/download/2744/wr-starting-kit-v2.0_gw.tar.gz 9e48bbe6c30b18864ecddceb7627e6e9" PKGURL="https://drive.google.com/uc?export=download&id=1ihH73-YVrRDhWcYa9-4kkqepvl3xrRGk 39843e9cb12182dfe741fb3b26ac6ea5"
while [ $# -gt 0 ]; do # Until you run out of parameters . . . while [ $# -gt 0 ]; do # Until you run out of parameters . . .
case "$1" in case "$1" in
......
Subproject commit eb9b9d03e3f54657fe29fca93021e2b45380da05 Subproject commit a301a69e45ca608b6d20c3843d95343bb326decf
...@@ -51,7 +51,7 @@ RUN \ ...@@ -51,7 +51,7 @@ RUN \
make clean &&\ make clean &&\
make &&\ make &&\
make install make install
#set enviroment variable for kernel version 4.13.0-16-generic #set enviroment variable for kernel version 4.13.0-16-generic
ENV LINUX /lib/modules/4.13.0-16-generic/build ENV LINUX /lib/modules/4.13.0-16-generic/build
......
...@@ -13,7 +13,7 @@ RUN \ ...@@ -13,7 +13,7 @@ RUN \
apt-get install -y git \ apt-get install -y git \
build-essential \ build-essential \
linux-headers-4.15.0-47-generic \ linux-headers-4.15.0-47-generic \
linux-headers-4.18.0-17-generic linux-headers-4.18.0-17-generic
# Clone repository and detach HEAD # Clone repository and detach HEAD
RUN \ RUN \
......
...@@ -12,7 +12,7 @@ from ssh import SshCmd,SshCmdException ...@@ -12,7 +12,7 @@ from ssh import SshCmd,SshCmdException
## Class DIO ## Class DIO
# #
class DIO (): class DIO ():
def __init__(self,hostName,userName,password,interfaceName): def __init__(self,hostName,userName,password,busId):
""" """
Construcctor Construcctor
...@@ -20,13 +20,13 @@ class DIO (): ...@@ -20,13 +20,13 @@ class DIO ():
hostName: ip or hostname hostName: ip or hostname
userName: username userName: username
password : password password : password
interfaceName: interface name busId: number PCIe bus
""" """
self.hostName = hostName self.hostName = hostName
self.userName = userName self.userName = userName
self.password = password self.password = password
self.interfaceName = interfaceName self.busId = busId
self.command = "sudo wr-dio-cmd " + interfaceName self.command = "sudo wr-dio-cmd /dev/fmc-dio-%i:0" % int(busId,16)
self.sshCmd = SshCmd() self.sshCmd = SshCmd()
def configurePort(self,channel,mode): def configurePort(self,channel,mode):
......
...@@ -31,16 +31,10 @@ def loadDriver(hostName,userName,password): ...@@ -31,16 +31,10 @@ def loadDriver(hostName,userName,password):
command = "ifconfig | grep wr | wc -l" command = "ifconfig | grep wr | wc -l"
value = sshCmd.exec(hostName,command,userName,password) value = sshCmd.exec(hostName,command,userName,password)
if (int(value) == 0): if (int(value) == 0):
command = "sudo modprobe -r spec" commands = ["sudo modprobe spec","sudo modprobe htvic",
sshCmd.exec(hostName,command,userName,password) "sudo modprobe wr-nic","sudo modprobe wr-dio"]
command = "sudo modprobe -r wr-nic" for cmd in commands:
sshCmd.exec(hostName,command,userName,password) sshCmd.exec(hostName,cmd,userName,password)
command = "sudo modprobe spec"
sshCmd.exec(hostName,command,userName,password)
command = "sudo insmod /lib/modules/$(uname -r)/extra/wr-nic.ko wrc=1" #esto es temporal
sshCmd.exec(hostName,command,userName,password)
command = "sudo modprobe wr-nic"
sshCmd.exec(hostName,command,userName,password)
command = "ifconfig | grep wr | wc -l" command = "ifconfig | grep wr | wc -l"
value = sshCmd.exec(hostName,command,userName,password) value = sshCmd.exec(hostName,command,userName,password)
if (int(value) == 0): if (int(value) == 0):
...@@ -69,4 +63,4 @@ password = getpass.getpass() ...@@ -69,4 +63,4 @@ password = getpass.getpass()
if (loadDriver(hostName,userName,password) == 0): if (loadDriver(hostName,userName,password) == 0):
print("Load driver: ok") print("Load driver: ok")
else: else:
print("Load driver: error") print("Load driver: error")
\ No newline at end of file
...@@ -55,7 +55,7 @@ class SshCmd (): ...@@ -55,7 +55,7 @@ class SshCmd ():
Raises: Raises:
SshCmdException SshCmdException
Return: Return:
command result command result
""" """
resp = "" resp = ""
......
...@@ -38,7 +38,7 @@ def findTimestamp(listStamp1,listStamp2,offset): ...@@ -38,7 +38,7 @@ def findTimestamp(listStamp1,listStamp2,offset):
return False return False
def testAdvDIO(hostName1,userName1,password1,interfaceName1,hostName2,userName2,password2,interfaceName2): def testAdvDIO(hostName1,userName1,password1,interfaceName1,busId1,hostName2,userName2,password2,interfaceName2,busId2):
""" """
Check the pulses generated on a remote board Check the pulses generated on a remote board
...@@ -47,33 +47,34 @@ def testAdvDIO(hostName1,userName1,password1,interfaceName1,hostName2,userName2, ...@@ -47,33 +47,34 @@ def testAdvDIO(hostName1,userName1,password1,interfaceName1,hostName2,userName2,
username1: user name host 1 username1: user name host 1
password1: password password1: password
interfaceName1 : interface name interfaceName1 : interface name
busId1: number PCIe bus PC 1
hostName2: ip remote host 2 hostName2: ip remote host 2
username2: user name host 2 username2: user name host 2
password2: password password2: password
interfaceName2 : interface name interfaceName2 : interface name
busId2: number PCIe bus PC 2
Raises: Raises:
error test error test
""" """
try: try:
sshCmd1 = SshCmd() sshCmd1 = SshCmd()
sshCmd2 = SshCmd() sshCmd2 = SshCmd()
dio1 = DIO(hostName1,userName1,password1,interfaceName1) dio1 = DIO(hostName1,userName1,password1,busId1)
dio2 = DIO(hostName2,userName2,password2,interfaceName2) dio2 = DIO(hostName2,userName2,password2,busId2)
dio1.configurePorts("pdiii") dio1.configurePorts("pdiii")
dio2.configurePorts("iiiii") dio2.configurePorts("iiiii")
dio1.clearTimestamps() dio1.clearTimestamps()
dio2.clearTimestamps() dio2.clearTimestamps()
command = "sudo wr-dio-agent " + interfaceName1 command = "sudo wr-dio-agent %s /dev/fmc-dio-%i:0" % (interfaceName1,int(busId1,16))
sshCmd1.exec(hostName1,command,userName1,password1,False) sshCmd1.exec(hostName1,command,userName1,password1,False)
command = "sudo wr-dio-ruler " + interfaceName1 + " IN0 R1+" + str(delay) command = "sudo wr-dio-ruler %s /dev/fmc-dio-%i:0 IN0 R1+%s" % (interfaceName2,int(busId1,16),str(delay))
sshCmd2.exec(hostName2,command,userName2,password2,False) sshCmd2.exec(hostName2,command,userName2,password2,False)
totalOffset = delay + maxOffset totalOffset = delay + maxOffset
time.sleep(2) time.sleep(2)
if(not findTimestamp(dio1.getTimestamp(0),dio1.getTimestamp(1),totalOffset)): if(not findTimestamp(dio1.getTimestamp(0),dio1.getTimestamp(1),totalOffset)):
raise raise
except SshCmdException as e: except SshCmdException as e:
sshCmd.printSshErrorCommand(e.strError,command) SshCmd.printSshErrorCommand(e.strError,command)
print("Test advanced error")
raise raise
except: except:
print("Test advanced error") print("Test advanced error")
...@@ -91,14 +92,17 @@ def main(configuration): ...@@ -91,14 +92,17 @@ def main(configuration):
userName1 = configuration["userName1"] userName1 = configuration["userName1"]
password1 = configuration["password1"] password1 = configuration["password1"]
interfaceName1 = configuration["interfaceName1"] interfaceName1 = configuration["interfaceName1"]
busIdSpec1 = configuration["busIdSpec1"]
hostName2 = configuration["hostName2"] hostName2 = configuration["hostName2"]
userName2 = configuration["userName2"] userName2 = configuration["userName2"]
password2 = configuration["password2"] password2 = configuration["password2"]
interfaceName2 = configuration["interfaceName2"] interfaceName2 = configuration["interfaceName2"]
busIdSpec2 = configuration["busIdSpec2"]
try: try:
print("Executing advanced DIO test") print("\nExecuting advanced DIO test")
testAdvDIO(hostName1,userName1,password1,interfaceName1,hostName2,userName2,password2,interfaceName2) print("This test needs White Rabbit working")
testAdvDIO(hostName1,userName1,password1,interfaceName1,busIdSpec1,hostName2,userName2,password2,interfaceName2,busIdSpec2)
print("Test advanced DIO: successful") print("Test advanced DIO: successful")
except: except:
print("Test advanced DIO: error") print("Test advanced DIO: error")
...@@ -115,11 +119,13 @@ if __name__ == '__main__': ...@@ -115,11 +119,13 @@ if __name__ == '__main__':
configuration["userName1"] = config.get('pc1',"userName") configuration["userName1"] = config.get('pc1',"userName")
configuration["password1"] = config.get('pc1',"password") configuration["password1"] = config.get('pc1',"password")
configuration["interfaceName1"] = config.get('pc1',"interfaceName") configuration["interfaceName1"] = config.get('pc1',"interfaceName")
configuration["busIdSpec1"] = config.get('pc1',"busIdSpec")
configuration["hostName2"] = config.get('pc2',"hostName") configuration["hostName2"] = config.get('pc2',"hostName")
configuration["userName2"] = config.get('pc2',"userName") configuration["userName2"] = config.get('pc2',"userName")
configuration["password2"] = config.get('pc2',"password") configuration["password2"] = config.get('pc2',"password")
configuration["interfaceName2"] = config.get('pc2',"interfaceName") configuration["interfaceName2"] = config.get('pc2',"interfaceName")
configuration["busIdSpec2"] = config.get('pc2',"busIdSpec")
main(configuration) main(configuration)
except configparser.Error as e: except configparser.Error as e:
print("Error load configuration:",e.message) print("Error load configuration:",e.message)
\ No newline at end of file
...@@ -50,4 +50,4 @@ if __name__ == '__main__': ...@@ -50,4 +50,4 @@ if __name__ == '__main__':
main(configuration) main(configuration)
except configparser.Error as e: except configparser.Error as e:
print("Error load configuration:",e.message) print("Error load configuration:",e.message)
\ No newline at end of file
...@@ -35,7 +35,7 @@ def findTimestamp(listStamp1,listStamp2,offset): ...@@ -35,7 +35,7 @@ def findTimestamp(listStamp1,listStamp2,offset):
return False return False
def tryChannel(hostName1,userName1,password1,interfaceName1,hostName2,userName2,password2,interfaceName2,channel): def tryChannel(hostName1,userName1,password1,busId1,hostName2,userName2,password2,busId2,channel):
""" """
Try the input and output of channel Try the input and output of channel
...@@ -43,18 +43,18 @@ def tryChannel(hostName1,userName1,password1,interfaceName1,hostName2,userName2, ...@@ -43,18 +43,18 @@ def tryChannel(hostName1,userName1,password1,interfaceName1,hostName2,userName2,
hostName1: ip remote host 1 hostName1: ip remote host 1
username1: user name host 1 username1: user name host 1
password1: password password1: password
interfaceName1 : interface name busId1: number PCIe bus PC 1
hostName2: ip remote host 2 hostName2: ip remote host 2
username2: user name host 2 username2: user name host 2
password2: password password2: password
interfaceName2 : interface name busId2: number PCIe bus PC 2
channel: number of channel to try(0 to 4) channel: number of channel to try(0 to 4)
Raises: Return:
error channel True if the channel fail, False otherwise
""" """
try: try:
dio1 = DIO(hostName1,userName1,password1,interfaceName1) dio1 = DIO(hostName1,userName1,password1,busId1)
dio2 = DIO(hostName2,userName2,password2,interfaceName2) dio2 = DIO(hostName2,userName2,password2,busId2)
dio1.configurePorts("pdddd") dio1.configurePorts("pdddd")
dio2.configurePorts("iiiii") dio2.configurePorts("iiiii")
dio1.clearTimestamps() dio1.clearTimestamps()
...@@ -78,13 +78,14 @@ def tryChannel(hostName1,userName1,password1,interfaceName1,hostName2,userName2, ...@@ -78,13 +78,14 @@ def tryChannel(hostName1,userName1,password1,interfaceName1,hostName2,userName2,
if(findTimestamp(dio1.getTimestamp(channel),dio2.getTimestamp(channel),maxOffset)): if(findTimestamp(dio1.getTimestamp(channel),dio2.getTimestamp(channel),maxOffset)):
print("Channel",channel,": ok in host:",hostName1,"and host:",hostName2) print("Channel",channel,": ok in host:",hostName1,"and host:",hostName2)
return False
else: else:
raise raise
else: else:
raise raise
except: except:
print("Channel",channel,": error in host:",hostName1,"or host:",hostName2) print("Channel",channel,": error in host:",hostName1,"or host:",hostName2)
raise return True
#--------------------------------------------------# #--------------------------------------------------#
...@@ -97,21 +98,23 @@ def main(configuration): ...@@ -97,21 +98,23 @@ def main(configuration):
hostName1 = configuration["hostName1"] hostName1 = configuration["hostName1"]
userName1 = configuration["userName1"] userName1 = configuration["userName1"]
password1 = configuration["password1"] password1 = configuration["password1"]
interfaceName1 = configuration["interfaceName1"] busIdSpec1 = configuration["busIdSpec1"]
hostName2 = configuration["hostName2"] hostName2 = configuration["hostName2"]
userName2 = configuration["userName2"] userName2 = configuration["userName2"]
password2 = configuration["password2"] password2 = configuration["password2"]
interfaceName2 = configuration["interfaceName2"] busIdSpec2 = configuration["busIdSpec2"]
try: error = False
print("Executing DIO test") numberChannels = 5
tryChannel(hostName1,userName1,password1,interfaceName1,hostName2,userName2,password2,interfaceName2,0)
tryChannel(hostName1,userName1,password1,interfaceName1,hostName2,userName2,password2,interfaceName2,1) print("\nExecuting DIO test")
tryChannel(hostName1,userName1,password1,interfaceName1,hostName2,userName2,password2,interfaceName2,2) print("This test needs White Rabbit working")
tryChannel(hostName1,userName1,password1,interfaceName1,hostName2,userName2,password2,interfaceName2,3) for i in range(numberChannels):
tryChannel(hostName1,userName1,password1,interfaceName1,hostName2,userName2,password2,interfaceName2,4) error |= tryChannel(hostName1,userName1,password1,busIdSpec1,hostName2,userName2,password2,busIdSpec2,i)
if(not error):
print("Test DIO: successful") print("Test DIO: successful")
except: else:
print("Test DIO: error") print("Test DIO: error")
if __name__ == '__main__': if __name__ == '__main__':
...@@ -125,12 +128,12 @@ if __name__ == '__main__': ...@@ -125,12 +128,12 @@ if __name__ == '__main__':
configuration["hostName1"] = config.get('pc1',"hostName") configuration["hostName1"] = config.get('pc1',"hostName")
configuration["userName1"] = config.get('pc1',"userName") configuration["userName1"] = config.get('pc1',"userName")
configuration["password1"] = config.get('pc1',"password") configuration["password1"] = config.get('pc1',"password")
configuration["interfaceName1"] = config.get('pc1',"interfaceName") configuration["busIdSpec1"] = config.get('pc1',"busIdSpec")
configuration["hostName2"] = config.get('pc2',"hostName") configuration["hostName2"] = config.get('pc2',"hostName")
configuration["userName2"] = config.get('pc2',"userName") configuration["userName2"] = config.get('pc2',"userName")
configuration["password2"] = config.get('pc2',"password") configuration["password2"] = config.get('pc2',"password")
configuration["interfaceName2"] = config.get('pc2',"interfaceName") configuration["busIdSpec2"] = config.get('pc2',"busIdSpec")
main(configuration) main(configuration)
except configparser.Error as e: except configparser.Error as e:
print("Error load configuration:",e.message) print("Error load configuration:",e.message)
\ No newline at end of file
...@@ -28,24 +28,27 @@ def configurationIpInterface(hostName,userName,password,busId,interfaceName,ip): ...@@ -28,24 +28,27 @@ def configurationIpInterface(hostName,userName,password,busId,interfaceName,ip):
""" """
try: try:
sshCmd = SshCmd() sshCmd = SshCmd()
#check network manager
command = "sudo service network-manager status | grep running"
value = sshCmd.exec(hostName,command,userName,password)
if ("running" in value):
print("\nWarning: The network manager is running on host %s, the test may not work correctly\n" % ip)
command = "sudo ifconfig " + interfaceName + " " + ip command = "sudo ifconfig " + interfaceName + " " + ip
sshCmd.exec(hostName,command,userName,password) sshCmd.exec(hostName,command,userName,password)
command = "ifconfig | grep " + ip + " | wc -l" command = "ifconfig | grep " + ip + " | wc -l"
value = sshCmd.exec(hostName,command,userName,password) value = sshCmd.exec(hostName,command,userName,password)
if (int(value) == 1): if (int(value) == 1):
vuart = Vuart(hostName,userName,password,busId) print("Configuration ip interface: ok on host:",hostName)
value = vuart.setIp(ip) else:
raise
if (("IP-address: " + str(ip)) in value):
print("Configuration ip interface: ok in host:",hostName)
else:
raise
except SshCmdException as e: except SshCmdException as e:
sshCmd.printSshErrorCommand(e.strError,command) sshCmd.printSshErrorCommand(e.strError,command)
print("Configuration ip interface: error in host:",hostName) print("Configuration ip interface: error on host:",hostName)
raise raise
except: except:
print("Configuration ip interface2: error in host:",hostName) print("Configuration ip interface: error on host:",hostName)
raise raise
...@@ -107,7 +110,8 @@ def main(configuration): ...@@ -107,7 +110,8 @@ def main(configuration):
interfaceName2 = configuration["interfaceName2"] interfaceName2 = configuration["interfaceName2"]
try: try:
print("Executing NIC test") print("\nExecuting NIC test")
print("This test needs the network manager stopped")
configurationIpInterface(hostName1,userName1,password1,busIdSpec1,interfaceName1,ipWR1) configurationIpInterface(hostName1,userName1,password1,busIdSpec1,interfaceName1,ipWR1)
configurationIpInterface(hostName2,userName2,password2,busIdSpec2,interfaceName2,ipWR2) configurationIpInterface(hostName2,userName2,password2,busIdSpec2,interfaceName2,ipWR2)
testIperf(hostName1,userName1,password1,ipWR2,hostName2,userName2,password2) testIperf(hostName1,userName1,password1,ipWR2,hostName2,userName2,password2)
......
...@@ -84,7 +84,7 @@ def checkTrackPhase(hostName,userName,password,busId): ...@@ -84,7 +84,7 @@ def checkTrackPhase(hostName,userName,password,busId):
""" """
try: try:
vuart = Vuart(hostName,userName,password,busId) vuart = Vuart(hostName,userName,password,busId)
numberTimesTry = 10 numberTimesTry = 15
i = 0 i = 0
while not vuart.isTrackPhase(): while not vuart.isTrackPhase():
if (i == numberTimesTry): if (i == numberTimesTry):
...@@ -114,7 +114,7 @@ def main(configuration): ...@@ -114,7 +114,7 @@ def main(configuration):
interfaceName2 = configuration["interfaceName2"] interfaceName2 = configuration["interfaceName2"]
try: try:
print("Executing WR test") print("\nExecuting WR test")
masterSpec1 = whoIsMaster(hostName1,userName1,password1,busIdSpec1) masterSpec1 = whoIsMaster(hostName1,userName1,password1,busIdSpec1)
masterSpec2 = whoIsMaster(hostName2,userName2,password2,busIdSpec2) masterSpec2 = whoIsMaster(hostName2,userName2,password2,busIdSpec2)
if (masterSpec1 == 1 or masterSpec2 == 1): if (masterSpec1 == 1 or masterSpec2 == 1):
...@@ -155,4 +155,4 @@ if __name__ == '__main__': ...@@ -155,4 +155,4 @@ if __name__ == '__main__':
main(configuration) main(configuration)
except configparser.Error as e: except configparser.Error as e:
print("Error load configuration:",e.message) print("Error load configuration:",e.message)
\ No newline at end of file
...@@ -26,8 +26,15 @@ class Vuart (): ...@@ -26,8 +26,15 @@ class Vuart ():
self.userName = userName self.userName = userName
self.password = password self.password = password
self.busId = busId self.busId = busId
self.command = "sudo spec-vuart -b " + str(busId) + " -c "
self.sshCmd = SshCmd() self.sshCmd = SshCmd()
self.command = ""
parse_dev = self.vUartCommand("lspci | grep CERN | cut -f2 -d :").split(".")
if (len(parse_dev) > 1):
self.command = "sudo wrpc-vuart -f /sys/bus/pci/devices/0000\:00\:%02x.0/0000" \
"\:%02x\:%02x.0/resource0 -o 0x20500 -c " % (int(busId,16),int(busId,16),int(parse_dev[0],16))
else:
print("Error: Spec does not detected on host: %s" % hostName)
raise
def setIp(self,ip): def setIp(self,ip):
""" """
...@@ -89,7 +96,7 @@ class Vuart (): ...@@ -89,7 +96,7 @@ class Vuart ():
error function error function
""" """
try: try:
command = "sfp\ detect" command = "sfp\ match"
return self.vUartCommand(command) return self.vUartCommand(command)
except: except:
print("Error sfp detect") print("Error sfp detect")
...@@ -184,4 +191,4 @@ class Vuart (): ...@@ -184,4 +191,4 @@ class Vuart ():
except SshCmdException as e: except SshCmdException as e:
self.sshCmd.printSshErrorCommand(e.strError) #print error command self.sshCmd.printSshErrorCommand(e.strError) #print error command
cleanup() cleanup()
raise raise
\ No newline at end of file
Subproject commit c26a9ff989db7d0ac0a6a4872bd0fcb81fdb29a1
Subproject commit 75f5007e599c7490169a9ebf95e94617d1866f63