Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
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
Production Test Suite
Commits
5c32e11a
Commit
5c32e11a
authored
Jan 09, 2017
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to assign MAC address to SPEC in test03 of the PTS
parent
180efb56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
spec.sh
spec.sh
+13
-1
test03.py
test/spec/python/test03.py
+26
-2
No files found.
spec.sh
View file @
5c32e11a
...
@@ -21,6 +21,10 @@ if [ x$extra_serial = x"" ]; then
...
@@ -21,6 +21,10 @@ if [ x$extra_serial = x"" ]; then
extra_serial
=
0000
extra_serial
=
0000
fi
fi
# MAC address for the board
echo
-n
"Please, input MAC addres (use XX:XX:XX:XX:XX:XX format): "
read
mac_addr
tmp
=
""
tmp
=
""
echo
-n
"--------------------------------------------------------------
\n
"
echo
-n
"--------------------------------------------------------------
\n
"
echo
-n
"Remove the jumper from the board!
\n
"
echo
-n
"Remove the jumper from the board!
\n
"
...
@@ -28,7 +32,15 @@ echo -n "Press enter to continue...\n"
...
@@ -28,7 +32,15 @@ echo -n "Press enter to continue...\n"
read
tmp
read
tmp
echo
-n
"--------------------------------------------------------------
\n
"
echo
-n
"--------------------------------------------------------------
\n
"
sudo
./pts.py
-b
SPEC
-s
$serial
-e
$extra_serial
-t
./test/spec/python
-l
$LOGDIR
00 01 02 03 04 05 06 07 08 09 10 12
# Assemble pts.py call with parameters for SPEC
cmd
=
"sudo ./pts.py -b SPEC -s "
$serial
" -e "
$extra_serial
if
[
!
x
$mac_addr
=
x
""
]
;
then
cmd
=
$cmd
" -m "
$mac_addr
fi
cmd
=
$cmd
" -t./test/spec/python -l "
$LOGDIR
" 00 01 02 03 04 05 06 07 08 09 10 12"
# Execute pts.py
$cmd
echo
-n
"Press enter to exit... "
echo
-n
"Press enter to exit... "
...
...
test/spec/python/test03.py
View file @
5c32e11a
...
@@ -13,11 +13,15 @@ import os
...
@@ -13,11 +13,15 @@ import os
import
os.path
import
os.path
from
ctypes
import
*
from
ctypes
import
*
from
ptsexcept
import
*
from
ptsexcept
import
*
sys
.
path
.
append
(
'sdbfs'
)
import
gen_flash_image
"""
"""
test03: loads a firmware file to Flash memory and boots from it. The FW just blinks the leds.
test03: loads a firmware file to Flash memory and boots from it. The FW just blinks the leds.
"""
"""
mac_filename
=
'mac.tmp'
class
CGennumFlash
:
class
CGennumFlash
:
GENNUM_FLASH
=
1
;
GENNUM_FLASH
=
1
;
GENNUM_FPGA
=
2
;
GENNUM_FPGA
=
2
;
...
@@ -33,6 +37,26 @@ class CGennumFlash :
...
@@ -33,6 +37,26 @@ class CGennumFlash :
def
main
(
default_directory
=
'.'
):
def
main
(
default_directory
=
'.'
):
fpga_firmware
=
"/test_flash.bin"
# first try to read MAC address form file
filename
=
os
.
path
.
join
(
default_directory
,
mac_filename
)
print
"Trying to open "
+
filename
try
:
macfile
=
open
(
filename
,
'r'
)
except
IOError
:
print
"MAC address not assigned..."
mac
=
""
else
:
mac
=
macfile
.
read
()
macfile
.
close
()
os
.
remove
(
filename
)
print
"MAC: "
+
mac
gen_flash_image
.
gen_sdb_image
(
"flash"
,
mac
,
default_directory
+
"/test_flash.bin"
,
default_directory
+
"/test_flash_mac.bin"
)
fpga_firmware
=
"/test_flash_mac.bin"
gennum
=
rr
.
Gennum
();
gennum
=
rr
.
Gennum
();
flash
=
CGennumFlash
(
gennum
,
default_directory
);
flash
=
CGennumFlash
(
gennum
,
default_directory
);
...
@@ -43,8 +67,8 @@ def main (default_directory='.'):
...
@@ -43,8 +67,8 @@ def main (default_directory='.'):
raise
PtsError
(
'Error: version of the flash is not correct: '
+
version
);
raise
PtsError
(
'Error: version of the flash is not correct: '
+
version
);
# Load a new firmware to the Flash memory.
# Load a new firmware to the Flash memory.
print
"Starting the process to load a FW into Flash memory"
print
"Starting the process to load a FW
("
+
default_directory
+
fpga_firmware
+
"
into Flash memory"
flash
.
lib
.
load_mcs_to_flash
(
default_directory
+
"/test_flash.bin"
);
flash
.
lib
.
load_mcs_to_flash
(
default_directory
+
fpga_firmware
);
time
.
sleep
(
1
);
time
.
sleep
(
1
);
print
"Forcing to load FW from Flash memory to FPGA"
print
"Forcing to load FW from Flash memory to FPGA"
...
...
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