Commit 0242e161 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

software: Add GPL to all scripts and make them executables

Signed-off-by: Theodor-Adrian Stana's avatarTheodor Stana <t.stana@cern.ch>
parent 268b229b
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Concatenate two bitstreams
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# This script takes two bitstreams as input and generates a combined bitstream
# for MultiBoot purposes that can be directly downloaded into the flash chip.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
import sys
import subprocess
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Clear CHxPCR registers on CONV-TTL-BLO
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# This script is used to clear the input channel counters on the CONV-TTL-BLO
# board.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
import time
import sys
import time
......@@ -29,12 +61,20 @@ if __name__ == "__main__":
except:
print("Unexpected error: ", sys.exc_info()[0])
# Clear channel counters and close
# Clear channel
testelma.write(slot, 0x0c, 0)
testelma.write(slot, 0x10, 0)
testelma.write(slot, 0x14, 0)
testelma.write(slot, 0x18, 0)
testelma.write(slot, 0x1c, 0)
testelma.write(slot, 0x20, 0)
# Print channel counter values, close and exit
print("CH1: %d" % testelma.read(slot, 0x0c))
print("CH2: %d" % testelma.read(slot, 0x10))
print("CH3: %d" % testelma.read(slot, 0x14))
print("CH4: %d" % testelma.read(slot, 0x18))
print("CH5: %d" % testelma.read(slot, 0x1c))
print("CH6: %d" % testelma.read(slot, 0x20))
testelma.close()
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Retrieve gateware version from CONV-TTL-BLO board
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# This script retrieves the value of the CONV-TTL-BLO status register and
# retrieves the GWVERS field of the register.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
import sys
sys.path.append("../ei2c")
from ei2c import *
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Manually trigger a pulse
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# This script can be used to manually trigger a pulse on the CONV-TTL-BLO
# channel of choice.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
import time
import sys
import time
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Read CHxPCR registers on CONV-TTL-BLO
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# This script is used to read the input channel counters on the CONV-TTL-BLO
# board.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
import time
import sys
import time
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Read the CONV-TTL-BLO board ID and current temperature from DS18B20 chip
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# The script implements some classes to communicate to the OpenCores One-Wire
# master core implemented inside the CONV-TTL-BLO and uses these classes to
# retrieve the board ID and the current temperature on-board the CONV-TTL-BLO.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
# Import system modules
import sys
import time
......
......@@ -19,7 +19,7 @@ contents. The output can be the prompt (stdout), or a file if the user selects
it. When the script is started, it asks for the slot number (as usual), then
whether it should output to a file, and the filename if it should:
%> python rdtb.py
%> ./rdtb.py
Slot no.: 1
Output samples to file? (y/n) y
File name (with extension): myfile.txt
......@@ -62,6 +62,6 @@ Note that the first sample in the output is always the first timestamp value.
To run (considering the output file in the rdtb.py section):
%> python tsdiff.py
%> ./tsdiff.py
Input file name (with extension): myfile.txt
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Read the CONV-TTL-BLO timetag buffer
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# This script demonstrates reading the CONV-TTL-BLO timetag buffer down to the
# last sample.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
import sys
sys.path.append("../../ei2c")
from ei2c import *
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Get the difference between two timetag buffer samples
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# Working together with the rdtb.py script and using an output file produced
# by this script, this script reads out each sample and works out the
# difference in time between two timetag samples, warning if these are lower
# than the minimum expected time difference between two pulses, thus showing
# which channel caused a pulse miss (PMISS) system error.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
if __name__ == "__main__":
# seconds, nanoseconds
s = 0
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Get the current timestamp counter value
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# This script reads the TVLR and TVHR registers and prints their value to stdout.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
import sys
sys.path.append("../../ei2c")
import time
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Set the timestamp counter value
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# This script writes the TVLR and TVHR registers to set the new internal
# timestamp counter value.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
import sys
sys.path.append("../../ei2c")
import time
......@@ -34,6 +66,6 @@ if __name__ == "__main__":
testelma.write(slot, 0x24, s & 0xffffffff)
if s > 2**32-1:
testelma.write(slot, 0x28, s >> 32)
testelma.close()
......@@ -13,7 +13,7 @@ chunks to the flash chip via the FPGA.
To run it:
%> python multiboot.py
%> ./multiboot.py
Crate IP or hostname: <give IP or hostname of crate with CONV-TTL-BLO>
Username: <give crate username for Telnet login>
Password: <give password for Telnet login>
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# MultiBoot example script
......@@ -45,10 +46,9 @@
# TODO: -
#===============================================================================
import random
import sys
import time
sys.path.append("../ei2c")
import time
from ei2c import *
import ei2cdefine
from ei2cexcept import *
......@@ -286,7 +286,7 @@ def _iprog(addr):
if (time.time() >= t1):
print "Timeout, IPROG unsuccessful!"
break
if ((testelma.read(slot, 0x4) & 0xFF) == 0x00):
if ((testelma.read(slot, 0x4) & 0xF0) == 0x00):
print "IPROG unsuccessful, fallback to Golden bitstream occured!"
break
else:
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Read the converter board flash via MultiBoot logic
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# This script uses the wb_xil_multiboot module implemented inside a converter
# board FPGA to read the contents of the on-board flash between two addresses
# choosed by the user.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
import sys
sys.path.append("../ei2c")
from ei2c import *
......
......@@ -7,7 +7,7 @@ pulses on.
To run, you first need a CONV-TTL-BLO with a pulsetest gateware. Then:
%> python pulsetest.py
%> ./pulsetest.py
Slot no.: <give the slot number of the pulsetest CONV-TTL-BLO>
Enable channel 1? (y/n) y
freq (Hz): 1
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Pulse test script
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
#
# date of creation:
#
# version: 1.0
#
# description:
# This script works in conjunction with the pulsetest (v15.15) FPGA gateware
# and drives the pulse generators to generate pulses as per the user's desire.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file 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 2.1 of the License, or (at your
# option) any later version. This source 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
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
import time
import sys
import time
......
......@@ -6,7 +6,7 @@ gateware to read and write values to various RAM addresses.
To run:
%> python regtest.py
%> ./regtest.py
Slot no.: <give slot number>
How long would you like to run the test?
hrs: <give number of hours>
......
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Register test for CONV-TTL-BLO
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment