Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
AIDA-2020 TLU - Gateware
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
AIDA-2020 TLU - Gateware
Commits
b198f8bd
Commit
b198f8bd
authored
Sep 02, 2020
by
David Cussans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deleting more SVN dirs
parent
3712a10a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
0 additions
and
483 deletions
+0
-483
all-wcprops
..._v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/all-wcprops
+0
-29
entries
.../TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/entries
+0
-164
bandwidthRxTest.py.svn-base
..._pre2A/scripts/.svn/prop-base/bandwidthRxTest.py.svn-base
+0
-5
configureJumboMac.py.svn-base
...re2A/scripts/.svn/prop-base/configureJumboMac.py.svn-base
+0
-5
example1.py.svn-base
...s_1_5_0_pre2A/scripts/.svn/prop-base/example1.py.svn-base
+0
-5
soakTest.py.svn-base
...s_1_5_0_pre2A/scripts/.svn/prop-base/soakTest.py.svn-base
+0
-5
bandwidthRxTest.py.svn-base
..._pre2A/scripts/.svn/text-base/bandwidthRxTest.py.svn-base
+0
-54
configureJumboMac.py.svn-base
...re2A/scripts/.svn/text-base/configureJumboMac.py.svn-base
+0
-32
example1.py.svn-base
...s_1_5_0_pre2A/scripts/.svn/text-base/example1.py.svn-base
+0
-33
soakTest.py.svn-base
...s_1_5_0_pre2A/scripts/.svn/text-base/soakTest.py.svn-base
+0
-151
No files found.
AIDA_tlu/legacy/TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/all-wcprops
deleted
100644 → 0
View file @
3712a10a
K 25
svn:wc:ra_dav:version-url
V 39
/svn/!svn/ver/934/trunk/PyChips/scripts
END
example1.py
K 25
svn:wc:ra_dav:version-url
V 51
/svn/!svn/ver/499/trunk/PyChips/scripts/example1.py
END
soakTest.py
K 25
svn:wc:ra_dav:version-url
V 51
/svn/!svn/ver/934/trunk/PyChips/scripts/soakTest.py
END
bandwidthRxTest.py
K 25
svn:wc:ra_dav:version-url
V 58
/svn/!svn/ver/499/trunk/PyChips/scripts/bandwidthRxTest.py
END
configureJumboMac.py
K 25
svn:wc:ra_dav:version-url
V 60
/svn/!svn/ver/863/trunk/PyChips/scripts/configureJumboMac.py
END
AIDA_tlu/legacy/TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/entries
deleted
100644 → 0
View file @
3712a10a
10
dir
1570
https://cactus.hepforge.org/svn/trunk/PyChips/scripts
https://cactus.hepforge.org/svn
2011-12-22T16:42:29.517135Z
934
frazier
18a17b70-165d-4f71-a96d-00e1b61b3a60
example1.py
file
2013-07-29T17:57:10.000000Z
90ebe4b8a9f33d5d7e11431d91cdf4f1
2011-06-21T22:29:49.331383Z
499
frazier
has-props
1878
soakTest.py
file
2013-07-29T17:57:10.000000Z
10931df3fa75c627980d8aed235af372
2011-12-22T16:42:29.517135Z
934
frazier
has-props
6865
bandwidthRxTest.py
file
2013-07-29T17:57:10.000000Z
2155affb31538e0fffd2ca21850e2da9
2011-06-21T22:29:49.331383Z
499
frazier
has-props
1542
configureJumboMac.py
file
2013-07-29T17:57:10.000000Z
e4476a2f4ee79e1e131e74da9e4ed9d8
2011-11-01T16:40:33.255597Z
863
frazier
has-props
1223
AIDA_tlu/legacy/TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/prop-base/bandwidthRxTest.py.svn-base
deleted
100644 → 0
View file @
3712a10a
K 13
svn:mime-type
V 10
text/plain
END
AIDA_tlu/legacy/TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/prop-base/configureJumboMac.py.svn-base
deleted
100644 → 0
View file @
3712a10a
K 13
svn:mime-type
V 10
text/plain
END
AIDA_tlu/legacy/TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/prop-base/example1.py.svn-base
deleted
100644 → 0
View file @
3712a10a
K 13
svn:mime-type
V 10
text/plain
END
AIDA_tlu/legacy/TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/prop-base/soakTest.py.svn-base
deleted
100644 → 0
View file @
3712a10a
K 13
svn:mime-type
V 10
text/plain
END
AIDA_tlu/legacy/TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/text-base/bandwidthRxTest.py.svn-base
deleted
100644 → 0
View file @
3712a10a
from PyChipsUser import *
from datetime import datetime
from os import environ
import math
#chipsLog.setLevel(logging.DEBUG)
#######################
### TEST PARAMETERS ###
hostIP = "localhost"
hostPort = 50001
hostRamName = "BigTestRam"
testDepth = 350
testIterations = 10000
#######################
addrTable = AddressTable("../addressTables/davesFirmwareSoakTestAddrTable.txt")
testBoard = ChipsBusUdp(addrTable, hostIP, hostPort)
# Fill up the host's RAM with something, just so we can see its working correctly
# when in debug mode
writeBuf = []
for iVal in range(testDepth):
writeBuf.append(iVal)
testBoard.blockWrite(hostRamName, writeBuf)
print "Read-bandwidth test is running..."
# Start the clock
startTime = datetime.now()
# Run the test
for iRead in range(testIterations):
testBoard.blockRead(hostRamName, testDepth)
# Stop the clock
stopTime = datetime.now()
# Calculate the total IPbus payload actually transferred in kilobytes, excluding all headers, etc
totalPayloadKB = testIterations * testDepth / 256.
# Calculate the total transfer time in seconds
totalTime = stopTime-startTime
totalSeconds = (totalTime.days*86400) + totalTime.seconds + (totalTime.microseconds/1000000.)
dataRateKB_s = totalPayloadKB/totalSeconds
print "\nRead Bandwidth Results:"
print "-----------------------\n"
print "Total IPbus payload transferred = %.2f KB" % totalPayloadKB
print "Total time taken = %.2f s" % totalSeconds
print "Average read bandwidth = %.2f KB/s" % dataRateKB_s
AIDA_tlu/legacy/TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/text-base/configureJumboMac.py.svn-base
deleted
100644 → 0
View file @
3712a10a
# Configures the Ethernet MAC to use jumbo frames, when using Dave Newbold's default firmware.
#
# Robert Frazier, Oct 2011
from PyChipsUser import *
#chipsLog.setLevel(logging.DEBUG) # Uncomment for debug output!
# ******************************************************
# **** Set IP and port number of board in question ****
boardIpAddr = "192.168.200.32" # TODO: make this a command line parameter...
boardPortNum = 50001
# ******************************************************
if __name__ == '__main__':
addrTable = AddressTable("../addressTables/davesFirmwareSoakTestAddrTable.txt")
board = ChipsBusUdp(addrTable, boardIpAddr, boardPortNum)
board.write("MacHostBusPtr", 0x240)
result = board.read("MacHostBusReg")
print "Receiver register is set to:", hex(result)
print "Writing back previous value with bit 30 set high..."
board.write("MacHostBusReg", (result | 0x40000000))
print "...done."
board.write("MacHostBusPtr", 0x280)
result = board.read("MacHostBusReg")
print "Transmitter register is set to:", hex(result)
print "Writing back previous value with bit 30 set high..."
board.write("MacHostBusReg", (result | 0x40000000))
print "...done."
AIDA_tlu/legacy/TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/text-base/example1.py.svn-base
deleted
100644 → 0
View file @
3712a10a
# Import the PyChips code - PYTHONPATH must be set to the PyChips installation src folder!
from PyChipsUser import *
##################################################################################################
### Uncomment one of the following two lines to turn on verbose or very-verbose debug modes. ###
### These debug modes allow you to see the packets being sent and received. ###
##################################################################################################
#chipsLog.setLevel(logging.DEBUG) # Verbose logging (see packets being sent and received)
# Read in an address table by creating an AddressTable object (Note the forward slashes, not backslashes!)
addrTable = AddressTable("../addressTables/davesFirmwareSoakTestAddrTable.txt")
# Create a ChipsBus bus to talk to your board.
# These require an address table object, an IP address and a port number
myBoard = ChipsBusUdp(addrTable, "localhost", 50001) # Change "localhost" to an IP address like "192.168.10.1", etc
# Perform some basic single-register reads and writes.
# Note that single-register reads and writes can be done on registers with a mask.
# See: help(ChipsBusUdp.read) and help(ChipsBusUdp.write) for more info on the below.
myBoard.write("Test", 0xdeadbeef)
print "'Test' register value is:", hex(myBoard.read("Test"))
myBoard.write("Test", 0xcafebabe)
print "'Test' register value is now:", hex(myBoard.read("Test"))
# Perform some block reads/writes:
# See: help(ChipsBusUdp.blockWrite) and help(ChipsBusUdp.blockRead) for more info
myBoard.blockWrite("BigTestRam", [0xdeadbeef, 0xcafebabe, 0x0ddba115, 0xbeefcafe])
blockReadResult = myBoard.blockRead("BigTestRam", 4) # 4 is the read depth.
print "\nBlock read result is:", uInt32HexListStr(blockReadResult)
# For further details on the basic API, please see: help(ChipsBusUdp)
AIDA_tlu/legacy/TLU_v1c/scripts/PyChips_1_5_0_pre2A/scripts/.svn/text-base/soakTest.py.svn-base
deleted
100644 → 0
View file @
3712a10a
#! /usr/bin/env python
#--------------------------------------------------------------
# Soak-tester for Dave Newbold's default/example IPbus firmware
#
# Robert Frazier, March 2011
#--------------------------------------------------------------
# Python imports
import
sys
from
optparse
import
OptionParser
from
random
import
random
from
time
import
asctime
import
os
def
getRandU32Value
():
"""Returns a random unsigned 32-bit value"""
return
int
(
random
()
*
0xffffffff
)
def
getRandU32List
(
listSize
):
"""Returns a list of length listSize of random U32 values"""
result
=
[]
for
i
in
range
(
listSize
):
result
.
append
(
getRandU32Value
())
return
result
def
screenAndLog
(
logFile
,
msg
):
"""Prints a message to both the screen and to a logFile handle"""
print
msg
logFile
.
write
(
msg
+
"
\n
"
)
logFile
.
flush
()
os
.
fsync
(
logFile
)
def
findAddrTable
():
"""A hacky function that attempts to find and return the soakTestAddrTable.txt file-path.
Returns False if it can't find it.
"""
for
item
in
sys
.
path
:
if
item
.
find
(
"PyChips"
)
>=
0
or
item
.
find
(
"pychips"
)
>=
0
:
if
item
.
find
(
"src"
)
>=
0
:
file
=
item
+
"/../addressTables/soakTestAddrTable.txt"
if
os
.
path
.
exists
(
file
)
and
os
.
path
.
isfile
(
file
):
return
file
return
False
if
__name__
==
'__main__'
:
# Option parser stuff
parser
=
OptionParser
(
usage
=
"
%
prog target_ip_address [options]
\n\n
"
"IPbus Soak Tester
\n
"
"-----------------"
)
parser
.
add_option
(
"-i"
,
"--iterations"
,
action
=
"store"
,
type
=
"int"
,
dest
=
"maxIterations"
,
default
=
10000
,
help
=
"Number of test iterations (default =
%
default) to perform; zero or less indicates the test should run ~indefinitely."
)
parser
.
add_option
(
"-p"
,
"--port"
,
action
=
"store"
,
type
=
"int"
,
dest
=
"port"
,
default
=
50001
,
help
=
"Port number of the target device you wish to soak-test (default =
%
default)"
)
parser
.
add_option
(
"-f"
,
"--addrTableFile"
,
action
=
"store"
,
type
=
"string"
,
dest
=
"addrTableFile"
,
help
=
"Manually specify the complete filepath to soakTestAddrTable.txt if it can't automatically be found"
)
parser
.
add_option
(
"-v"
,
"--verbose"
,
action
=
"store_true"
,
dest
=
"verbose"
,
default
=
False
,
help
=
"turn on verbose mode: prints outgoing/incoming packets to the console"
)
(
options
,
args
)
=
parser
.
parse_args
()
# Find out if they have or haven't supplied an IP address
if
len
(
args
)
!=
1
:
parser
.
error
(
"
\n
You must supply a target IP address when running this script!
\n
"
\
"For example:
\n\t
./soakTest.py 192.168.200.16
\n\t
./soakTest.py localhost
\n
"
\
"For more help and options, do:
\n\t
./soakTest.py -h"
)
ipAddr
=
args
[
0
]
# Open up a log file.
logName
=
'/tmp/soakTestLog_'
+
ipAddr
+
'.txt'
log
=
open
(
logName
,
'w'
)
screenAndLog
(
log
,
"
\n
Soak-Test Session Started at "
+
asctime
()
+
\
"
\n
-----------------------------------------------------
\n
"
)
# Either get the address table filename from the command line option,
# or try to automatically find it
if
options
.
addrTableFile
!=
None
:
addrTableFile
=
options
.
addrTableFile
else
:
addrTableFile
=
findAddrTable
()
if
addrTableFile
:
screenAndLog
(
log
,
"Using the following automatically located address-table file:
\n
"
+
addrTableFile
+
"
\n
"
)
else
:
screenAndLog
(
log
,
"Failed to locate 'soakTestAddrTable.txt' within your PyChips installation.
\n
"
\
"Please specify the complete path to this file using the -f option next
\n
"
\
"time you run this soak test script."
)
sys
.
exit
()
# Now import PyChips
from
PyChipsUser
import
*
# Set the logger up according to verbosity flag
if
options
.
verbose
:
chipsLog
.
setLevel
(
logging
.
DEBUG
)
else
:
chipsLog
.
setLevel
(
logging
.
INFO
)
# Create the UDP IPbus to the target device being soak-tested
board
=
ChipsBusUdp
(
AddressTable
(
addrTableFile
),
ipAddr
,
options
.
port
)
# If the user specified zero or less iterations, this means run ~indefinitely
if
options
.
maxIterations
<
1
:
options
.
maxIterations
=
1000000000000
# Counters
testIterationCount
=
0
writeReadErrors
=
0
blockWriteReadErrors
=
0
exceptionCount
=
0
loop
=
True
print
"
\n
Log output also at:"
,
logName
print
"Press ctrl-c to terminate test."
print
"Running...
\n
"
while
testIterationCount
<
options
.
maxIterations
:
try
:
testIterationCount
+=
1
if
(
testIterationCount
%
1000
==
0
):
screenAndLog
(
log
,
"Iteration "
+
repr
(
testIterationCount
))
testVal
=
getRandU32Value
()
board
.
write
(
"Test"
,
testVal
)
readResult
=
board
.
read
(
"Test"
)
if
readResult
!=
testVal
:
screenAndLog
(
log
,
"Write/Read error occurred! Expected "
+
hex
(
testVal
)
+
" but got "
+
hex
(
readResult
))
writeReadErrors
+=
1
blockTestVal
=
getRandU32List
(
16
)
board
.
blockWrite
(
"BigTestRam"
,
blockTestVal
)
blockReadResult
=
board
.
blockRead
(
"BigTestRam"
,
16
)
if
blockTestVal
!=
blockReadResult
:
screenAndLog
(
log
,
"Block Write/Read error occurred!"
\
"
\n\t
Expected Received"
\
"
\n\t
-------- --------"
\
+
uInt32HexDualListStr
(
blockTestVal
,
blockReadResult
))
blockWriteReadErrors
+=
1
if
writeReadErrors
>=
30
or
blockWriteReadErrors
>=
30
:
screenAndLog
(
log
,
"
\n
Too many errors have occurred - ending test program!"
)
break
except
KeyboardInterrupt
:
screenAndLog
(
log
,
"
\n
Keyboard interrupt (ctrl-c) received - ending test program!"
)
break
except
ChipsException
,
what
:
screenAndLog
(
log
,
"An exception occurred at "
+
asctime
()
+
":
\n\t
"
+
str
(
what
))
exceptionCount
+=
1
if
exceptionCount
>=
30
:
screenAndLog
(
log
,
"
\n
Too many exceptions have occurred - ending test program!"
)
break
screenAndLog
(
log
,
"
\n\n
-----------------
\n
Test Summary:
\n
"
)
screenAndLog
(
log
,
"
\t
Total Test Iterations = "
+
repr
(
testIterationCount
))
screenAndLog
(
log
,
"
\t
Total Write/Read Errors = "
+
repr
(
writeReadErrors
))
screenAndLog
(
log
,
"
\t
Total Block Write/Read Errors = "
+
repr
(
blockWriteReadErrors
))
screenAndLog
(
log
,
"
\t
Total ChipsBus Exceptions during test = "
+
repr
(
exceptionCount
))
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