Commit e2daa176 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

changing parameter to reset buffer pages at frame start

parent 2f80e662
Loading
Loading
Loading
Loading
+83 −26
Original line number Diff line number Diff line
[*]
[*] GTKWave Analyzer v3.3.66 (w)1999-2015 BSI
[*] Mon Aug 29 02:48:05 2016
[*] Thu Sep  1 04:51:15 2016
[*]
[dumpfile] "/home/eyesis/git/x393-neon/simulation/x393_dut-20160828192314061.fst"
[dumpfile_mtime] "Mon Aug 29 01:55:16 2016"
[dumpfile_size] 172137517
[dumpfile] "/home/eyesis/git/x393-neon/simulation/x393_dut-20160830202606545.fst"
[dumpfile_mtime] "Wed Aug 31 03:39:41 2016"
[dumpfile_size] 281513830
[savefile] "/home/eyesis/git/x393-neon/cocotb/x393_cocotb_02.sav"
[timestart] 177303100
[timestart] 0
[size] 1836 1171
[pos] 1920 23
*-15.588772 177422388 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
*-26.061598 53377388 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[treeopen] x393_dut.
[treeopen] x393_dut.ddr3_i.ddr3_i.
[treeopen] x393_dut.simul_axi_master_wdata_i.
[treeopen] x393_dut.x393_i.
[treeopen] x393_dut.x393_i.cmd_seq_mux_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.cmprs_pixel_buf_iface_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.cmprs_status_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[1].
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[1].jp_channel_i.cmprs_pixel_buf_iface_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[2].
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[2].jp_channel_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[2].jp_channel_i.cmprs_pixel_buf_iface_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[2].jp_channel_i.dct2d8x8_chen_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[2].jp_channel_i.dct2d8x8_chen_i.dct1d_chen_reorder_out_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[2].jp_channel_i.dct2d8x8_chen_i.dct1d_chen_stage2_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[3].
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[3].jp_channel_i.
[treeopen] x393_dut.x393_i.compressor393_i.cmprs_channel_block[3].jp_channel_i.cmprs_pixel_buf_iface_i.
[treeopen] x393_dut.x393_i.compressor393_i.genblk3.
[treeopen] x393_dut.x393_i.compressor393_i.genblk3.cmprs_afi0_mux_i.
[treeopen] x393_dut.x393_i.frame_sequencer_block[0].
[treeopen] x393_dut.x393_i.frame_sequencer_block[0].cmd_frame_sequencer_i.
[treeopen] x393_dut.x393_i.gpio393_i.
[treeopen] x393_dut.x393_i.mcntrl393_i.
[treeopen] x393_dut.x393_i.mcntrl393_i.memctrl16_i.mcontr_sequencer_i.
[treeopen] x393_dut.x393_i.mcntrl393_i.memctrl16_i.mcontr_sequencer_i.phy_cmd_i.
[treeopen] x393_dut.x393_i.mcntrl393_i.memctrl16_i.mcontr_sequencer_i.phy_cmd_i.phy_top_i.
@@ -42,15 +36,14 @@
[treeopen] x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].
[treeopen] x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_linear_wr_sensor_i.
[treeopen] x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.
[treeopen] x393_dut.x393_i.sensors393_i.
[treeopen] x393_dut.x393_i.sensors393_i.sensor_channel_block[0].
[treeopen] x393_dut.x393_i.sensors393_i.sensor_channel_block[0].sensor_channel_i.
[treeopen] x393_dut.x393_i.sensors393_i.sensor_channel_block[0].sensor_channel_i.sens_sync_i.
[treeopen] x393_dut.x393_i.sensors393_i.sensor_channel_block[0].sensor_membuf_i.
[treeopen] x393_dut.x393_i.sensors393_i.sensor_channel_block[1].
[treeopen] x393_dut.x393_i.sensors393_i.sensor_channel_block[2].
[treeopen] x393_dut.x393_i.sensors393_i.sensor_channel_block[3].
[sst_width] 358
[treeopen] x393_dut.x393_i.timing393_i.
[sst_width] 440
[signals_width] 293
[sst_expanded] 1
[sst_vpaned_height] 540
@@ -299,8 +292,67 @@ x393_dut.x393_i.sync_resets_i.rst_early_master
@1401200
-resets
@800200
-sensor_channel0
-linescan0
@1000200
-linescan0
@800200
-tiled0
@28
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.frame_en
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.frame_start
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.next_page
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.busy_r
(3)x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.frame_start_r[4:0]
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.start_not_partial
@c00028
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.page_cntr[2:0]
@28
(0)x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.page_cntr[2:0]
(1)x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.page_cntr[2:0]
(2)x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.page_cntr[2:0]
@1401200
-group_end
@28
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.last_block
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.xfer_page_rst_rd
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.xfer_page_rst_wr
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.xfer_page_rst_neg
x393_dut.x393_i.mcntrl393_i.sens_comp_block[0].mcntrl_tiled_rd_compressor_i.frame_done
@800200
-rbuffer0
@28
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.chn_rd_buf_i.wpage_set
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.chn_rd_buf_i.wpage_in[1:0]
@8028
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.chn_rd_buf_i.page_r[1:0]
@8022
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.chn_rd_buf_i.waddr[6:0]
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.chn_rd_buf_i.ext_raddr[11:0]
@28
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.chn_rd_buf_i.we
@800200
-compressor_address
@28
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.cmprs_macroblock_buf_iface_i.xclk
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.cmprs_macroblock_buf_iface_i.xfer_reset_page_rd
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.cmprs_macroblock_buf_iface_i.reset_page_rd
@8028
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.cmprs_pixel_buf_iface_i.start_page[1:0]
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.cmprs_macroblock_buf_iface_i.next_invalid[2:0]
@1000200
-compressor_address
-rbuffer0
-tiled0
@800200
-rtc
@28
x393_dut.x393_i.timing393_i.rtc393_i.enable_rtc
@200
-
@1000200
-rtc
@c00200
-sensor_channel0
-sens_sync
@28
x393_dut.x393_i.sensors393_i.sensor_channel_block[0].sensor_channel_i.sens_sync_i.sof_in
@@ -396,7 +448,6 @@ x393_dut.x393_i.sensors393_i.sensor_channel_block[0].sensor_channel_i.sens_paral
x393_dut.x393_i.sensors393_i.sensor_channel_block[0].sensor_channel_i.sens_parallel12_i.trigger_mode
@1401200
-debug_mmcm_clk
@1000200
-sensor_channel0
@c00200
-par12_hispi_psp4l1
@@ -770,7 +821,7 @@ x393_dut.x393_i.compressor393_i.cmprs_channel_block[2].jp_channel_i.buf_pxd[7:0]
x393_dut.x393_i.compressor393_i.cmprs_channel_block[3].jp_channel_i.buf_pxd[7:0]
@1401200
-compressors_all
@c00201
@c00200
-cmdseq_0
@28
x393_dut.x393_i.frame_sequencer_block[0].cmd_frame_sequencer_i.frame_sync
@@ -964,9 +1015,9 @@ x393_dut.x393_i.frame_sequencer_block[0].cmd_frame_sequencer_i.valid
x393_dut.x393_i.frame_sequencer_block[0].cmd_frame_sequencer_i.ackn
@1001200
-group_end
@1401201
@1401200
-cmdseq_0
@800200
@c00200
-cmdseq_mux
@22
x393_dut.x393_i.cmd_seq_mux_i.frame_num0[3:0]
@@ -1014,7 +1065,7 @@ x393_dut.x393_i.cmd_seq_mux_i.pri_enc_w[1:0]
x393_dut.x393_i.cmd_seq_mux_i.pri_one[3:0]
@28
x393_dut.x393_i.cmd_seq_mux_i.chn_r[1:0]
@1000200
@1401200
-cmdseq_mux
@c00200
-gpio
@@ -1114,8 +1165,6 @@ x393_dut.x393_i.gpio393_i.io_pins[9:0]
-group_end
@1401200
-gpio
@200
-
@c00200
-sensor_channel1
@200
@@ -1414,7 +1463,7 @@ x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.vsync_late
x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.hclk
@1401200
-compressor_channel0
@800200
@c00200
-interrupts
@800022
x393_dut.irq_r[8:0]
@@ -1452,7 +1501,7 @@ x393_dut.x393_i.compressor393_i.cmprs_channel_block[0].jp_channel_i.cmprs_status
-group_end
@200
-
@1000200
@1401200
-interrupts
@c00200
-afi0_mux
@@ -1695,7 +1744,15 @@ x393_dut.simul_axi_master_wdata_i.simul_axi_fifo_i.valid
-simul_axi_fifo
@1401200
-axi_master_wdata
@800200
-frames
@22
x393_dut.x393_i.frame_num[15:0]
@23
x393_dut.x393_i.frame_num_compressed[15:0]
@200
-
@1000200
-frames
[pattern_trace] 1
[pattern_trace] 0
+2 −1
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@
 * contains all the components and scripts required to completely simulate it
 * with at least one of the Free Software programs.
 */
          parameter FPGA_VERSION =          32'h039300a6;      // parallel, adding frame sync delays to mcntrl_linear 79.26, mclk and xclk violated
          parameter FPGA_VERSION =          32'h039300a7;      // parallel, chnging parameter to reset buffer pages at each frame start. 79.4%, -0.022 (2 paths)
