Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL Blocking - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL Blocking - Testing
Commits
f5b60413
Commit
f5b60413
authored
Dec 05, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fm: Added support for Run One Test script
parent
572fc240
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
7 deletions
+48
-7
Makefile
fm/pts/Makefile
+1
-0
jpts.py
fm/pts/python/jpts.py
+1
-1
one.py
fm/pts/python/one.py
+46
-6
No files found.
fm/pts/Makefile
View file @
f5b60413
...
...
@@ -19,6 +19,7 @@ all:
cp
ubuntu/$(BOARD)/pyts/pts.py
ubuntu/$(BOARD)/pts
cp
ubuntu/$(BOARD)/pyts/jpts.py
ubuntu/$(BOARD)/jpts
cp
ubuntu/$(BOARD)/pyts/one.py
ubuntu/$(BOARD)/one
ln
-s
pyts/dac_vcxo_pll.py
ubuntu/$(BOARD)/test01.py
ln
-s
pyts/leds.py
ubuntu/$(BOARD)/test02.py
ln
-s
pyts/ttl_pulse_switch.py
ubuntu/$(BOARD)/test03.py
...
...
fm/pts/python/jpts.py
View file @
f5b60413
...
...
@@ -108,7 +108,7 @@ if __name__ == '__main__':
parser
.
add_option
(
"-l"
,
"--lun"
,
help
=
"Logical Unit Number"
,
type
=
"int"
,
default
=
ELMASLOT
,
dest
=
"lun"
)
parser
.
add_option
(
"-s"
,
"--snum"
,
help
=
"Serial number(s)"
,
dest
=
"snum"
,
action
=
"store"
,
nargs
=
2
,
default
=
(
"0"
,
"0"
))
parser
.
add_option
(
"-n"
,
"--name"
,
help
=
"Board name"
,
dest
=
"board_name"
,
default
=
"ttlbl"
)
parser
.
add_option
(
"-n"
,
"--name"
,
help
=
"Board name"
,
dest
=
"board_name"
,
default
=
BOARD
)
parser
.
add_option
(
"-b"
,
"--bus"
,
help
=
"Bus VME/PCI/SKT"
,
dest
=
"bus_type"
,
default
=
"SKT"
)
parser
.
add_option
(
"-o"
,
"--outdir"
,
help
=
"Path to log directory"
,
dest
=
"dir_name"
,
default
=
"."
)
parser
.
add_option
(
"-d"
,
"--debug"
,
help
=
"Debug Option"
,
dest
=
"debug"
,
default
=
False
,
action
=
"store_true"
)
...
...
fm/pts/python/one.py
View file @
f5b60413
...
...
@@ -9,31 +9,71 @@ import subprocess
import
re
sys
.
path
.
append
(
'.'
)
sys
.
path
.
append
(
"pyts/"
)
##-------------------------------------------------------------------------------------------------
## Method to turn on the VME crate.
##-------------------------------------------------------------------------------------------------
## It calls the men-on script which sends the necessary SMTP commands to the ELMA crate to turn on
## power to the VME backplane.
##-------------------------------------------------------------------------------------------------
def
men_on
():
print
(
"Switching on the ELMA crate"
)
subprocess
.
call
(
"shell/men-on"
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
time
.
sleep
(
1
)
##-------------------------------------------------------------------------------------------------
## Method to turn off the VME crate.
##-------------------------------------------------------------------------------------------------
## It calls the men-off script which sends the necessary SMTP commands to the ELMA crate to turn off
## power to the VME backplane.
##-------------------------------------------------------------------------------------------------
def
men_off
():
print
(
"Switching off the ELMA crate"
)
subprocess
.
call
(
"shell/men-off"
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
time
.
sleep
(
1
)
##-------------------------------------------------------------------------------------------------
## Main "method" of PTS
##-------------------------------------------------------------------------------------------------
if
__name__
==
'__main__'
:
print
"
\n
Hello and Welcome to the TTLBL PTS Run One Test!
\n
"
fnull
=
open
(
os
.
devnull
,
"w"
)
men_off
()
tsts
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
10
,
12
,
13
,
14
,
15
,
16
,
17
]
tnum
=
input
(
"--> Which test number:"
)
tnum
=
input
(
"--> Which test number:
"
)
if
tnum
in
tsts
:
pass
else
:
print
"Sorry that test can't be run"
sys
.
exit
(
1
)
tcnt
=
input
(
"--> How many times to run test:"
)
tcnt
=
input
(
"--> How many times to run test:
"
)
if
tcnt
<
0
:
print
"Sorry bad run count"
sys
.
exit
(
1
)
cmd
=
"ssh -X pts@men /home/pts/ubuntu/ttlbl/jpts-run-one
%
d
%
d "
%
(
tnum
,
tcnt
)
subprocess
.
call
(
cmd
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
men_on
()
print
"Loading FPGA bitstream..."
ret
=
subprocess
.
call
(
"cd boot; ./program"
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
time
.
sleep
(
1
)
if
(
ret
!=
0
):
print
"ERROR: Bitstream download fail. Check JTAG connectivity."
else
:
# Run JPTS
cmd
=
"./jpts
%
d,
%
d"
%
(
tnum
,
tcnt
)
subprocess
.
call
(
cmd
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
cmd
=
"more log/*.log"
subprocess
.
call
(
cmd
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
cmd
=
"more /home/pts/ubuntu/ttlbl/log/*.log"
subprocess
.
call
(
cmd
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
men_off
()
msg
=
"--> To exit PTS Run One Test, type 'ok': "
ok
=
raw_input
(
msg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment