Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393
Commits
ea63654a
Commit
ea63654a
authored
Mar 14, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified DDR memory calibration to reduce occasional failures
parent
18b781bc
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
81647 additions
and
79481 deletions
+81647
-79481
.project
.project
+11
-16
com.elphel.vdt.VivadoTimimgSummaryReportSynthesis.prefs
...s/com.elphel.vdt.VivadoTimimgSummaryReportSynthesis.prefs
+1
-2
com.elphel.vdt.VivadoTimingReportSynthesis.prefs
.settings/com.elphel.vdt.VivadoTimingReportSynthesis.prefs
+1
-2
org.eclipse.core.resources.prefs
.settings/org.eclipse.core.resources.prefs
+1
-0
x393_mcntrl.pickle
py393/dbg/x393_mcntrl.pickle
+81518
-79403
x393_axi_control_status.py
py393/x393_axi_control_status.py
+30
-7
x393_mcntrl_adjust.py
py393/x393_mcntrl_adjust.py
+52
-28
x393_mcntrl_membridge.py
py393/x393_mcntrl_membridge.py
+2
-1
x393_mem.py
py393/x393_mem.py
+14
-14
x393_pio_sequences.py
py393/x393_pio_sequences.py
+5
-3
x393_sens_cmprs.py
py393/x393_sens_cmprs.py
+9
-4
x393_utils.py
py393/x393_utils.py
+3
-1
No files found.
.project
View file @
ea63654a
...
@@ -62,57 +62,52 @@
...
@@ -62,57 +62,52 @@
<link>
<link>
<name>
vivado_logs/VivadoBitstream.log
</name>
<name>
vivado_logs/VivadoBitstream.log
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoBitstream-201
5111723391319
1.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoBitstream-201
6031316225108
1.log
</location>
</link>
</link>
<link>
<link>
<name>
vivado_logs/VivadoOpt.log
</name>
<name>
vivado_logs/VivadoOpt.log
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOpt-201
5111723391319
1.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOpt-201
6031316225108
1.log
</location>
</link>
</link>
<link>
<link>
<name>
vivado_logs/VivadoOptPhys.log
</name>
<name>
vivado_logs/VivadoOptPhys.log
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOptPhys-201
5111723391319
1.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOptPhys-201
6031316225108
1.log
</location>
</link>
</link>
<link>
<link>
<name>
vivado_logs/VivadoOptPower.log
</name>
<name>
vivado_logs/VivadoOptPower.log
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOptPower-201
5111723391319
1.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOptPower-201
6031316225108
1.log
</location>
</link>
</link>
<link>
<link>
<name>
vivado_logs/VivadoPlace.log
</name>
<name>
vivado_logs/VivadoPlace.log
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoPlace-201
5111723391319
1.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoPlace-201
6031316225108
1.log
</location>
</link>
</link>
<link>
<link>
<name>
vivado_logs/VivadoRoute.log
</name>
<name>
vivado_logs/VivadoRoute.log
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoRoute-201
5111723391319
1.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoRoute-201
6031316225108
1.log
</location>
</link>
</link>
<link>
<link>
<name>
vivado_logs/VivadoSynthesis.log
</name>
<name>
vivado_logs/VivadoSynthesis.log
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoSynthesis-201
5111723330767
4.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoSynthesis-201
6031316182509
4.log
</location>
</link>
</link>
<link>
<link>
<name>
vivado_logs/VivadoTimimgSummaryReportImplemented.log
</name>
<name>
vivado_logs/VivadoTimimgSummaryReportImplemented.log
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoTimimgSummaryReportImplemented-201
5111723391319
1.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoTimimgSummaryReportImplemented-201
6031316225108
1.log
</location>
</link>
</link>
<link>
<link>
<name>
vivado_logs/VivadoTimimgSummaryReportSynthesis.log
</name>
<name>
vivado_logs/VivadoTimimgSummaryReportSynthesis.log
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoTimimgSummaryReportSynthesis-20151105233458943.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoTimimgSummaryReportSynthesis-20160313161825094.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoTimingReportImplemented.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoTimingReportImplemented-20151101221627109.log
</location>
</link>
</link>
<link>
<link>
<name>
vivado_logs/VivadoTimingReportSynthesis.log
</name>
<name>
vivado_logs/VivadoTimingReportSynthesis.log
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoTimingReportSynthesis-201
50905102847882
.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoTimingReportSynthesis-201
60313161825094
.log
</location>
</link>
</link>
<link>
<link>
<name>
vivado_state/x393-opt-phys.dcp
</name>
<name>
vivado_state/x393-opt-phys.dcp
</name>
...
@@ -132,7 +127,7 @@
...
@@ -132,7 +127,7 @@
<link>
<link>
<name>
vivado_state/x393-synth.dcp
</name>
<name>
vivado_state/x393-synth.dcp
</name>
<type>
1
</type>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_state/x393-synth-201
50905102847882
.dcp
</location>
<location>
/home/andrey/git/x393/vivado_state/x393-synth-201
60313161825094
.dcp
</location>
</link>
</link>
</linkedResources>
</linkedResources>
</projectDescription>
</projectDescription>
.settings/com.elphel.vdt.VivadoTimimgSummaryReportSynthesis.prefs
View file @
ea63654a
VivadoTimimgSummaryReportSynthesis_102_DisableVivadoTimingSummary=true
VivadoTimimgSummaryReportSynthesis_102_DisableVivadoTimingSummary=true
VivadoTimimgSummaryReportSynthesis_121_DisableVivadoTimingSummary=true
VivadoTimimgSummaryReportSynthesis_121_DisableVivadoTimingSummary=true
VivadoTimimgSummaryReportSynthesis_122_DisableVivadoTimingSummary=true
com.elphel.store.context.VivadoTimimgSummaryReportSynthesis=VivadoTimimgSummaryReportSynthesis_102_DisableVivadoTimingSummary<-@\#\#@->VivadoTimimgSummaryReportSynthesis_121_DisableVivadoTimingSummary<-@\#\#@->
com.elphel.store.context.VivadoTimimgSummaryReportSynthesis=VivadoTimimgSummaryReportSynthesis_102_DisableVivadoTimingSummary<-@\#\#@->VivadoTimimgSummaryReportSynthesis_121_DisableVivadoTimingSummary<-@\#\#@->VivadoTimimgSummaryReportSynthesis_122_DisableVivadoTimingSummary<-@\#\#@->
eclipse.preferences.version=1
eclipse.preferences.version=1
.settings/com.elphel.vdt.VivadoTimingReportSynthesis.prefs
View file @
ea63654a
VivadoTimingReportSynthesis_102_DisableVivadoTiming=true
VivadoTimingReportSynthesis_102_DisableVivadoTiming=true
VivadoTimingReportSynthesis_121_DisableVivadoTiming=true
VivadoTimingReportSynthesis_121_DisableVivadoTiming=true
VivadoTimingReportSynthesis_122_DisableVivadoTiming=true
com.elphel.store.context.VivadoTimingReportSynthesis=VivadoTimingReportSynthesis_102_DisableVivadoTiming<-@\#\#@->VivadoTimingReportSynthesis_121_DisableVivadoTiming<-@\#\#@->
com.elphel.store.context.VivadoTimingReportSynthesis=VivadoTimingReportSynthesis_102_DisableVivadoTiming<-@\#\#@->VivadoTimingReportSynthesis_121_DisableVivadoTiming<-@\#\#@->VivadoTimingReportSynthesis_122_DisableVivadoTiming<-@\#\#@->
eclipse.preferences.version=1
eclipse.preferences.version=1
.settings/org.eclipse.core.resources.prefs
View file @
ea63654a
...
@@ -2,3 +2,4 @@ eclipse.preferences.version=1
...
@@ -2,3 +2,4 @@ eclipse.preferences.version=1
encoding//helpers/convert_data_to_params.py=utf-8
encoding//helpers/convert_data_to_params.py=utf-8
encoding//helpers/convert_pass_init_params.py=utf-8
encoding//helpers/convert_pass_init_params.py=utf-8
encoding//helpers/convert_zigzag_rom.py=utf-8
encoding//helpers/convert_zigzag_rom.py=utf-8
encoding//py393/test_mcntrl.py=utf-8
py393/dbg/x393_mcntrl.pickle
100755 → 100644
View file @
ea63654a
This diff is collapsed.
Click to expand it.
py393/x393_axi_control_status.py
View file @
ea63654a
...
@@ -163,22 +163,44 @@ class X393AxiControlStatus(object):
...
@@ -163,22 +163,44 @@ class X393AxiControlStatus(object):
"""
"""
Read current temperature and supply voltages
Read current temperature and supply voltages
"""
"""
HWMON_PATH
=
"/sys/devices/amba.0/f8007100.ps7-xadc/"
# HWMON_PATH = "/sys/devices/amba.0/f8007100.ps7-xadc/"
HWMON_PATH
=
'/sys/devices/soc0/amba@0/f8007100.ps7-xadc/iio:device0/'
FILE
=
"file"
FILE
=
"file"
ITEM
=
"item"
ITEM
=
"item"
UNITS
=
"units"
UNITS
=
"units"
SCALE
=
"scale"
SCALE
=
"scale"
HWMON_ITEMS
=
[{
FILE
:
"temp"
,
ITEM
:
"Temperature"
,
UNITS
:
"C"
,
SCALE
:
1.0
},
HWMON_ITEMS
=
[{
FILE
:
"in_temp0"
,
ITEM
:
"Temperature"
,
UNITS
:
"C"
,
SCALE
:
0.001
},
{
FILE
:
"vccaux"
,
ITEM
:
"VCCaux"
,
UNITS
:
"V"
,
SCALE
:
0.001
},
{
FILE
:
"in_voltage0_vccint"
,
ITEM
:
"VCCint"
,
UNITS
:
"V"
,
SCALE
:
0.001
},
{
FILE
:
"vccint"
,
ITEM
:
"VCCint"
,
UNITS
:
"V"
,
SCALE
:
0.001
},
{
FILE
:
"in_voltage1_vccaux"
,
ITEM
:
"VCCaux"
,
UNITS
:
"V"
,
SCALE
:
0.001
},
{
FILE
:
"vccbram"
,
ITEM
:
"VCCbram"
,
UNITS
:
"V"
,
SCALE
:
0.001
}]
{
FILE
:
"in_voltage2_vccbram"
,
ITEM
:
"VCCbram"
,
UNITS
:
"V"
,
SCALE
:
0.001
},
{
FILE
:
"in_voltage3_vccpint"
,
ITEM
:
"VCCPint"
,
UNITS
:
"V"
,
SCALE
:
0.001
},
{
FILE
:
"in_voltage4_vccpaux"
,
ITEM
:
"VCCPaux"
,
UNITS
:
"V"
,
SCALE
:
0.001
},
{
FILE
:
"in_voltage5_vccoddr"
,
ITEM
:
"VCCOddr"
,
UNITS
:
"V"
,
SCALE
:
0.001
},
{
FILE
:
"in_voltage6_vrefp"
,
ITEM
:
"VREFp"
,
UNITS
:
"V"
,
SCALE
:
0.001
},
{
FILE
:
"in_voltage7_vrefn"
,
ITEM
:
"VREFn"
,
UNITS
:
"V"
,
SCALE
:
0.001
},
]
print
(
"hwmon:"
)
print
(
"hwmon:"
)
if
self
.
DRY_MODE
:
if
self
.
DRY_MODE
:
print
(
"Not defined for simulation mode"
)
print
(
"Not defined for simulation mode"
)
return
return
for
par
in
HWMON_ITEMS
:
for
par
in
HWMON_ITEMS
:
with
open
(
HWMON_PATH
+
par
[
FILE
])
as
f
:
# with open(HWMON_PATH + par[FILE]) as f:
d
=
int
(
f
.
read
())
# d=int(f.read())
with
open
(
HWMON_PATH
+
par
[
FILE
]
+
"_raw"
)
as
f
:
raw
=
float
(
f
.
read
()
.
strip
())
with
open
(
HWMON_PATH
+
par
[
FILE
]
+
"_scale"
)
as
f
:
scale
=
float
(
f
.
read
()
.
strip
())
try
:
with
open
(
HWMON_PATH
+
par
[
FILE
]
+
"_offset"
)
as
f
:
offset
=
float
(
f
.
read
()
.
strip
())
except
:
offset
=
0
#(guess)
# if (raw>2047) and (par[UNITS] == 'V'):
if
(
raw
>
4000
):
raw
-=
4096
d
=
(
raw
+
offset
)
*
scale
num_digits
=
0
num_digits
=
0
s
=
par
[
SCALE
]
s
=
par
[
SCALE
]
while
s
<
1
:
while
s
<
1
:
...
@@ -187,6 +209,7 @@ class X393AxiControlStatus(object):
...
@@ -187,6 +209,7 @@ class X393AxiControlStatus(object):
w
=
2
+
num_digits
+
(
0
,
1
)[
num_digits
>
0
]
w
=
2
+
num_digits
+
(
0
,
1
)[
num_digits
>
0
]
frmt
=
"
%%12
s =
%%%
d.
%
df
%%
s"
%
(
w
,
num_digits
)
frmt
=
"
%%12
s =
%%%
d.
%
df
%%
s"
%
(
w
,
num_digits
)
print
(
frmt
%
(
par
[
ITEM
],(
d
*
par
[
SCALE
]),
par
[
UNITS
]))
print
(
frmt
%
(
par
[
ITEM
],(
d
*
par
[
SCALE
]),
par
[
UNITS
]))
def
write_control_register
(
self
,
reg_addr
,
data
):
def
write_control_register
(
self
,
reg_addr
,
data
):
"""
"""
Write 32-bit word to the control register
Write 32-bit word to the control register
...
...
py393/x393_mcntrl_adjust.py
View file @
ea63654a
This diff is collapsed.
Click to expand it.
py393/x393_mcntrl_membridge.py
View file @
ea63654a
...
@@ -38,7 +38,8 @@ import x393_mcntrl_timing
...
@@ -38,7 +38,8 @@ import x393_mcntrl_timing
import
x393_mcntrl_buffers
import
x393_mcntrl_buffers
#import verilog_utils
#import verilog_utils
import
x393_mcntrl
import
x393_mcntrl
MEM_PATH
=
'/sys/devices/elphel393-mem.2/'
#MEM_PATH='/sys/devices/elphel393-mem.2/'
MEM_PATH
=
'/sys/devices/soc0/elphel393-mem@0/'
BUFFER_ADDRESS_NAME
=
'buffer_address'
BUFFER_ADDRESS_NAME
=
'buffer_address'
BUFFER_PAGES_NAME
=
'buffer_pages'
BUFFER_PAGES_NAME
=
'buffer_pages'
BUFFER_ADDRESS
=
None
BUFFER_ADDRESS
=
None
...
...
py393/x393_mem.py
View file @
ea63654a
...
@@ -57,8 +57,8 @@ class X393Mem(object):
...
@@ -57,8 +57,8 @@ class X393Mem(object):
with
open
(
"/dev/mem"
,
"r+b"
)
as
f
:
with
open
(
"/dev/mem"
,
"r+b"
)
as
f
:
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_offs
=
addr
-
page_addr
page_offs
=
addr
-
page_addr
if
(
page_addr
>=
0x80000000
):
#
if (page_addr>=0x80000000):
page_addr
-=
(
1
<<
32
)
#
page_addr-= (1<<32)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
packedData
=
struct
.
pack
(
self
.
ENDIAN
+
"L"
,
data
)
packedData
=
struct
.
pack
(
self
.
ENDIAN
+
"L"
,
data
)
d
=
struct
.
unpack
(
self
.
ENDIAN
+
"L"
,
packedData
)[
0
]
d
=
struct
.
unpack
(
self
.
ENDIAN
+
"L"
,
packedData
)[
0
]
...
@@ -87,8 +87,8 @@ class X393Mem(object):
...
@@ -87,8 +87,8 @@ class X393Mem(object):
with
open
(
"/dev/mem"
,
"r+b"
)
as
f
:
with
open
(
"/dev/mem"
,
"r+b"
)
as
f
:
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_offs
=
addr
-
page_addr
page_offs
=
addr
-
page_addr
if
(
page_addr
>=
0x80000000
):
#
if (page_addr>=0x80000000):
page_addr
-=
(
1
<<
32
)
#
page_addr-= (1<<32)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
data
=
struct
.
unpack
(
self
.
ENDIAN
+
"L"
,
mm
[
page_offs
:
page_offs
+
4
])
data
=
struct
.
unpack
(
self
.
ENDIAN
+
"L"
,
mm
[
page_offs
:
page_offs
+
4
])
d
=
data
[
0
]
d
=
data
[
0
]
...
@@ -128,8 +128,8 @@ class X393Mem(object):
...
@@ -128,8 +128,8 @@ class X393Mem(object):
for
addr
in
range
(
start_addr
,
end_addr
+
byte_mode
,
byte_mode
):
for
addr
in
range
(
start_addr
,
end_addr
+
byte_mode
,
byte_mode
):
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_offs
=
addr
-
page_addr
page_offs
=
addr
-
page_addr
if
(
page_addr
>=
0x80000000
):
#
if (page_addr>=0x80000000):
page_addr
-=
(
1
<<
32
)
#
page_addr-= (1<<32)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
data
=
struct
.
unpack_from
(
self
.
ENDIAN
+
frmt_bytes
[
byte_mode
],
mm
,
page_offs
)
data
=
struct
.
unpack_from
(
self
.
ENDIAN
+
frmt_bytes
[
byte_mode
],
mm
,
page_offs
)
rslt
.
append
(
data
[
0
])
rslt
.
append
(
data
[
0
])
...
@@ -181,8 +181,8 @@ class X393Mem(object):
...
@@ -181,8 +181,8 @@ class X393Mem(object):
if
page_num
==
last_page
:
if
page_num
==
last_page
:
end_offset
=
start_addr
+
length
-
self
.
PAGE_SIZE
*
page_num
end_offset
=
start_addr
+
length
-
self
.
PAGE_SIZE
*
page_num
page_addr
=
page_num
*
self
.
PAGE_SIZE
page_addr
=
page_num
*
self
.
PAGE_SIZE
if
(
page_addr
>=
0x80000000
):
#
if (page_addr>=0x80000000):
page_addr
-=
(
1
<<
32
)
#
page_addr-= (1<<32)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
bf
.
write
(
mm
[
start_offset
:
end_offset
])
bf
.
write
(
mm
[
start_offset
:
end_offset
])
...
@@ -208,8 +208,8 @@ class X393Mem(object):
...
@@ -208,8 +208,8 @@ class X393Mem(object):
if
page_num
==
last_page
:
if
page_num
==
last_page
:
end_offset
=
start_addr
+
length
-
self
.
PAGE_SIZE
*
page_num
end_offset
=
start_addr
+
length
-
self
.
PAGE_SIZE
*
page_num
page_addr
=
page_num
*
self
.
PAGE_SIZE
page_addr
=
page_num
*
self
.
PAGE_SIZE
if
(
page_addr
>=
0x80000000
):
#
if (page_addr>=0x80000000):
page_addr
-=
(
1
<<
32
)
#
page_addr-= (1<<32)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
mm
[
start_offset
:
end_offset
]
=
patt
[
start_offset
:
end_offset
]
mm
[
start_offset
:
end_offset
]
=
patt
[
start_offset
:
end_offset
]
...
@@ -243,8 +243,8 @@ class X393Mem(object):
...
@@ -243,8 +243,8 @@ class X393Mem(object):
data
=
(
start_data
+
((
addr
-
start_addr
)
//
byte_mode
)
*
inc_data
)
&
data_mask
data
=
(
start_data
+
((
addr
-
start_addr
)
//
byte_mode
)
*
inc_data
)
&
data_mask
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_offs
=
addr
-
page_addr
page_offs
=
addr
-
page_addr
if
(
page_addr
>=
0x80000000
):
#
if (page_addr>=0x80000000):
page_addr
-=
(
1
<<
32
)
#
page_addr-= (1<<32)
print
((
"0x
%08
x: "
+
data_frmt
)
%
(
addr
,
data
))
print
((
"0x
%08
x: "
+
data_frmt
)
%
(
addr
,
data
))
else
:
else
:
with
open
(
"/dev/mem"
,
"r+b"
)
as
f
:
with
open
(
"/dev/mem"
,
"r+b"
)
as
f
:
...
@@ -252,8 +252,8 @@ class X393Mem(object):
...
@@ -252,8 +252,8 @@ class X393Mem(object):
data
=
(
start_data
+
((
addr
-
start_addr
)
//
byte_mode
)
*
inc_data
)
&
data_mask
data
=
(
start_data
+
((
addr
-
start_addr
)
//
byte_mode
)
*
inc_data
)
&
data_mask
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_offs
=
addr
-
page_addr
page_offs
=
addr
-
page_addr
if
(
page_addr
>=
0x80000000
):
#
if (page_addr>=0x80000000):
page_addr
-=
(
1
<<
32
)
#
page_addr-= (1<<32)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
struct
.
pack_into
(
self
.
ENDIAN
+
frmt_bytes
[
byte_mode
],
mm
,
page_offs
,
data
)
struct
.
pack_into
(
self
.
ENDIAN
+
frmt_bytes
[
byte_mode
],
mm
,
page_offs
,
data
)
...
...
py393/x393_pio_sequences.py
View file @
ea63654a
...
@@ -88,7 +88,7 @@ class X393PIOSequences(object):
...
@@ -88,7 +88,7 @@ class X393PIOSequences(object):
((
page
&
3
)
<<
10
)
|
((
page
&
3
)
<<
10
)
|
(
seq_addr
&
0x3ff
))
(
seq_addr
&
0x3ff
))
def
wait_ps_pio_ready
(
self
,
#; // wait PS PIO module can accept com
am
nds (fifo half empty)
def
wait_ps_pio_ready
(
self
,
#; // wait PS PIO module can accept com
ma
nds (fifo half empty)
mode
,
# input [1:0] mode;
mode
,
# input [1:0] mode;
sync_seq
,
# input sync_seq; // synchronize sequences
sync_seq
,
# input sync_seq; // synchronize sequences
timeout
=
2.0
):
# maximal timeout in seconds
timeout
=
2.0
):
# maximal timeout in seconds
...
@@ -860,7 +860,8 @@ class X393PIOSequences(object):
...
@@ -860,7 +860,8 @@ class X393PIOSequences(object):
0
,
# 1'h0, # mpr; # MPR mode: 0 - normal, 1 - dataflow from MPR
0
,
# 1'h0, # mpr; # MPR mode: 0 - normal, 1 - dataflow from MPR
0
)
# 2'h0); # [1:0] mpr_rf; # MPR read function: 2'b00: predefined pattern 0101...
0
)
# 2'h0); # [1:0] mpr_rf; # MPR read function: 2'b00: predefined pattern 0101...
cmd_addr
=
vrlg
.
MCONTR_CMD_WR_ADDR
+
vrlg
.
INITIALIZE_OFFSET
;
cmd_addr
=
vrlg
.
MCONTR_CMD_WR_ADDR
+
vrlg
.
INITIALIZE_OFFSET
;
if
self
.
DEBUG_MODE
>
1
:
# if self.DEBUG_MODE > 1:
if
self
.
DEBUG_MODE
>
-
1
:
print
(
"mr0=0x
%05
x"
%
mr0
);
print
(
"mr0=0x
%05
x"
%
mr0
);
print
(
"mr1=0x
%05
x"
%
mr1
);
print
(
"mr1=0x
%05
x"
%
mr1
);
print
(
"mr2=0x
%05
x"
%
mr2
);
print
(
"mr2=0x
%05
x"
%
mr2
);
...
@@ -1121,6 +1122,7 @@ class X393PIOSequences(object):
...
@@ -1121,6 +1122,7 @@ class X393PIOSequences(object):
rslt
=
(
first_bad
,
last_bad
,
data16
[
mid_index
],
mid_index
)
rslt
=
(
first_bad
,
last_bad
,
data16
[
mid_index
],
mid_index
)
if
quiet
<
3
:
if
quiet
<
3
:
print
(
"non_consecutive leading/trailing:
%
d /
%
d, middle data=0x
%
x, index=0x
%
x"
%
rslt
)
print
(
"non_consecutive leading/trailing:
%
d /
%
d, middle data=0x
%
x, index=0x
%
x"
%
rslt
)
print
(
data16
)
return
rslt
return
rslt
...
...
py393/x393_sens_cmprs.py
View file @
ea63654a
...
@@ -52,9 +52,14 @@ from verilog_utils import hx
...
@@ -52,9 +52,14 @@ from verilog_utils import hx
PAGE_SIZE
=
4096
PAGE_SIZE
=
4096
SI5338_PATH
=
'/sys/devices/amba.0/e0004000.ps7-i2c/i2c-0/0-0070'
#SI5338_PATH = '/sys/devices/amba.0/e0004000.ps7-i2c/i2c-0/0-0070'
POWER393_PATH
=
'/sys/devices/elphel393-pwr.1'
#POWER393_PATH = '/sys/devices/elphel393-pwr.1'
MEM_PATH
=
'/sys/devices/elphel393-mem.2/'
#MEM_PATH = '/sys/devices/elphel393-mem.2/'
SI5338_PATH
=
'/sys/devices/soc0/amba@0/e0004000.ps7-i2c/i2c-0/0-0070'
POWER393_PATH
=
'/sys/devices/soc0/elphel393-pwr@0'
MEM_PATH
=
'/sys/devices/soc0/elphel393-mem@0/'
BUFFER_ADDRESS_NAME
=
'buffer_address'
BUFFER_ADDRESS_NAME
=
'buffer_address'
BUFFER_PAGES_NAME
=
'buffer_pages'
BUFFER_PAGES_NAME
=
'buffer_pages'
BUFFER_ADDRESS
=
None
# in bytes
BUFFER_ADDRESS
=
None
# in bytes
...
@@ -148,7 +153,7 @@ class X393SensCmprs(object):
...
@@ -148,7 +153,7 @@ class X393SensCmprs(object):
Currently required clock frequency is 1/4 of the sensor clock, so it is 24MHz for 96MHz sensor
Currently required clock frequency is 1/4 of the sensor clock, so it is 24MHz for 96MHz sensor
@param freq_MHz - input clock frequency (MHz). Currently for 96MHZ sensor clock it should be 24.0
@param freq_MHz - input clock frequency (MHz). Currently for 96MHZ sensor clock it should be 24.0
@param iface - one of the supported interfaces
@param iface - one of the supported interfaces
(see ls /sys/devices/
amba.
0/e0004000.ps7-i2c/i2c-0/0-0070/output_drivers)
(see ls /sys/devices/
soc0/amba@
0/e0004000.ps7-i2c/i2c-0/0-0070/output_drivers)
@param quiet - reduce output
@param quiet - reduce output
"""
"""
if
self
.
DRY_MODE
:
if
self
.
DRY_MODE
:
...
...
py393/x393_utils.py
View file @
ea63654a
...
@@ -97,7 +97,9 @@ class X393Utils(object):
...
@@ -97,7 +97,9 @@ class X393Utils(object):
if
bitfile
is
None
:
if
bitfile
is
None
:
bitfile
=
DEFAULT_BITFILE
bitfile
=
DEFAULT_BITFILE
print
(
"Sensor ports power off"
)
print
(
"Sensor ports power off"
)
POWER393_PATH
=
'/sys/devices/elphel393-pwr.1'
# POWER393_PATH = '/sys/devices/elphel393-pwr.1'
POWER393_PATH
=
'/sys/devices/soc0/elphel393-pwr@0'
with
open
(
POWER393_PATH
+
"/channels_dis"
,
"w"
)
as
f
:
with
open
(
POWER393_PATH
+
"/channels_dis"
,
"w"
)
as
f
:
print
(
"vcc_sens01 vp33sens01 vcc_sens23 vp33sens23"
,
file
=
f
)
print
(
"vcc_sens01 vp33sens01 vcc_sens23 vp33sens23"
,
file
=
f
)
print
(
"FPGA clock OFF"
)
print
(
"FPGA clock OFF"
)
...
...
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