Commit 654584f3 authored by Andrey Filippov's avatar Andrey Filippov

More development of the Verilog and Python code for LWIR sensors

parent 1ccb2eee
...@@ -129,6 +129,8 @@ module cmprs_cmd_decode#( ...@@ -129,6 +129,8 @@ module cmprs_cmd_decode#(
parameter CMPRS_CBIT_BAYER_BITS = 2, // number of bits to control compressor Bayer shift mode parameter CMPRS_CBIT_BAYER_BITS = 2, // number of bits to control compressor Bayer shift mode
parameter CMPRS_CBIT_FOCUS = 23, // bit # to control compressor focus display mode parameter CMPRS_CBIT_FOCUS = 23, // bit # to control compressor focus display mode
parameter CMPRS_CBIT_FOCUS_BITS = 2, // number of bits to control compressor focus display mode parameter CMPRS_CBIT_FOCUS_BITS = 2, // number of bits to control compressor focus display mode
parameter CMPRS_CBIT_ROWS_LSB = 28, // bit # Four height LSBs in raw mode
parameter CMPRS_CBIT_ROWS_LSB_BITS = 4, // number of bits to control four height LSBs in raw mode
// compressor bit-fields decode // compressor bit-fields decode
parameter CMPRS_CBIT_RUN_RST = 2'h0, // reset compressor, stop immediately parameter CMPRS_CBIT_RUN_RST = 2'h0, // reset compressor, stop immediately
// parameter CMPRS_CBIT_RUN_DISABLE = 2'h1, // disable compression of the new frames, finish any already started // parameter CMPRS_CBIT_RUN_DISABLE = 2'h1, // disable compression of the new frames, finish any already started
...@@ -205,6 +207,7 @@ module cmprs_cmd_decode#( ...@@ -205,6 +207,7 @@ module cmprs_cmd_decode#(
output reg [ 2:0] cmprs_qpage, // [2:0] - quantizator page number (0..7) output reg [ 2:0] cmprs_qpage, // [2:0] - quantizator page number (0..7)
output reg cmprs_dcsub, // subtract dc level before DCT, restore later output reg cmprs_dcsub, // subtract dc level before DCT, restore later
output reg [ 1:0] cmprs_fmode, //[1:0] - focus mode output reg [ 1:0] cmprs_fmode, //[1:0] - focus mode
output reg [ 3:0] raw_rows_lsb, // Four LSBs of the window height - used in raw mode
output reg [ 1:0] bayer_shift, // additional shift to bayer mosaic output reg [ 1:0] bayer_shift, // additional shift to bayer mosaic
output reg ignore_color, output reg ignore_color,
...@@ -246,6 +249,7 @@ module cmprs_cmd_decode#( ...@@ -246,6 +249,7 @@ module cmprs_cmd_decode#(
reg cmprs_dcsub_mclk; // subtract dc level before DCT, restore later reg cmprs_dcsub_mclk; // subtract dc level before DCT, restore later
reg [ 3:0] cmprs_mode_mclk; // [3:0] - compressor mode reg [ 3:0] cmprs_mode_mclk; // [3:0] - compressor mode
reg [ 1:0] cmprs_fmode_mclk; //[1:0] - focus mode reg [ 1:0] cmprs_fmode_mclk; //[1:0] - focus mode
reg [ 3:0] rows_lsb_mclk; // [3:0] - Four LSBs of the window height - used in raw mode
reg [ 1:0] bayer_shift_mclk; // additional shift to bayer mosaic reg [ 1:0] bayer_shift_mclk; // additional shift to bayer mosaic
reg [30:0] format_mclk; // left margin and macroblock rows/columns reg [30:0] format_mclk; // left margin and macroblock rows/columns
...@@ -256,6 +260,8 @@ module cmprs_cmd_decode#( ...@@ -256,6 +260,8 @@ module cmprs_cmd_decode#(
reg cmprs_dcsub_xclk; // subtract dc level before DCT, restore later reg cmprs_dcsub_xclk; // subtract dc level before DCT, restore later
reg [ 3:0] cmprs_mode_xclk; // [3:0] - compressor mode reg [ 3:0] cmprs_mode_xclk; // [3:0] - compressor mode
reg [ 1:0] cmprs_fmode_xclk; //[1:0] - focus mode reg [ 1:0] cmprs_fmode_xclk; //[1:0] - focus mode
reg [ 3:0] rows_lsb_xclk; // Four LSBs of the window height - used in raw mode
reg [ 1:0] bayer_shift_xclk; // additional shift to bayer mosaic reg [ 1:0] bayer_shift_xclk; // additional shift to bayer mosaic
reg [30:0] format_xclk; // left margin and macroblock rows/columns reg [30:0] format_xclk; // left margin and macroblock rows/columns
...@@ -311,6 +317,9 @@ module cmprs_cmd_decode#( ...@@ -311,6 +317,9 @@ module cmprs_cmd_decode#(
if (mrst) cmprs_fmode_mclk <= 0; if (mrst) cmprs_fmode_mclk <= 0;
else if (ctrl_we_r && di_r[CMPRS_CBIT_FOCUS]) cmprs_fmode_mclk <= di_r[CMPRS_CBIT_FOCUS-1 -:CMPRS_CBIT_FOCUS_BITS]; else if (ctrl_we_r && di_r[CMPRS_CBIT_FOCUS]) cmprs_fmode_mclk <= di_r[CMPRS_CBIT_FOCUS-1 -:CMPRS_CBIT_FOCUS_BITS];
if (mrst) rows_lsb_mclk <= 4'h0f;
else if (ctrl_we_r && di_r[CMPRS_CBIT_ROWS_LSB]) rows_lsb_mclk <= di_r[CMPRS_CBIT_ROWS_LSB-1 -:CMPRS_CBIT_ROWS_LSB_BITS];
if (mrst) bayer_shift_mclk <= 0; if (mrst) bayer_shift_mclk <= 0;
else if (ctrl_we_r && di_r[CMPRS_CBIT_BAYER]) bayer_shift_mclk <= di_r[CMPRS_CBIT_BAYER-1 -:CMPRS_CBIT_BAYER_BITS]; else if (ctrl_we_r && di_r[CMPRS_CBIT_BAYER]) bayer_shift_mclk <= di_r[CMPRS_CBIT_BAYER-1 -:CMPRS_CBIT_BAYER_BITS];
...@@ -343,6 +352,7 @@ module cmprs_cmd_decode#( ...@@ -343,6 +352,7 @@ module cmprs_cmd_decode#(
cmprs_dcsub_xclk <= cmprs_dcsub_mclk; cmprs_dcsub_xclk <= cmprs_dcsub_mclk;
cmprs_mode_xclk <= cmprs_mode_mclk; cmprs_mode_xclk <= cmprs_mode_mclk;
cmprs_fmode_xclk <= cmprs_fmode_mclk; cmprs_fmode_xclk <= cmprs_fmode_mclk;
rows_lsb_xclk <= rows_lsb_mclk;
bayer_shift_xclk <= bayer_shift_mclk; bayer_shift_xclk <= bayer_shift_mclk;
end end
...@@ -356,6 +366,7 @@ module cmprs_cmd_decode#( ...@@ -356,6 +366,7 @@ module cmprs_cmd_decode#(
cmprs_qpage <= cmprs_qpage_xclk; cmprs_qpage <= cmprs_qpage_xclk;
cmprs_dcsub <= cmprs_dcsub_xclk; cmprs_dcsub <= cmprs_dcsub_xclk;
cmprs_fmode <= cmprs_fmode_xclk; cmprs_fmode <= cmprs_fmode_xclk;
raw_rows_lsb <= rows_lsb_xclk;
bayer_shift <= bayer_shift_xclk; bayer_shift <= bayer_shift_xclk;
left_marg <= format_xclk[CMPRS_FRMT_LMARG +: CMPRS_FRMT_LMARG_BITS]; left_marg <= format_xclk[CMPRS_FRMT_LMARG +: CMPRS_FRMT_LMARG_BITS];
......
...@@ -62,7 +62,8 @@ module cmprs_raw_buf_iface #( ...@@ -62,7 +62,8 @@ module cmprs_raw_buf_iface #(
input cmprs_run_mclk, // 0 - off or stopping, reset frame_pre_run input cmprs_run_mclk, // 0 - off or stopping, reset frame_pre_run
// input [ 4:0] left_marg, // left margin (for not-yet-implemented) mono JPEG (8 lines tile row) can need 7 bits (mod 32 - tile) // input [ 4:0] left_marg, // left margin (for not-yet-implemented) mono JPEG (8 lines tile row) can need 7 bits (mod 32 - tile)
input [12:0] n_blocks_in_row_m1, // number of macroblocks in a macroblock row minus 1 input [12:0] n_blocks_in_row_m1, // number of macroblocks in a macroblock row minus 1
input [12:0] n_block_rows_m1, // number of macroblock rows in a frame minus 1 // input [12:0] n_block_rows_m1, // number of macroblock rows in a frame minus 1
input [16:0] n_block_rows_m1, // number of macroblock rows in a frame minus 1
input stuffer_running, // @xclk, active while bit stuffer or trailer are running input stuffer_running, // @xclk, active while bit stuffer or trailer are running
input raw_be16, // 0: bytes 0-1-2-3-4-5..., 1: bytes 1-0-3-2-5-4... input raw_be16, // 0: bytes 0-1-2-3-4-5..., 1: bytes 1-0-3-2-5-4...
output [11:0] buf_ra, // buffer read address (2 MSB - page number) output [11:0] buf_ra, // buffer read address (2 MSB - page number)
...@@ -206,7 +207,8 @@ module cmprs_raw_buf_iface #( ...@@ -206,7 +207,8 @@ module cmprs_raw_buf_iface #(
quad_last <= mode_valid && !(|quads_left); // valid from 2 after frame_pre_start_r or after quad_r[3] quad_last <= mode_valid && !(|quads_left); // valid from 2 after frame_pre_start_r or after quad_r[3]
if (frame_pre_start_r) rows_left <= {n_block_rows_m1, 4'b1111}; // if (frame_pre_start_r) rows_left <= {n_block_rows_m1, 4'b1111};
if (frame_pre_start_r) rows_left <= n_block_rows_m1; //n_block_rows_m1 now combines n_block_rows_m1 and tile vstep ?
else if ((quad_r[2] && quad_last)) rows_left <= rows_left - 1; else if ((quad_r[2] && quad_last)) rows_left <= rows_left - 1;
rows_last <= {rows_last[0], mode_valid & ~(|rows_left)}; rows_last <= {rows_last[0], mode_valid & ~(|rows_left)};
......
...@@ -84,6 +84,9 @@ module compressor393 # ( ...@@ -84,6 +84,9 @@ module compressor393 # (
parameter CMPRS_CBIT_BAYER_BITS = 2, // number of bits to control compressor Bayer shift mode parameter CMPRS_CBIT_BAYER_BITS = 2, // number of bits to control compressor Bayer shift mode
parameter CMPRS_CBIT_FOCUS = 23, // bit # to control compressor focus display mode parameter CMPRS_CBIT_FOCUS = 23, // bit # to control compressor focus display mode
parameter CMPRS_CBIT_FOCUS_BITS = 2, // number of bits to control compressor focus display mode parameter CMPRS_CBIT_FOCUS_BITS = 2, // number of bits to control compressor focus display mode
parameter CMPRS_CBIT_ROWS_LSB = 28, // bit # Four height LSBs in raw mode
parameter CMPRS_CBIT_ROWS_LSB_BITS = 4, // number of bits to control four height LSBs in raw mode
// compressor bit-fields decode // compressor bit-fields decode
parameter CMPRS_CBIT_RUN_RST = 2'h0, // reset compressor, stop immediately parameter CMPRS_CBIT_RUN_RST = 2'h0, // reset compressor, stop immediately
// parameter CMPRS_CBIT_RUN_DISABLE = 2'h1, // disable compression of the new frames, finish any already started // parameter CMPRS_CBIT_RUN_DISABLE = 2'h1, // disable compression of the new frames, finish any already started
...@@ -382,6 +385,8 @@ module compressor393 # ( ...@@ -382,6 +385,8 @@ module compressor393 # (
.CMPRS_CBIT_BAYER_BITS (CMPRS_CBIT_BAYER_BITS), .CMPRS_CBIT_BAYER_BITS (CMPRS_CBIT_BAYER_BITS),
.CMPRS_CBIT_FOCUS (CMPRS_CBIT_FOCUS), .CMPRS_CBIT_FOCUS (CMPRS_CBIT_FOCUS),
.CMPRS_CBIT_FOCUS_BITS (CMPRS_CBIT_FOCUS_BITS), .CMPRS_CBIT_FOCUS_BITS (CMPRS_CBIT_FOCUS_BITS),
.CMPRS_CBIT_ROWS_LSB (CMPRS_CBIT_ROWS_LSB),
.CMPRS_CBIT_ROWS_LSB_BITS (CMPRS_CBIT_ROWS_LSB_BITS),
.CMPRS_CBIT_RUN_RST (CMPRS_CBIT_RUN_RST), .CMPRS_CBIT_RUN_RST (CMPRS_CBIT_RUN_RST),
.CMPRS_CBIT_RUN_STANDALONE (CMPRS_CBIT_RUN_STANDALONE), .CMPRS_CBIT_RUN_STANDALONE (CMPRS_CBIT_RUN_STANDALONE),
.CMPRS_CBIT_RUN_ENABLE (CMPRS_CBIT_RUN_ENABLE), .CMPRS_CBIT_RUN_ENABLE (CMPRS_CBIT_RUN_ENABLE),
......
...@@ -78,6 +78,8 @@ module jp_channel#( ...@@ -78,6 +78,8 @@ module jp_channel#(
parameter CMPRS_CBIT_BAYER_BITS = 2, // number of bits to control compressor Bayer shift mode parameter CMPRS_CBIT_BAYER_BITS = 2, // number of bits to control compressor Bayer shift mode
parameter CMPRS_CBIT_FOCUS = 23, // bit # to control compressor focus display mode parameter CMPRS_CBIT_FOCUS = 23, // bit # to control compressor focus display mode
parameter CMPRS_CBIT_FOCUS_BITS = 2, // number of bits to control compressor focus display mode parameter CMPRS_CBIT_FOCUS_BITS = 2, // number of bits to control compressor focus display mode
parameter CMPRS_CBIT_ROWS_LSB = 28, // bit # Four height LSBs in raw mode
parameter CMPRS_CBIT_ROWS_LSB_BITS = 4, // number of bits to control four height LSBs in raw mode
// compressor bit-fields decode // compressor bit-fields decode
parameter CMPRS_CBIT_RUN_RST = 2'h0, // reset compressor, stop immediately parameter CMPRS_CBIT_RUN_RST = 2'h0, // reset compressor, stop immediately
// parameter CMPRS_CBIT_RUN_DISABLE = 2'h1, // disable compression of the new frames, finish any already started // parameter CMPRS_CBIT_RUN_DISABLE = 2'h1, // disable compression of the new frames, finish any already started
...@@ -253,7 +255,7 @@ module jp_channel#( ...@@ -253,7 +255,7 @@ module jp_channel#(
wire [CMPRS_CSAT_CR_BITS-1:0] m_cr; // [9:0] scale for CR - default 0.713 (10'hb6) wire [CMPRS_CSAT_CR_BITS-1:0] m_cr; // [9:0] scale for CR - default 0.713 (10'hb6)
wire [ 1:0] cmprs_fmode; // focusing/overlay mode wire [ 1:0] cmprs_fmode; // focusing/overlay mode
wire [ 3:0] raw_rows_lsb; // four LSBs of window height in raw mode, 0 means 'h10, 'hf means f
//TODO: assign next 5 values from converter_type[2:0] //TODO: assign next 5 values from converter_type[2:0]
wire [ 5:0] mb_w_m1; // macroblock width minus 1 wire [ 5:0] mb_w_m1; // macroblock width minus 1
wire [ 5:0] mb_h_m1; // macroblock height -1 wire [ 5:0] mb_h_m1; // macroblock height -1
...@@ -701,6 +703,8 @@ module jp_channel#( ...@@ -701,6 +703,8 @@ module jp_channel#(
.CMPRS_CBIT_BAYER_BITS (CMPRS_CBIT_BAYER_BITS), .CMPRS_CBIT_BAYER_BITS (CMPRS_CBIT_BAYER_BITS),
.CMPRS_CBIT_FOCUS (CMPRS_CBIT_FOCUS), .CMPRS_CBIT_FOCUS (CMPRS_CBIT_FOCUS),
.CMPRS_CBIT_FOCUS_BITS (CMPRS_CBIT_FOCUS_BITS), .CMPRS_CBIT_FOCUS_BITS (CMPRS_CBIT_FOCUS_BITS),
.CMPRS_CBIT_ROWS_LSB (CMPRS_CBIT_ROWS_LSB),
.CMPRS_CBIT_ROWS_LSB_BITS (CMPRS_CBIT_ROWS_LSB_BITS),
.CMPRS_CBIT_RUN_RST (CMPRS_CBIT_RUN_RST), .CMPRS_CBIT_RUN_RST (CMPRS_CBIT_RUN_RST),
.CMPRS_CBIT_RUN_STANDALONE (CMPRS_CBIT_RUN_STANDALONE), .CMPRS_CBIT_RUN_STANDALONE (CMPRS_CBIT_RUN_STANDALONE),
.CMPRS_CBIT_RUN_ENABLE (CMPRS_CBIT_RUN_ENABLE), .CMPRS_CBIT_RUN_ENABLE (CMPRS_CBIT_RUN_ENABLE),
...@@ -760,7 +764,8 @@ module jp_channel#( ...@@ -760,7 +764,8 @@ module jp_channel#(
.cmprs_en_late_xclk (stuffer_en), // output reg - extended enable to allow stuffer to gracefully finish .cmprs_en_late_xclk (stuffer_en), // output reg - extended enable to allow stuffer to gracefully finish
.cmprs_qpage (cmprs_qpage), // output[2:0] reg .cmprs_qpage (cmprs_qpage), // output[2:0] reg
.cmprs_dcsub (subtract_dc), // output reg .cmprs_dcsub (subtract_dc), // output reg
.cmprs_fmode (cmprs_fmode), // output[1:0] reg .cmprs_fmode (cmprs_fmode), // output[1:0] reg
.raw_rows_lsb (raw_rows_lsb), // output[3:0] reg
.bayer_shift (bayer_phase), // output[1:0] reg .bayer_shift (bayer_phase), // output[1:0] reg
.ignore_color (ignore_color), // output reg .ignore_color (ignore_color), // output reg
.four_blocks (), // output reg Not used? .four_blocks (), // output reg Not used?
...@@ -888,7 +893,7 @@ module jp_channel#( ...@@ -888,7 +893,7 @@ module jp_channel#(
.frame_go (frame_go_raw), // input .frame_go (frame_go_raw), // input
.cmprs_run_mclk (cmprs_run_mclk), // input .cmprs_run_mclk (cmprs_run_mclk), // input
.n_blocks_in_row_m1 (n_blocks_in_row_m1), // input[12:0] .n_blocks_in_row_m1 (n_blocks_in_row_m1), // input[12:0]
.n_block_rows_m1 (n_block_rows_m1), // input[12:0] .n_block_rows_m1 ({n_block_rows_m1,raw_rows_lsb}), // input[12:0]
.stuffer_running (stuffer_running), // input .stuffer_running (stuffer_running), // input
.raw_be16 (raw_be16), // input .raw_be16 (raw_be16), // input
.buf_ra (raw_buf_ra), // output[11:0] .buf_ra (raw_buf_ra), // output[11:0]
......
...@@ -35,7 +35,10 @@ ...@@ -35,7 +35,10 @@
* contains all the components and scripts required to completely simulate it * contains all the components and scripts required to completely simulate it
* with at least one of the Free Software programs. * with at least one of the Free Software programs.
*/ */
parameter FPGA_VERSION = 32'h03930107; // parallel - 17.4 - restored delay after linear, fixed bug, all met parameter FPGA_VERSION = 32'h03930120; //
// parameter FPGA_VERSION = 32'h03930107; // parallel - 17.4 - restored delay after linear, fixed bug, all met
// parameter FPGA_VERSION = 32'h03930110; //A serial - 17.4 - restored delay after linear, fixed bug, timing met // parameter FPGA_VERSION = 32'h03930110; //A serial - 17.4 - restored delay after linear, fixed bug, timing met
// parameter FPGA_VERSION = 32'h03930110; // serial - 17.4 - restored delay after linear, fixed bug, timing failed // parameter FPGA_VERSION = 32'h03930110; // serial - 17.4 - restored delay after linear, fixed bug, timing failed
// parameter FPGA_VERSION = 32'h03930107; // parallel - 17.4 - restored delay after linear, fixed bug, all met // parameter FPGA_VERSION = 32'h03930107; // parallel - 17.4 - restored delay after linear, fixed bug, all met
......
...@@ -570,7 +570,7 @@ ...@@ -570,7 +570,7 @@
parameter VOSPI_HACT_TO_HACT_EOF = 2, // minimal clock cycles from HACT to HACT or to EOF parameter VOSPI_HACT_TO_HACT_EOF = 2, // minimal clock cycles from HACT to HACT or to EOF
parameter VOSPI_MCLK_HALFDIV = 4, // divide mclk (200Hhz) to get 50 MHz, then divide by 2 and use for sensor 25MHz clock parameter VOSPI_MCLK_HALFDIV = 4, // divide mclk (200Hhz) to get 50 MHz, then divide by 2 and use for sensor 25MHz clock
//`else //`else
//sensor_fifo parameters //sensor_fifo parameters (for parallel12)
parameter SENSOR_DATA_WIDTH = 12, parameter SENSOR_DATA_WIDTH = 12,
parameter SENSOR_FIFO_2DEPTH = 4, parameter SENSOR_FIFO_2DEPTH = 4,
parameter [3:0] SENSOR_FIFO_DELAY = 5, // 7, parameter [3:0] SENSOR_FIFO_DELAY = 5, // 7,
...@@ -755,6 +755,8 @@ ...@@ -755,6 +755,8 @@
parameter CMPRS_CBIT_BAYER_BITS = 2, // number of bits to control compressor Bayer shift mode parameter CMPRS_CBIT_BAYER_BITS = 2, // number of bits to control compressor Bayer shift mode
parameter CMPRS_CBIT_FOCUS = 23, // bit # to control compressor focus display mode parameter CMPRS_CBIT_FOCUS = 23, // bit # to control compressor focus display mode
parameter CMPRS_CBIT_FOCUS_BITS = 2, // number of bits to control compressor focus display mode parameter CMPRS_CBIT_FOCUS_BITS = 2, // number of bits to control compressor focus display mode
parameter CMPRS_CBIT_ROWS_LSB = 28, // bit # Four height LSBs in raw mode
parameter CMPRS_CBIT_ROWS_LSB_BITS = 4, // number of bits to control four height LSBs in raw mode
// compressor bit-fields decode // compressor bit-fields decode
parameter CMPRS_CBIT_RUN_RST = 2'h0, // reset compressor, stop immediately parameter CMPRS_CBIT_RUN_RST = 2'h0, // reset compressor, stop immediately
// parameter CMPRS_CBIT_RUN_DISABLE = 2'h1, // disable compression of the new frames, finish any already started // parameter CMPRS_CBIT_RUN_DISABLE = 2'h1, // disable compression of the new frames, finish any already started
......
...@@ -309,6 +309,7 @@ SENS_LENS_RADDR = int ...@@ -309,6 +309,7 @@ SENS_LENS_RADDR = int
SENSI2C_CMD_TABLE__TYPE = str SENSI2C_CMD_TABLE__TYPE = str
PXD_IOSTANDARD = str PXD_IOSTANDARD = str
SENSOR12BITS_TMD__RAW = str SENSOR12BITS_TMD__RAW = str
CMPRS_CBIT_ROWS_LSB_BITS = int
MAX_TILE_HEIGHT = int MAX_TILE_HEIGHT = int
BUF_CLK1X_PCLK = str BUF_CLK1X_PCLK = str
LOGGER_CONF_DBG_BITS = int LOGGER_CONF_DBG_BITS = int
...@@ -989,6 +990,7 @@ CMPRS_CBIT_RUN_ENABLE__RAW = str ...@@ -989,6 +990,7 @@ CMPRS_CBIT_RUN_ENABLE__RAW = str
AXI_RDADDR_LATENCY__TYPE = str AXI_RDADDR_LATENCY__TYPE = str
BUF_IPCLK_SENS3__RAW = str BUF_IPCLK_SENS3__RAW = str
CLK_STATUS__RAW = str CLK_STATUS__RAW = str
CMPRS_CBIT_ROWS_LSB__RAW = str
MULTICLK_BUF_AXIHP = str MULTICLK_BUF_AXIHP = str
FRAME_WIDTH_BITS = int FRAME_WIDTH_BITS = int
READ_PATTERN_OFFSET__TYPE = str READ_PATTERN_OFFSET__TYPE = str
...@@ -1725,6 +1727,7 @@ MCONTR_TOP_0BIT_ADDR = int ...@@ -1725,6 +1727,7 @@ MCONTR_TOP_0BIT_ADDR = int
NUM_CYCLES_05__RAW = str NUM_CYCLES_05__RAW = str
MCNTRL_TILED_FRAME_LAST__TYPE = str MCNTRL_TILED_FRAME_LAST__TYPE = str
QUADRANTS_PXD_HACT_VACT__RAW = str QUADRANTS_PXD_HACT_VACT__RAW = str
CMPRS_CBIT_ROWS_LSB_BITS__TYPE = str
MCONTR_CMPRS_STATUS_INC__RAW = str MCONTR_CMPRS_STATUS_INC__RAW = str
CMPRS_CBIT_CMODE_JP4DIFFHDR = int CMPRS_CBIT_CMODE_JP4DIFFHDR = int
TABLE_CORING_INDEX__RAW = str TABLE_CORING_INDEX__RAW = str
...@@ -1735,6 +1738,7 @@ MCONTR_ARBIT_ADDR__TYPE = str ...@@ -1735,6 +1738,7 @@ MCONTR_ARBIT_ADDR__TYPE = str
CAMSYNC_TRIG_DELAY1__RAW = str CAMSYNC_TRIG_DELAY1__RAW = str
LWIR_TELEMETRY_TEMP_LAST_KELVIN = int LWIR_TELEMETRY_TEMP_LAST_KELVIN = int
AXI_TASK_HOLD = float AXI_TASK_HOLD = float
CMPRS_CBIT_ROWS_LSB__TYPE = str
ADDRESS_NUMBER = int ADDRESS_NUMBER = int
CAMSYNC_GPIO_EXT_OUT = int CAMSYNC_GPIO_EXT_OUT = int
SENSOR_TIMING_FROM__RAW = str SENSOR_TIMING_FROM__RAW = str
...@@ -2314,6 +2318,7 @@ CMPRS_RAW = int ...@@ -2314,6 +2318,7 @@ CMPRS_RAW = int
CLK_PHASE__RAW = str CLK_PHASE__RAW = str
MCONTR_PHY_0BIT_DLY_RST = int MCONTR_PHY_0BIT_DLY_RST = int
GPIO_MASK__TYPE = str GPIO_MASK__TYPE = str
CMPRS_CBIT_ROWS_LSB_BITS__RAW = str
MULT_SAXI_BSLOG2__TYPE = str MULT_SAXI_BSLOG2__TYPE = str
TILED_STARTX = int TILED_STARTX = int
MEMBRIDGE_MASK__TYPE = str MEMBRIDGE_MASK__TYPE = str
...@@ -2431,6 +2436,7 @@ MCONTR_TOP_0BIT_MCONTR_EN__RAW = str ...@@ -2431,6 +2436,7 @@ MCONTR_TOP_0BIT_MCONTR_EN__RAW = str
MULTICLK_PHASE_FB__RAW = str MULTICLK_PHASE_FB__RAW = str
TABLE_HUFFMAN_INDEX__TYPE = str TABLE_HUFFMAN_INDEX__TYPE = str
SENS_GAMMA_MODE_EN_SET__TYPE = str SENS_GAMMA_MODE_EN_SET__TYPE = str
CMPRS_CBIT_ROWS_LSB = int
RTC_SET_STATUS__RAW = str RTC_SET_STATUS__RAW = str
SENS_CTRL_QUADRANTS = int SENS_CTRL_QUADRANTS = int
LD_DLY_PHASE__TYPE = str LD_DLY_PHASE__TYPE = str
......
...@@ -113,7 +113,8 @@ class X393Cmprs(object): ...@@ -113,7 +113,8 @@ class X393Cmprs(object):
cmode = None, cmode = None,
multi_frame = None, multi_frame = None,
bayer = None, bayer = None,
focus_mode = None): focus_mode = None,
row_lsb_raw = None):
""" """
Combine compressor control parameters into a single word. None value preserves old setting for the parameter Combine compressor control parameters into a single word. None value preserves old setting for the parameter
@param run_mode - 0 - reset, 2 - run single from memory, 3 - run repetitive @param run_mode - 0 - reset, 2 - run single from memory, 3 - run repetitive
...@@ -135,7 +136,8 @@ class X393Cmprs(object): ...@@ -135,7 +136,8 @@ class X393Cmprs(object):
CMPRS_CBIT_CMODE_MONO4 = 14 - mono 4 blocks CMPRS_CBIT_CMODE_MONO4 = 14 - mono 4 blocks
@param multi_frame - False - single-frame buffer, True - multi-frame video memory buffer, @param multi_frame - False - single-frame buffer, True - multi-frame video memory buffer,
@param bayer - Bayer shift (0..3) @param bayer - Bayer shift (0..3)
@param focus_mode - focus mode - how to combine image with "focus quality" in the result image @param focus_mode - focus mode - how to combine image with "focus quality" in the result image
@param row_lsb_raw - four LSBs of the window height - used in raw mode
@return combined data word @return combined data word
""" """
data = 0; data = 0;
...@@ -166,6 +168,9 @@ class X393Cmprs(object): ...@@ -166,6 +168,9 @@ class X393Cmprs(object):
if not focus_mode is None: if not focus_mode is None:
data |= (1 << vrlg.CMPRS_CBIT_FOCUS) data |= (1 << vrlg.CMPRS_CBIT_FOCUS)
data |= (focus_mode & ((1 << vrlg.CMPRS_CBIT_FOCUS_BITS) - 1)) << (vrlg.CMPRS_CBIT_FOCUS - vrlg.CMPRS_CBIT_FOCUS_BITS) data |= (focus_mode & ((1 << vrlg.CMPRS_CBIT_FOCUS_BITS) - 1)) << (vrlg.CMPRS_CBIT_FOCUS - vrlg.CMPRS_CBIT_FOCUS_BITS)
if not row_lsb_raw is None:
data |= (1 << vrlg.CMPRS_CBIT_ROWS_LSB)
data |= (row_lsb_raw & ((1 << vrlg.CMPRS_CBIT_ROWS_LSB_BITS) - 1)) << (vrlg.CMPRS_CBIT_ROWS_LSB - vrlg.CMPRS_CBIT_ROWS_LSB_BITS)
return data return data
def compressor_format (self, def compressor_format (self,
...@@ -218,7 +223,8 @@ class X393Cmprs(object): ...@@ -218,7 +223,8 @@ class X393Cmprs(object):
cmode = None, cmode = None,
multi_frame = None, multi_frame = None,
bayer = None, bayer = None,
focus_mode = None): focus_mode = None,
row_lsb_raw = None):
""" """
Combine compressor control parameters into a single word. None value preserves old setting for the parameter Combine compressor control parameters into a single word. None value preserves old setting for the parameter
@param chn - compressor channel number, "a" or "all" - same for all 4 channels @param chn - compressor channel number, "a" or "all" - same for all 4 channels
...@@ -242,6 +248,7 @@ class X393Cmprs(object): ...@@ -242,6 +248,7 @@ class X393Cmprs(object):
@param multi_frame - False - single-frame buffer, True - multi-frame video memory buffer, @param multi_frame - False - single-frame buffer, True - multi-frame video memory buffer,
@param bayer - Bayer shift (0..3) @param bayer - Bayer shift (0..3)
@param focus_mode - focus mode - how to combine image with "focus quality" in the result image @param focus_mode - focus mode - how to combine image with "focus quality" in the result image
@param row_lsb_raw - four LSBs of the window height - used in raw mode
""" """
try: try:
if (chn == all) or (chn[0].upper() == "A"): #all is a built-in function if (chn == all) or (chn[0].upper() == "A"): #all is a built-in function
...@@ -253,7 +260,8 @@ class X393Cmprs(object): ...@@ -253,7 +260,8 @@ class X393Cmprs(object):
cmode = cmode, cmode = cmode,
multi_frame = multi_frame, multi_frame = multi_frame,
bayer = bayer, bayer = bayer,
focus_mode = focus_mode) focus_mode = focus_mode,
row_lsb_raw = row_lsb_raw)
return return
except: except:
pass pass
...@@ -264,7 +272,8 @@ class X393Cmprs(object): ...@@ -264,7 +272,8 @@ class X393Cmprs(object):
cmode = cmode, cmode = cmode,
multi_frame = multi_frame, multi_frame = multi_frame,
bayer = bayer, bayer = bayer,
focus_mode = focus_mode) focus_mode = focus_mode,
row_lsb_raw = row_lsb_raw)
self.x393_axi_tasks.write_control_register(vrlg.CMPRS_GROUP_ADDR + chn * vrlg.CMPRS_BASE_INC + vrlg.CMPRS_CONTROL_REG, self.x393_axi_tasks.write_control_register(vrlg.CMPRS_GROUP_ADDR + chn * vrlg.CMPRS_BASE_INC + vrlg.CMPRS_CONTROL_REG,
data) data)
...@@ -519,11 +528,13 @@ class X393Cmprs(object): ...@@ -519,11 +528,13 @@ class X393Cmprs(object):
qbank, qbank,
dc_sub, dc_sub,
cmode, cmode,
bit16,
multi_frame, multi_frame,
bayer, bayer,
focus_mode, focus_mode,
num_macro_cols_m1, num_macro_cols_m1,
num_macro_rows_m1, num_macro_rows_m1,
row_lsb_raw,
left_margin, left_margin,
colorsat_blue, colorsat_blue,
colorsat_red, colorsat_red,
...@@ -547,11 +558,14 @@ class X393Cmprs(object): ...@@ -547,11 +558,14 @@ class X393Cmprs(object):
CMPRS_CBIT_CMODE_JP4DIFFHDRDIV2 = 10 - jp4, 4 blocks, differential, hdr,divide by 2 CMPRS_CBIT_CMODE_JP4DIFFHDRDIV2 = 10 - jp4, 4 blocks, differential, hdr,divide by 2
CMPRS_CBIT_CMODE_MONO1 = 11 - mono JPEG (not yet implemented) CMPRS_CBIT_CMODE_MONO1 = 11 - mono JPEG (not yet implemented)
CMPRS_CBIT_CMODE_MONO4 = 14 - mono 4 blocks CMPRS_CBIT_CMODE_MONO4 = 14 - mono 4 blocks
CMPRS_CBIT_CMODE_RAW = 15 - raw (uncompressed) mode
@param bit16 - 16-bit (2 bytes per pixel) mode
@param multi_frame - False - single-frame buffer, True - multi-frame video memory buffer, @param multi_frame - False - single-frame buffer, True - multi-frame video memory buffer,
@param bayer - Bayer shift (0..3) @param bayer - Bayer shift (0..3)
@param focus_mode - focus mode - how to combine image with "focus quality" in the result image @param focus_mode - focus mode - how to combine image with "focus quality" in the result image
@param num_macro_cols_m1 - number of macroblock colums minus 1 @param num_macro_cols_m1 - number of macroblock colums minus 1
@param num_macro_rows_m1 - number of macroblock rows minus 1 @param num_macro_rows_m1 - number of macroblock rows minus 1
@param row_lsb_raw - four LSBs of the window height - used in raw mode
@param left_margin - left margin of the first pixel (0..31) for 32-pixel wide colums in memory access @param left_margin - left margin of the first pixel (0..31) for 32-pixel wide colums in memory access
@param colorsat_blue - color saturation for blue (10 bits), 0x90 for 100% @param colorsat_blue - color saturation for blue (10 bits), 0x90 for 100%
@param colorsat_red - color saturation for red (10 bits), 0xb6 for 100% @param colorsat_red - color saturation for red (10 bits), 0xb6 for 100%
...@@ -567,6 +581,7 @@ class X393Cmprs(object): ...@@ -567,6 +581,7 @@ class X393Cmprs(object):
print ( "multi_frame = ",multi_frame) print ( "multi_frame = ",multi_frame)
print ( "bayer = ",bayer) print ( "bayer = ",bayer)
print ( "focus_mode = ",focus_mode) print ( "focus_mode = ",focus_mode)
print ( "row_lsb_raw = ", row_lsb_raw)
self.compressor_control( self.compressor_control(
chn = chn, # compressor channel number (0..3) chn = chn, # compressor channel number (0..3)
qbank = qbank, # [6:3] quantization table page qbank = qbank, # [6:3] quantization table page
......
...@@ -2133,7 +2133,7 @@ class X393ExportC(object): ...@@ -2133,7 +2133,7 @@ class X393ExportC(object):
dw.append(("pwdn_set", vrlg.VOSPI_PWDN + 1, 1, 0, "When set to 1, POWER DOWN is set to the 'pwdn' field value")) dw.append(("pwdn_set", vrlg.VOSPI_PWDN + 1, 1, 0, "When set to 1, POWER DOWN is set to the 'pwdn' field value"))
dw.append(("mclk", vrlg.VOSPI_MCLK, 1, 0, "Enable master clock (25MHz) to sensor")) dw.append(("mclk", vrlg.VOSPI_MCLK, 1, 0, "Enable master clock (25MHz) to sensor"))
dw.append(("mclk_set", vrlg.VOSPI_MCLK + 1, 1, 0, "When set to 1, MCLK enable is set to the 'mclk' field value")) dw.append(("mclk_set", vrlg.VOSPI_MCLK + 1, 1, 0, "When set to 1, MCLK enable is set to the 'mclk' field value"))
dw.append(("spi_en", vrlg.VOSPI_EN, 2, 0, "SPI Reset/enable: 0 - NOP, 1 - reset+disable, 2 - noreset, disable, 3 - noreset, enable")) dw.append(("spi_en", vrlg.VOSPI_EN, 2, 0, "SPI reset/enable: 0 - NOP, 1 - reset+disable, 2 - noreset, disable, 3 - noreset, enable"))
dw.append(("segm_zero", vrlg.VOSPI_SEGM0_OK, 1, 0, "OK to input segment 0 (invalid, valid are 1,2,3,4)")) dw.append(("segm_zero", vrlg.VOSPI_SEGM0_OK, 1, 0, "OK to input segment 0 (invalid, valid are 1,2,3,4)"))
dw.append(("segm_zero_set",vrlg.VOSPI_SEGM0_OK + 1, 1, 0, "Enable setting of segm_zero")) dw.append(("segm_zero_set",vrlg.VOSPI_SEGM0_OK + 1, 1, 0, "Enable setting of segm_zero"))
dw.append(("out_en", vrlg.VOSPI_OUT_EN, 1, 0, "Enable output sensor data to memory")) dw.append(("out_en", vrlg.VOSPI_OUT_EN, 1, 0, "Enable output sensor data to memory"))
...@@ -2362,6 +2362,8 @@ class X393ExportC(object): ...@@ -2362,6 +2362,8 @@ class X393ExportC(object):
dw.append(("bayer_set", vrlg.CMPRS_CBIT_BAYER, 1, 0, "Set 'bayer'")) dw.append(("bayer_set", vrlg.CMPRS_CBIT_BAYER, 1, 0, "Set 'bayer'"))
dw.append(("focus", vrlg.CMPRS_CBIT_FOCUS - vrlg.CMPRS_CBIT_FOCUS_BITS, vrlg.CMPRS_CBIT_FOCUS_BITS, 0, "Focus mode")) dw.append(("focus", vrlg.CMPRS_CBIT_FOCUS - vrlg.CMPRS_CBIT_FOCUS_BITS, vrlg.CMPRS_CBIT_FOCUS_BITS, 0, "Focus mode"))
dw.append(("focus_set", vrlg.CMPRS_CBIT_FOCUS, 1, 0, "Set 'focus'")) dw.append(("focus_set", vrlg.CMPRS_CBIT_FOCUS, 1, 0, "Set 'focus'"))
dw.append(("rows_lsb", vrlg.CMPRS_CBIT_ROWS_LSB - vrlg.CMPRS_CBIT_ROWS_LSB_BITS, vrlg.CMPRS_CBIT_ROWS_LSB_BITS, 0, "4 LSBs of the (height-1), used in raw mode"))
dw.append(("rows_lsb_set", vrlg.CMPRS_CBIT_ROWS_LSB, 1, 0, "Set 4 LSBs of the (height-1)"))
return dw return dw
def _enc_cmprs_coring_sel(self): def _enc_cmprs_coring_sel(self):
dw=[] dw=[]
...@@ -2374,7 +2376,7 @@ class X393ExportC(object): ...@@ -2374,7 +2376,7 @@ class X393ExportC(object):
return dw return dw
def _enc_cmprs_format(self): def _enc_cmprs_format(self):
dw=[] dw=[]
dw.append(("num_macro_cols_m1", vrlg.CMPRS_FRMT_MBCM1, vrlg.CMPRS_FRMT_MBCM1_BITS, 0, "Number of macroblock colums minus 1")) dw.append(("num_macro_cols_m1", vrlg.CMPRS_FRMT_MBCM1, vrlg.CMPRS_FRMT_MBCM1_BITS, 0, "Number of macroblock columns minus 1"))
dw.append(("num_macro_rows_m1", vrlg.CMPRS_FRMT_MBRM1, vrlg.CMPRS_FRMT_MBRM1_BITS, 0, "Number of macroblock rows minus 1")) dw.append(("num_macro_rows_m1", vrlg.CMPRS_FRMT_MBRM1, vrlg.CMPRS_FRMT_MBRM1_BITS, 0, "Number of macroblock rows minus 1"))
dw.append(("left_margin", vrlg.CMPRS_FRMT_LMARG, vrlg.CMPRS_FRMT_LMARG_BITS, 0, "Left margin of the first pixel (0..31) for 32-pixel wide colums in memory access")) dw.append(("left_margin", vrlg.CMPRS_FRMT_LMARG, vrlg.CMPRS_FRMT_LMARG_BITS, 0, "Left margin of the first pixel (0..31) for 32-pixel wide colums in memory access"))
return dw return dw
......
This diff is collapsed.
This diff is collapsed.
...@@ -2142,6 +2142,8 @@ assign axi_grst = axi_rst_pre; ...@@ -2142,6 +2142,8 @@ assign axi_grst = axi_rst_pre;
.CMPRS_CBIT_BAYER_BITS (CMPRS_CBIT_BAYER_BITS), .CMPRS_CBIT_BAYER_BITS (CMPRS_CBIT_BAYER_BITS),
.CMPRS_CBIT_FOCUS (CMPRS_CBIT_FOCUS), .CMPRS_CBIT_FOCUS (CMPRS_CBIT_FOCUS),
.CMPRS_CBIT_FOCUS_BITS (CMPRS_CBIT_FOCUS_BITS), .CMPRS_CBIT_FOCUS_BITS (CMPRS_CBIT_FOCUS_BITS),
.CMPRS_CBIT_ROWS_LSB (CMPRS_CBIT_ROWS_LSB),
.CMPRS_CBIT_ROWS_LSB_BITS (CMPRS_CBIT_ROWS_LSB_BITS),
.CMPRS_CBIT_RUN_RST (CMPRS_CBIT_RUN_RST), .CMPRS_CBIT_RUN_RST (CMPRS_CBIT_RUN_RST),
.CMPRS_CBIT_RUN_STANDALONE (CMPRS_CBIT_RUN_STANDALONE), .CMPRS_CBIT_RUN_STANDALONE (CMPRS_CBIT_RUN_STANDALONE),
.CMPRS_CBIT_RUN_ENABLE (CMPRS_CBIT_RUN_ENABLE), .CMPRS_CBIT_RUN_ENABLE (CMPRS_CBIT_RUN_ENABLE),
......
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