//          parameter FPGA_VERSION =          32'h039300a6;      // parallel, adding frame sync delays to mcntrl_linear 79.26, mclk and xclk violated
//          parameter FPGA_VERSION =          32'h039300a5;      // parallel, fixing command sequencer and ARO 80.21%, -0.068
//          parameter FPGA_VERSION =          32'h039300a4;      // parallel 79.66, -0.1
//          parameter FPGA_VERSION =          32'h039300a3;      // hispi, after minor interface changes (separated control bits)80.52% -0.163
+4 −2
Original line number Diff line number Diff line
@@ -250,7 +250,8 @@
                                                        // spread long-programming (tiled) over fast-programming (linear) requests.
                                                        // But that should not be too big to maintain 2-level priorities

    parameter MCNTRL_SCANLINE_FRAME_PAGE_RESET =1'b0, // reset internal page number to zero at the frame start (false - only when hard/soft reset)
//    parameter MCNTRL_SCANLINE_FRAME_PAGE_RESET =1'b0, // reset internal page number to zero at the frame start (false - only when hard/soft reset)
    parameter MCNTRL_SCANLINE_FRAME_PAGE_RESET =1'b1, // reset internal page number to zero at the frame start (false - only when hard/soft reset)
    parameter MAX_TILE_WIDTH=                   6,     // number of bits to specify maximal tile (width-1) (6 -> 64)
    parameter MAX_TILE_HEIGHT=                  6,     // number of bits to specify maximal tile (height-1) (6 -> 64)
    parameter MCNTRL_TILED_CHN2_ADDR=       'h140,
