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
f3cc7226
Commit
f3cc7226
authored
Sep 10, 2015
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
continue debugging, about to changecmprs_afi_mux to correctly handle roll-over
parent
84c24b0a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
83 additions
and
16 deletions
+83
-16
.project
.project
+8
-8
jp_channel.v
compressor_jp/jp_channel.v
+1
-1
fpga_version.vh
fpga_version.vh
+1
-1
x393_jpeg.py
py393/x393_jpeg.py
+5
-2
x393_mem.py
py393/x393_mem.py
+55
-0
x393_sens_cmprs.py
py393/x393_sens_cmprs.py
+1
-1
x393_testbench02.tf
x393_testbench02.tf
+12
-3
No files found.
.project
View file @
f3cc7226
...
...
@@ -62,42 +62,42 @@
<link>
<name>
vivado_logs/VivadoBitstream.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoBitstream-2015090
7111447874
.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoBitstream-2015090
9225646571
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoOpt.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOpt-2015090
7111447874
.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOpt-2015090
9225646571
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoOptPhys.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOptPhys-2015090
7111447874
.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOptPhys-2015090
9225646571
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoOptPower.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOptPower-2015090
7111447874
.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoOptPower-2015090
9225646571
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoPlace.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoPlace-2015090
7111447874
.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoPlace-2015090
9225646571
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoRoute.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoRoute-2015090
7111447874
.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoRoute-2015090
9225646571
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoSynthesis.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoSynthesis-2015090
711144787
4.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoSynthesis-2015090
922484152
4.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoTimimgSummaryReportImplemented.log
</name>
<type>
1
</type>
<location>
/home/andrey/git/x393/vivado_logs/VivadoTimimgSummaryReportImplemented-2015090
7111447874
.log
</location>
<location>
/home/andrey/git/x393/vivado_logs/VivadoTimimgSummaryReportImplemented-2015090
9225646571
.log
</location>
</link>
<link>
<name>
vivado_logs/VivadoTimimgSummaryReportSynthesis.log
</name>
...
...
compressor_jp/jp_channel.v
View file @
f3cc7226
...
...
@@ -963,7 +963,7 @@ module jp_channel#(
.
wrst
(
xrst2xn
)
,
// input mostly for simulation
.
we
(
stuffer_dv
)
,
// @ posedge(~xclk2x) input write data from stuffer
.
wdata
(
stuffer_do
)
,
// input[15:0] data from stuffer module;
.
wdata
(
{
stuffer_do
[
7
:
0
]
,
stuffer_do
[
15
:
8
]
}
)
,
// input[15:0] data from stuffer module;
.
wa_rst
(
!
stuffer_en
)
,
// input reset low address bits when stuffer is disabled (to make sure it is multiple of 32 bytes
.
wlast
(
stuffer_done
)
,
// input - written last 32 bytes of a frame (flush FIFO) - stuffer_done (has to be later than we)
.
eof_written_wclk
(
eof_written_xclk2xn
)
,
// output - AFI had transferred frame data to the system memory
...
...
fpga_version.vh
View file @
f3cc7226
parameter FPGA_VERSION = 32'h0393001f;
\ No newline at end of file
parameter FPGA_VERSION = 32'h03930021;
\ No newline at end of file
py393/x393_jpeg.py
View file @
f3cc7226
...
...
@@ -564,7 +564,7 @@ class X393Jpeg(object):
"huffman"
:
self
.
huff_tables
[
FPGA_HUFFMAN_TABLE
]}
def
jpeg_header_353
(
self
):
return
bytearray
((
0xf
f
,
0xd8
,
0xff
,
0xe0
,
0x00
,
0x10
,
0x4a
,
0x46
,
0x49
,
0x46
,
0x00
,
0x01
,
0x01
,
0x00
,
0x00
,
0x01
,
0xf
e
,
0xd8
,
0xff
,
0xe0
,
0x00
,
0x10
,
0x4a
,
0x46
,
0x49
,
0x46
,
0x00
,
0x01
,
0x01
,
0x00
,
0x00
,
0x01
,
0x00
,
0x01
,
0x00
,
0x00
,
0xff
,
0xdb
,
0x00
,
0x43
,
0x00
,
0x06
,
0x04
,
0x05
,
0x06
,
0x05
,
0x04
,
0x06
,
0x06
,
0x05
,
0x06
,
0x07
,
0x07
,
0x06
,
0x08
,
0x0a
,
0x10
,
0x0a
,
0x0a
,
0x09
,
0x09
,
0x0a
,
0x14
,
0x0e
,
0x0f
,
0x0c
,
0x10
,
0x17
,
0x14
,
0x18
,
0x18
,
0x17
,
0x14
,
0x16
,
0x16
,
0x1a
,
0x1d
,
0x25
,
0x1f
,
0x1a
,
...
...
@@ -604,3 +604,6 @@ class X393Jpeg(object):
0xe3
,
0xe4
,
0xe5
,
0xe6
,
0xe7
,
0xe8
,
0xe9
,
0xea
,
0xf2
,
0xf3
,
0xf4
,
0xf5
,
0xf6
,
0xf7
,
0xf8
,
0xf9
,
0xfa
,
0xff
,
0xda
,
0x00
,
0x0c
,
0x03
,
0x01
,
0x00
,
0x02
,
0x11
,
0x03
,
0x11
,
0x00
,
0x3f
,
0x00
))
"""
ff d9
"""
\ No newline at end of file
py393/x393_mem.py
View file @
f3cc7226
...
...
@@ -145,6 +145,61 @@ class X393Mem(object):
print
(
""
)
return
rslt
def
mem_save
(
self
,
filename
,
start_addr
,
length
):
'''
Save physical memory content to a file
@param filename - path to a file
@param start_addr physical byte start address
@param length - number of bytes to save
'''
if
self
.
DRY_MODE
:
print
(
"Write memory to file is not implemented in non-target mode"
)
return
with
open
(
filename
,
"w+b"
)
as
sf
:
with
open
(
"/dev/mem"
,
"r+b"
)
as
f
:
first_page
=
start_addr
//
self
.
PAGE_SIZE
last_page
=
(
start_addr
+
length
-
1
)
//
self
.
PAGE_SIZE
for
page_num
in
range
(
first_page
,
last_page
+
1
):
start_offset
=
0
if
page_num
==
first_page
:
start_offset
=
start_addr
-
self
.
PAGE_SIZE
*
page_num
end_offset
=
self
.
PAGE_SIZE
if
page_num
==
last_page
:
end_offset
=
start_addr
+
length
-
self
.
PAGE_SIZE
*
page_num
page_addr
=
page_num
*
self
.
PAGE_SIZE
if
(
page_addr
>=
0x80000000
):
page_addr
-=
(
1
<<
32
)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
sf
.
write
(
mm
[
start_offset
:
end_offset
])
def
mem_clear
(
self
,
start_addr
,
length
,
word32
):
'''
Fill physical memory range with a repetitive 32-bit word
@param start_addr physical byte start address
@param length - number of bytes to save
@param word32 - 32-bit pattern
'''
if
self
.
DRY_MODE
:
print
(
"Write memory to file is not implemented in non-target mode"
)
return
patt
=
str
(
bytearray
(((
word32
&
0xff
),
((
word32
>>
8
)
&
0xff
),
((
word32
>>
16
)
&
0xff
),
((
word32
>>
24
)
&
0xff
)))
*
(
self
.
PAGE_SIZE
/
4
))
with
open
(
"/dev/mem"
,
"r+b"
)
as
f
:
first_page
=
start_addr
//
self
.
PAGE_SIZE
last_page
=
(
start_addr
+
length
-
1
)
//
self
.
PAGE_SIZE
for
page_num
in
range
(
first_page
,
last_page
+
1
):
start_offset
=
0
if
page_num
==
first_page
:
start_offset
=
start_addr
-
self
.
PAGE_SIZE
*
page_num
end_offset
=
self
.
PAGE_SIZE
if
page_num
==
last_page
:
end_offset
=
start_addr
+
length
-
self
.
PAGE_SIZE
*
page_num
page_addr
=
page_num
*
self
.
PAGE_SIZE
if
(
page_addr
>=
0x80000000
):
page_addr
-=
(
1
<<
32
)
mm
=
mmap
.
mmap
(
f
.
fileno
(),
self
.
PAGE_SIZE
,
offset
=
page_addr
)
mm
[
start_offset
:
end_offset
]
=
patt
[
start_offset
:
end_offset
]
def
mem_fill
(
self
,
start_addr
,
start_data
=
0
,
end_addr
=
1
,
inc_data
=
0
,
byte_mode
=
4
):
'''
Read and print memory range from physical memory
...
...
py393/x393_sens_cmprs.py
View file @
f3cc7226
...
...
@@ -662,7 +662,7 @@ class X393SensCmprs(object):
self
.
x393Camsync
.
camsync_setup
(
sensor_mask
=
sensor_mask
,
trigger_mode
=
False
,
#False - async (free running) sensor mode, True - triggered (global reset) sensor mode
trigger_mode
=
False
,
#
False - async (free running) sensor mode, True - triggered (global reset) sensor mode
ext_trigger_mode
=
False
,
# True - external trigger source, 0 - local FPGA trigger source
external_timestamp
=
False
,
# True - use received timestamp in the image file, False - use local timestamp
camsync_period
=
None
,
...
...
x393_testbench02.tf
View file @
f3cc7226
...
...
@@ -80,7 +80,7 @@ module x393_testbench02 #(
`
include
"includes/x393_cur_params_target.vh"
// SuppressThisWarning VEditor - not used parameters that may need adjustment, should be before x393_localparams.vh
parameter
TRIGGER_MODE
=
0
;
// 1; // 0 - auto, 1 - triggered
parameter
EXT_TRIGGER_MODE
=
1
;
// 0 - internal, 1 - external trigger (camsync)
parameter
EXTERNAL_TIMESTAMP
=
1
;
// embed local timestamp, 1 - embed received timestamp
parameter
EXTERNAL_TIMESTAMP
=
0
;
//
1 ; // embed local timestamp, 1 - embed received timestamp
`
include
"includes/x393_localparams.vh"
// SuppressThisWarning VEditor - not used
// VDT - incorrect real number calculation
...
...
@@ -1006,6 +1006,7 @@ assign #10 gpio_pins[9] = gpio_pins[8];
afi_mux_setup
(
4
'hf, // input [3:0] chn_mask;
/*
'
h10000000
>>
5
,
// input [26:0] afi_cmprs0_sa; // input [26:0] sa; // start address in 32-byte chunks
'h10000 >> 5, // input [26:0] afi_cmprs0_len; // input [26:0] length; // channel buffer length in 32-byte chunks
'
h10010000
>>
5
,
// input [26:0] afi_cmprs1_sa; // input [26:0] sa; // start address in 32-byte chunks
...
...
@@ -1014,7 +1015,15 @@ assign #10 gpio_pins[9] = gpio_pins[8];
'h10000 >> 5, // input [26:0] afi_cmprs2_len; // input [26:0] length; // channel buffer length in 32-byte chunks
'
h10030000
>>
5
,
// input [26:0] afi_cmprs3_sa; // input [26:0] sa; // start address in 32-byte chunks
'h10000 >> 5); // input [26:0] afi_cmprs3_len; // input [26:0] length; // channel buffer length in 32-byte chunks
*/
'
h10000000
>>
5
,
// input [26:0] afi_cmprs0_sa; // input [26:0] sa; // start address in 32-byte chunks
'h800 >> 5, // input [26:0] afi_cmprs0_len; // input [26:0] length; // channel buffer length in 32-byte chunks
'
h10010000
>>
5
,
// input [26:0] afi_cmprs1_sa; // input [26:0] sa; // start address in 32-byte chunks
'h400 >> 5, // input [26:0] afi_cmprs1_len; // input [26:0] length; // channel buffer length in 32-byte chunks
'
h10020000
>>
5
,
// input [26:0] afi_cmprs2_sa; // input [26:0] sa; // start address in 32-byte chunks
'h200 >> 5, // input [26:0] afi_cmprs2_len; // input [26:0] length; // channel buffer length in 32-byte chunks
'
h10030000
>>
5
,
// input [26:0] afi_cmprs3_sa; // input [26:0] sa; // start address in 32-byte chunks
'h100 >> 5); // input [26:0] afi_cmprs3_len; // input [26:0] length; // channel buffer length in 32-byte chunks
camsync_setup (
4'
hf
);
// sensor_mask); //
...
...
@@ -2583,7 +2592,7 @@ task camsync_setup;
input [3:0] sensor_mask;
reg trigger_mode; // 0 - auto, 1 - triggered
reg ext_trigger_mode; // 0 - internal, 1 - external trigger (camsync)
reg external_timestamp; // embed local timestamp, 1 - embed received timestamp
reg external_timestamp; //
0 -
embed local timestamp, 1 - embed received timestamp
reg [31:0] camsync_period;
reg [31:0] camsync_delay;
// reg [ 3:0] sensor_mask;
...
...
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