Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 2cha
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
FMC DEL 1ns 2cha
Commits
abaf1726
Commit
abaf1726
authored
Aug 16, 2016
by
Jan Pospisil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added possibility to write less data to the memories (for shorter SV simulation)
parent
cd3093e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
FFPG_driver.py
sw/FFPG_driver.py
+19
-13
No files found.
sw/FFPG_driver.py
View file @
abaf1726
...
...
@@ -21,7 +21,7 @@ class ConColors:
m
=
encoreio
.
Module
.
get_instance
(
'fmc_fpg'
,
0
)
WB_DEBUG
=
True
WB_DEBUG_2_SV
=
Fals
e
WB_DEBUG_2_SV
=
Tru
e
WB_DEBUG_2_SV_FILE
=
'wb_trace.svh'
###################################################################
...
...
@@ -219,14 +219,15 @@ def SetVcxoFrequency(compensation):
# channel: 1, 2, 0 (for both)
# memory: 'set', 'res', '*'
def
ClearMemory
(
channel
,
memory
):
# if memoryPart > -1: clear only first memoryPart words
def
ClearMemory
(
channel
,
memory
,
memoryPart
=
-
1
):
if
channel
==
1
:
address
=
'ch1_'
elif
channel
==
2
:
address
=
'ch2_'
elif
channel
==
0
:
ClearMemory
(
1
,
memory
)
ClearMemory
(
2
,
memory
)
ClearMemory
(
1
,
memory
,
memoryPart
)
ClearMemory
(
2
,
memory
,
memoryPart
)
return
else
:
raise
Exception
(
"Bad channel!"
)
...
...
@@ -236,13 +237,18 @@ def ClearMemory(channel, memory):
elif
memory
==
"res"
:
address
+=
'res_mem'
elif
memory
==
"*"
:
ClearMemory
(
channel
,
'set'
)
ClearMemory
(
channel
,
'res'
)
ClearMemory
(
channel
,
'set'
,
memoryPart
)
ClearMemory
(
channel
,
'res'
,
memoryPart
)
return
else
:
raise
Exception
(
"Bad memory!"
)
WbWriteMulti
(
address
,
(
0
,)
*
2048
)
partToClear
=
2048
to
=
-
1
if
memoryPart
>
-
1
:
partToClear
=
memoryPart
to
=
memoryPart
WbWriteMulti
(
address
,
(
0
,)
*
partToClear
,
to
=
to
)
# channel: 1, 2, 0 (for both)
# pulse: 0, 1
...
...
@@ -368,18 +374,18 @@ def Debug():
## Test functions
###################################################################
def
Init
():
def
Init
(
memoryPart
=
-
1
):
WbWrite
(
'control'
,
0
)
SpiInit
()
Ad9512Init
()
SetTriggerThreshold
(
0.5
)
SelectClock
(
0
)
SetVcxoFrequency
(
-
0.2105
)
# 125.0000 MHz
ClearMemory
(
0
,
'*'
)
ClearMemory
(
0
,
'*'
,
memoryPart
)
def
TestPulse
(
channel
=
1
):
def
TestPulse
(
channel
=
1
,
overflow
=
17820
):
# configure channel
WbWrite
(
'overflow'
,
17820
)
WbWrite
(
'overflow'
,
overflow
)
WbWrite
(
'trig_latency'
,
8
)
# start = 5
...
...
@@ -411,10 +417,10 @@ def TestPulse(channel = 1):
Enable
(
channel
)
StartOnce
(
channel
)
Init
()
Init
(
15
)
Control
()
Status
()
TestPulse
(
1
)
TestPulse
(
1
,
400
)
# TestPulse(2)
Control
()
Status
()
...
...
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