@@ -279,7 +280,8 @@
                                                   // if memory controller will allow programming several sequences in advance to
                                                   // spread long-programming (tiled) over fast-programming (linear) requests.
                                                   // But that should not be too big to maintain 2-level priorities
    parameter MCNTRL_TILED_FRAME_PAGE_RESET =1'b0, // reset internal page number to zero at the frame start (false - only when hard/soft reset)
//    parameter MCNTRL_TILED_FRAME_PAGE_RESET =1'b0, // reset internal page number to zero at the frame start (false - only when hard/soft reset)
    parameter MCNTRL_TILED_FRAME_PAGE_RESET =1'b1, // reset internal page number to zero at the frame start (false - only when hard/soft reset)
    parameter BUFFER_DEPTH32=                10,   // Block RAM buffer depth on a 32-bit port

    // bits in mode control word
+2 −2
Original line number Diff line number Diff line
@@ -417,7 +417,7 @@ inline struct interframe_params_t* updateIRQ_interframe(void) {
        @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 reset - reset all channles
        @param reset - reset all channels
        @param verbose - verbose level
        """
        if verbose >0 :
+80 −9
Original line number Diff line number Diff line
@@ -1059,13 +1059,43 @@ bitstream_set_path /usr/local/verilog/x393_parallel.bit
setupSensorsPower  "PAR12"  all  0  0.0

measure_all "*DI"

setSensorClock 24.0 "2V5_LVDS"
specify_phys_memory
specify_window
set_rtc # maybe not needed as it can be set differently
camsync_setup 0xf # sensor mask - use local timestamps)

#later:
#Repeat COMPRESSOR_RUN <= 2
#set_sensor_lens_flat_parameters         0               0           0     0    0    0 0x8000  0x8000    0x8000     0x8000    0x8000        0              0            1 



Other required actions:
imgsrv -p 2323
#restart PHP - it can get errors while opening/mmaping at startup, then some functions fail
killall lighttpd; /usr/sbin/lighttpd -f /etc/lighttpd.conf
/www/pages/exif.php init=/etc/Exif_template.xml




#see what is needed, reimplement in the driver
# DONE set_sensor_lens_flat_heights  <num_sensor>  <height0_m1=None>  <height1_m1=None>  <height2_m1=None> 
set_sensor_lens_flat_heights         0            0xffff
# SUPPOSED TO BE IMPLEMENTED ALREADY set_sensor_lens_flat_parameters  <num_sensor>  <num_sub_sensor>  <AX> <AY> <BX> <BY> <C>   <scales0> <scales1> <scales2> <scales3>  <fatzero_in>  <fatzero_out>  <post_scale> 
set_sensor_lens_flat_parameters         0               0           0     0    0    0 0x8000  0x8000    0x8000     0x8000    0x8000        0              0            1 
# DONE set_sensor_gamma_heights  <num_sensor>  <height0_m1>  <height1_m1>  <height2_m1> 
set_sensor_gamma_heights        0         0xffff            0            0
 
# DONE set_sensor_mode  <num_sensor>  <hist_en=None>  <hist_nrst=None>  <chn_en=None>  <bits16=None> 
set_sensor_mode
        0              1              1                  1             0
#*DONE set_sensor_gamma_ctl  <num_sensor>  <bayer=0>  <table_page=0>  <en_input=True>  <repet_mode=True>  <trig=False>
set_sensor_gamma_ctl        0            0            0             True               True            False

#Status for the compressor channel - needed to get frame numbers.
write_control_register 0x601 0xc0
                   

#setup_all_sensors True None 0xf
@@ -1117,11 +1147,10 @@ compressor_control all 3
#jpeg_write  "img.jpeg" 0 80
jpeg_write  "img.jpeg" All 80

#changing quality (example 85%):
set_qtables all 0 85
compressor_control all 2
#jpeg_write  "img.jpeg" all 85
jpeg_write  "img.jpeg" 0 85
# Set Bayer = 3 (probably #1 and #3 need different hact/pxd delays to use the same compressor bayer for all channels)
compressor_control  all  None  None  None None None  0
write_control_register 0x6c7 0x10000
write_control_register 0x602 0x40f00a1


#To reset all (before reprogramming): This one works, reset_channels - does not
@@ -1180,18 +1209,53 @@ sleep_ms 200
control_sensor_memory  0 reset True
control_compressor_memory  0 reset True

#===== reset compressor only ====
#Reset 0 but sensor all
compressor_control 0 1
control_compressor_memory  0 stop
sleep_ms 200
control_compressor_memory  0 reset True

#===== restart compressor only ====
compressor_control 0 1
control_sensor_memory  0 stop
sleep_ms 200
control_compressor_memory  0 repetitive
compressor_control 0 3



################  Status registers #########################
read_status 0x20 # status i2c
read_status 0x18 #status AFI0

#define X393_CMPRS_STATUS__0                             0x40002040 // Status of the compressor channel (incl. interrupt, data type: x393_cmprs_status_t (ro)
#define X393_AFIMUX0_STATUS__0                           0x40002060 // Status of the AFI MUX 0 (including image pointer), data type: x393_afimux_status_t (ro)
#define X393_SENSI2C_STATUS__0                           0x40002080 // Status of the sensors i2c, data type: x393_status_sens_i2c_t (ro)
#define X393_SENSIO_STATUS__0                            0x40002084 // Status of the sensor ports I/O pins, data type: x393_status_sens_io_t (ro)
#define X393_CMDSEQMUX_STATUS                            0x400020e0 // CMDSEQMUX status data (frame numbers and interrupts, data type: x393_cmdseqmux_status_t (ro)
#    parameter MCONTR_SENS_STATUS_BASE =           'h28, // .. 'h2b not used {done, busy}
#    parameter MCONTR_CMPRS_STATUS_BASE =          'h2c, // .. 'h2f not used {done, busy}



write_control_register 0x641 0xc0 # was not enabled? Needed to read addresses?



########### Trying to make i2c work in driver #########
Other required actions:
/www/pages/exif.php init=/etc/Exif_template.xml
imgsrv -p 2323
#restart PHP - it can get errors while opening/mmaping at startupo, then some functions fail
#restart PHP - it can get errors while opening/mmaping at startup, then some functions fail
killall lighttpd; /usr/sbin/lighttpd -f /etc/lighttpd.conf
/www/pages/exif.php init=/etc/Exif_template.xml


setSensorClock 24.0 "2V5_LVDS"

set_rtc # maybe not needed as it can be set differently
camsync_setup 0xf # sensor mask - use local timestamps)

write_control_register 0x6c7 0x10000
                   
#set_sensor_io_ctl  <num_sensor>  <mrst=None>  <arst=None>  <aro=None>  <mmcm_rst=None>  <clk_sel=None>  <set_delays=False>  <quadrants=None>
set_sensor_io_ctl  0             True            True       False           True              1               False
@@ -1232,6 +1296,13 @@ compressor_control all None None None None None 0
tar -C / -xzpf /usr.tar.gz;
/usr/sbin/lighttpd -f /etc/lighttpd.conf

#**********************************
afi_mux_reset 0 1 #reset channel 0 AFI (afi_mux_reset 0 15 - all channels) 
afi_mux_reset 0 0 # release all resets




################## Simulate Serial ####################
./py393/test_mcntrl.py @py393/cocoargs  --simulated=localhost:7777
measure_all "*DI"
Loading