Commit 70528b01 authored by Andrey Filippov's avatar Andrey Filippov

got (some) compressed image data to the circbuf

parent 7a4e8e08
......@@ -62,42 +62,42 @@
<link>
<name>vivado_logs/VivadoBitstream.log</name>
<type>1</type>
<location>/home/andrey/git/x393/vivado_logs/VivadoBitstream-20150906235148933.log</location>
<location>/home/andrey/git/x393/vivado_logs/VivadoBitstream-20150907111447874.log</location>
</link>
<link>
<name>vivado_logs/VivadoOpt.log</name>
<type>1</type>
<location>/home/andrey/git/x393/vivado_logs/VivadoOpt-20150906235148933.log</location>
<location>/home/andrey/git/x393/vivado_logs/VivadoOpt-20150907111447874.log</location>
</link>
<link>
<name>vivado_logs/VivadoOptPhys.log</name>
<type>1</type>
<location>/home/andrey/git/x393/vivado_logs/VivadoOptPhys-20150906235148933.log</location>
<location>/home/andrey/git/x393/vivado_logs/VivadoOptPhys-20150907111447874.log</location>
</link>
<link>
<name>vivado_logs/VivadoOptPower.log</name>
<type>1</type>
<location>/home/andrey/git/x393/vivado_logs/VivadoOptPower-20150906235148933.log</location>
<location>/home/andrey/git/x393/vivado_logs/VivadoOptPower-20150907111447874.log</location>
</link>
<link>
<name>vivado_logs/VivadoPlace.log</name>
<type>1</type>
<location>/home/andrey/git/x393/vivado_logs/VivadoPlace-20150906235148933.log</location>
<location>/home/andrey/git/x393/vivado_logs/VivadoPlace-20150907111447874.log</location>
</link>
<link>
<name>vivado_logs/VivadoRoute.log</name>
<type>1</type>
<location>/home/andrey/git/x393/vivado_logs/VivadoRoute-20150906235148933.log</location>
<location>/home/andrey/git/x393/vivado_logs/VivadoRoute-20150907111447874.log</location>
</link>
<link>
<name>vivado_logs/VivadoSynthesis.log</name>
<type>1</type>
<location>/home/andrey/git/x393/vivado_logs/VivadoSynthesis-20150906235148933.log</location>
<location>/home/andrey/git/x393/vivado_logs/VivadoSynthesis-20150907111447874.log</location>
</link>
<link>
<name>vivado_logs/VivadoTimimgSummaryReportImplemented.log</name>
<type>1</type>
<location>/home/andrey/git/x393/vivado_logs/VivadoTimimgSummaryReportImplemented-20150906235148933.log</location>
<location>/home/andrey/git/x393/vivado_logs/VivadoTimimgSummaryReportImplemented-20150907111447874.log</location>
</link>
<link>
<name>vivado_logs/VivadoTimimgSummaryReportSynthesis.log</name>
......
......@@ -49,7 +49,7 @@ module cmprs_afi_mux_status #(
input [CMPRS_AFIMUX_WIDTH-1:0] chunk_ptr_rd // pointer data
);
localparam MODE_WIDTH = 15;
reg [MODE_WIDTH-1:0] mode_data_mclk; // some bits unused
reg [MODE_WIDTH-1:0] mode_data_mclk; // some bits unused
wire mode_we_hclk;
reg [7:0] mode_hclk;
reg [1:0] index;
......@@ -142,7 +142,7 @@ module cmprs_afi_mux_status #(
);
status_generate #(
.STATUS_REG_ADDR (CMPRS_AFIMUX_STATUS_REG_ADDR+0),
.STATUS_REG_ADDR (CMPRS_AFIMUX_STATUS_REG_ADDR+1),
.PAYLOAD_BITS (CMPRS_AFIMUX_WIDTH)
) status_generate1_i (
.rst (1'b0), //rst), // input
......@@ -157,7 +157,7 @@ module cmprs_afi_mux_status #(
);
status_generate #(
.STATUS_REG_ADDR (CMPRS_AFIMUX_STATUS_REG_ADDR+0),
.STATUS_REG_ADDR (CMPRS_AFIMUX_STATUS_REG_ADDR+2),
.PAYLOAD_BITS (CMPRS_AFIMUX_WIDTH)
) status_generate2_i (
.rst (1'b0), //rst), // input
......@@ -172,7 +172,7 @@ module cmprs_afi_mux_status #(
);
status_generate #(
.STATUS_REG_ADDR (CMPRS_AFIMUX_STATUS_REG_ADDR+0),
.STATUS_REG_ADDR (CMPRS_AFIMUX_STATUS_REG_ADDR+3),
.PAYLOAD_BITS (CMPRS_AFIMUX_WIDTH)
) status_generate3_i (
.rst (1'b0), // rst), // input
......
......@@ -344,9 +344,21 @@ module jp_channel#(
// assign buf_regen = buf_rd[1];
`ifdef DEBUG_RING
reg [15:0] debug_fifo_in;
reg [15:0] debug_fifo_out;
always @ (posedge ~xclk2x) begin
if (xrst2xn) debug_fifo_in <= 0;
else if (stuffer_dv) debug_fifo_in <= debug_fifo_in + 1;
end
always @ (posedge hclk) begin
if (hrst) debug_fifo_out <= 0;
else if (fifo_rst) debug_fifo_out <= debug_fifo_in;
else if (fifo_ren) debug_fifo_out <= debug_fifo_out + 1;
end
debug_slave #(
.SHIFT_WIDTH (96),
.READ_WIDTH (96),
.SHIFT_WIDTH (128),
.READ_WIDTH (128),
.WRITE_WIDTH (32),
.DEBUG_CMD_LATENCY (DEBUG_CMD_LATENCY)
) debug_slave_i (
......@@ -356,6 +368,8 @@ module jp_channel#(
.debug_sl (debug_sl), // input
.debug_do (debug_do), // output
.rd_data ({
debug_fifo_out[15:0],
debug_fifo_in[15:0],
16'b0,
fifo_count[7:0],
6'b0, sigle_frame_buf, suspend,
......@@ -948,13 +962,13 @@ module jp_channel#(
.wclk (~xclk2x), // input source clock (2x pixel clock, inverted) - same as stuffer out
.wrst (xrst2xn), // input mostly for simulation
.we (stuffer_dv), // input write data from stuffer
.we (stuffer_dv), // @ posedge(~xclk2x) input write data from stuffer
.wdata (stuffer_do), // 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
// AFI clock domain
.rclk (hclk), // input - AFI clock
.rclk (hclk), // @posedge(hclk) input - AFI clock
.rrst (hrst), // input - AFI clock
.rst_fifo (fifo_rst), // input - reset FIFO (set read address to write, reset count)
.ren (fifo_ren), // input - fifo read from AFI channel mux
......
parameter FPGA_VERSION = 32'h0393001e;
\ No newline at end of file
parameter FPGA_VERSION = 32'h0393001f;
\ No newline at end of file
......@@ -171,7 +171,8 @@ class X393CmprsAfi(object):
afi_cmprs2_sa,
afi_cmprs2_len,
afi_cmprs3_sa,
afi_cmprs3_len):
afi_cmprs3_len,
verbose = 1):
"""
Set mode of selected input channel of the selected AFI multiplexer
......@@ -191,7 +192,20 @@ class X393CmprsAfi(object):
@param afi_cmprs2_len - input channel 0 buffer length in 32-byte chunks
@param afi_cmprs3_sa - input channel 0 start address in 32-byte chunks
@param afi_cmprs3_len - input channel 0 buffer length in 32-byte chunks
@param verbose - verbose level
"""
if verbose >0 :
print ("afi_mux_setup:")
print ("AFI port (0/1) = ",port_afi)
print ("AFI channel mask = 0x%x"%(chn_mask))
print ("status mode = ",status_mode)
print ("report mode = ",report_mode)
print ("channel 0 : 0x%08x/0x%08x"%(afi_cmprs0_sa * 32, afi_cmprs0_len * 32))
print ("channel 1 : 0x%08x/0x%08x"%(afi_cmprs1_sa * 32, afi_cmprs1_len * 32))
print ("channel 2 : 0x%08x/0x%08x"%(afi_cmprs2_sa * 32, afi_cmprs2_len * 32))
print ("channel 3 : 0x%08x/0x%08x"%(afi_cmprs3_sa * 32, afi_cmprs3_len * 32))
sa = (afi_cmprs0_sa, afi_cmprs1_sa, afi_cmprs2_sa, afi_cmprs3_sa)
length = (afi_cmprs0_len, afi_cmprs1_len, afi_cmprs2_len, afi_cmprs3_len)
for i in range(4):
......
......@@ -516,11 +516,14 @@ class X393SensCmprs(object):
circbuf_end = circbuf_start + 4*circbuf_chn_size
#TODO: calculate addersses/lengths
afi_cmprs0_sa = circbuf_starts[0] // 4
afi_cmprs1_sa = circbuf_starts[1] // 4
afi_cmprs2_sa = circbuf_starts[2] // 4
afi_cmprs3_sa = circbuf_starts[3] // 4
afi_cmprs_len = circbuf_chn_size // 4
"""
AFI mux is programmed in 32-byte chunks
"""
afi_cmprs0_sa = circbuf_starts[0] // 32
afi_cmprs1_sa = circbuf_starts[1] // 32
afi_cmprs2_sa = circbuf_starts[2] // 32
afi_cmprs3_sa = circbuf_starts[3] // 32
afi_cmprs_len = circbuf_chn_size // 32
if verbose >0 :
print ("compressor system memory buffers:")
print ("circbuf start 0 = 0x%x"%(circbuf_starts[0]))
......@@ -561,6 +564,26 @@ class X393SensCmprs(object):
self.x393Rtc.set_rtc () # no correction, use current system time
if exit_step == 3: return False
if verbose >0 :
print ("===================== AFI_MUX_SETUP =========================")
self.x393CmprsAfi.afi_mux_setup (
port_afi = 0,
chn_mask = sensor_mask,
status_mode = 3, # = 3,
# mode == 0 - show EOF pointer, internal
# mode == 1 - show EOF pointer, confirmed written to the system memory
# mode == 2 - show current pointer, internal
# mode == 3 - show current pointer, confirmed written to the system memory
report_mode = 0, # = 0,
afi_cmprs0_sa = afi_cmprs0_sa,
afi_cmprs0_len = afi_cmprs_len,
afi_cmprs1_sa = afi_cmprs1_sa,
afi_cmprs1_len = afi_cmprs_len,
afi_cmprs2_sa = afi_cmprs2_sa,
afi_cmprs2_len = afi_cmprs_len,
afi_cmprs3_sa = afi_cmprs3_sa,
afi_cmprs3_len = afi_cmprs_len)
for num_sensor in range(4):
if sensor_mask & (1 << num_sensor):
......@@ -591,6 +614,10 @@ class X393SensCmprs(object):
verbose = verbose)
if not rslt : return False
if exit_step == 20: return False
"""
if verbose >0 :
print ("===================== AFI_MUX_SETUP =========================")
self.x393CmprsAfi.afi_mux_setup (
port_afi = 0,
chn_mask = sensor_mask,
......@@ -607,10 +634,13 @@ class X393SensCmprs(object):
afi_cmprs2_sa = afi_cmprs2_sa,
afi_cmprs2_len = afi_cmprs_len,
afi_cmprs3_sa = afi_cmprs3_sa,
afi_cmprs3_len = afi_cmprs_len)
afi_cmprs3_len = afi_cmprs_len)
"""
self.x393Sensor.print_status_sensor_io (num_sensor = num_sensor)
self.x393Sensor.print_status_sensor_i2c (num_sensor = num_sensor)
if verbose >0 :
print ("===================== AFI_MUX_SETUP =========================")
self.x393Sensor.set_sensor_i2c_command (
num_sensor = num_sensor,
rst_cmd = True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment