Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
8aa97c1c
Commit
8aa97c1c
authored
Sep 04, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mistakes in parse-saleae-measures script
parent
8b9f44aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
scripts/parse-saleae-measures.py
scripts/parse-saleae-measures.py
+19
-18
No files found.
scripts/parse-saleae-measures.py
View file @
8aa97c1c
...
...
@@ -7,11 +7,6 @@ def parseLine(l):
(
ts
,
ch0
,
ch1
,
*
x
)
=
l
.
split
(
", "
)
#tts = int(float(ts) * 10**9)
#if tts == 413415271100:
# print(ts)
# exit()
ts
=
int
(
float
(
ts
)
*
10
**
9
)
return
(
ts
,
int
(
ch0
),
int
(
ch1
))
...
...
@@ -38,9 +33,6 @@ def parsePulses(filename):
prevCh0Ts
=
ts
if
ch1
==
1
:
if
prevCh1Ts
==
-
1
or
(
ts
-
prevCh1Ts
)
>
9000
*
1000
:
#if ts == 413415775140:
# print(prevCh1Ts)
# exit()
ch1Ts
.
append
(
ts
)
prevCh1Ts
=
ts
...
...
@@ -57,11 +49,6 @@ def parsePulses(filename):
max_d
=
max
(
deltas
)
#for i in range(min(len(ch0Ts), len(ch1Ts))):
# if (ch0Ts[i] - ch1Ts[i]) == max_d:
# print((ch0Ts[i], ch1Ts[i]))
# exit()
return
deltas
print
(
"IO error"
)
exit
()
...
...
@@ -70,8 +57,22 @@ def parseToggles(filename):
with
open
(
filename
,
"r"
)
as
f
:
lines
=
[
l
for
l
in
f
]
lines
=
lines
[
1
:]
values
=
[
line_to_ts
(
l
)
for
l
in
lines
]
lines
=
lines
[
3
:]
values
=
[
parseLine
(
l
)
for
l
in
lines
]
# If both signals happenned at the same, they get merged at export
# We don't want this, so here we undo this merge
(
pt
,
pc1
,
pc2
)
=
values
[
0
]
i
=
0
while
i
<
len
(
values
):
(
t
,
c1
,
c2
)
=
values
[
i
]
if
c1
!=
pc1
and
c2
!=
pc2
:
values
.
insert
(
i
,
(
t
,
c1
,
c2
))
i
+=
1
(
pt
,
pc1
,
pc2
)
=
values
[
i
]
i
+=
1
values
=
[
t
for
(
t
,
*
x
)
in
values
]
deltas
=
[]
start
=
1
...
...
@@ -82,7 +83,7 @@ def parseToggles(filename):
if
(
i
+
1
)
<
len
(
values
):
if
(
values
[
i
]
-
values
[
i
-
1
])
>
(
values
[
i
+
1
]
-
values
[
i
]):
print
(
"Instruction missed a
t line {} ?"
.
format
(
i
))
print
(
"Instruction missed a
round line {} ? ({} - {} > {} - {})"
.
format
(
i
,
values
[
i
]
/
10
**
9
,
values
[
i
-
1
]
/
10
**
9
,
values
[
i
+
1
]
/
10
**
9
,
values
[
i
]
/
10
**
9
))
exit
()
deltas
.
append
(
values
[
i
]
-
values
[
i
-
1
])
...
...
@@ -114,8 +115,8 @@ def generateHistogram(deltas):
def
parse_args
():
parser
=
argparse
parser
=
argparse
.
ArgumentParser
(
description
=
'Measure analysis'
)
parser
.
add_argument
(
'-t'
,
nargs
=
1
,
required
=
False
,
help
=
'import json measures'
)
parser
.
add_argument
(
'-p'
,
nargs
=
1
,
required
=
False
,
help
=
'import json measures'
)
parser
.
add_argument
(
'-t'
,
nargs
=
1
,
required
=
False
,
help
=
'import
shuttle-a20
json measures'
)
parser
.
add_argument
(
'-p'
,
nargs
=
1
,
required
=
False
,
help
=
'import
shuttle
json measures'
)
args
=
parser
.
parse_args
()
...
...
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