Commit 1de3d68f authored by Andrey Filippov's avatar Andrey Filippov

contunue with test tasks

parent c153c326
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
// keeping pointer locally) // keeping pointer locally)
module histogram_saxi#( module histogram_saxi#(
parameter HIST_SAXI_ADDR = 'h380, // need to modify addresses and masks to fit into overall command range parameter HIST_SAXI_ADDR = 'h380, // 16 locations to write 20 bits of a 4KB page for the histogram
parameter HIST_SAXI_ADDR_MASK = 'h7f0, parameter HIST_SAXI_ADDR_MASK = 'h7f0,
parameter HIST_SAXI_MODE_ADDR = 'h390, parameter HIST_SAXI_MODE_ADDR = 'h390,
parameter HIST_SAXI_MODE_WIDTH = 8, parameter HIST_SAXI_MODE_WIDTH = 8,
parameter HIST_SAXI_EN = 0, parameter HIST_SAXI_EN = 0,
parameter HIST_SAXI_NRESET = 1, parameter HIST_SAXI_NRESET = 1,
parameter HIST_CONFIRM_WRITE = 2, // wait write confirmation for each block parameter HIST_CONFIRM_WRITE = 2, // wait write confirmation for each block
parameter HIST_SAXI_AWCACHE = 4'h3, //..7 cache mode (4 bits, default 4'h3) parameter HIST_SAXI_AWCACHE = 4, // Write 4'h3 there, //..7 cache mode (4 bits, default 4'h3)
parameter HIST_SAXI_MODE_ADDR_MASK = 'h7ff, parameter HIST_SAXI_MODE_ADDR_MASK = 'h7ff,
// parameter HIST_SAXI_STATUS_REG = 'h34, // parameter HIST_SAXI_STATUS_REG = 'h34,
...@@ -386,7 +386,7 @@ module histogram_saxi#( ...@@ -386,7 +386,7 @@ module histogram_saxi#(
.ADDR_MASK1 (HIST_SAXI_MODE_ADDR_MASK), .ADDR_MASK1 (HIST_SAXI_MODE_ADDR_MASK),
.ADDR2 (0), .ADDR2 (0),
.ADDR_MASK2 (0) .ADDR_MASK2 (0)
) cmd_deser_sens_i2c_i ( ) cmd_deser_histogram_saxi_i (
.rst (1'b0), // input .rst (1'b0), // input
.clk (mclk), // input .clk (mclk), // input
.srst (mrst), // input .srst (mrst), // input
......
...@@ -380,6 +380,8 @@ ...@@ -380,6 +380,8 @@
parameter SENS_CTRL_EXT_CLK = 8, // 9: 8 parameter SENS_CTRL_EXT_CLK = 8, // 9: 8
parameter SENS_CTRL_LD_DLY = 10, // 10 parameter SENS_CTRL_LD_DLY = 10, // 10
parameter SENS_CTRL_QUADRANTS = 12, // 17:12, enable - 20 parameter SENS_CTRL_QUADRANTS = 12, // 17:12, enable - 20
parameter SENS_CTRL_QUADRANTS_WIDTH = 6,
parameter SENS_CTRL_QUADRANTS_EN = 20, // 17:12, enable - 20 (2 bits reserved)
parameter SENSIO_STATUS = 'h1, parameter SENSIO_STATUS = 'h1,
parameter SENSIO_JTAG = 'h2, parameter SENSIO_JTAG = 'h2,
// SENSIO_JTAG register bits // SENSIO_JTAG register bits
...@@ -422,7 +424,8 @@ ...@@ -422,7 +424,8 @@
parameter HIST_SAXI_EN = 0, parameter HIST_SAXI_EN = 0,
parameter HIST_SAXI_NRESET = 1, parameter HIST_SAXI_NRESET = 1,
parameter HIST_CONFIRM_WRITE = 2, // wait write confirmation for each block parameter HIST_CONFIRM_WRITE = 2, // wait write confirmation for each block
parameter HIST_SAXI_AWCACHE = 4'h3, //..7 cache mode (4 bits, default 4'h3) // bit 3 is not used
parameter HIST_SAXI_AWCACHE = 4, // ..7 Write 4'h3 there, cache mode (4 bits, default 4'h3)
parameter HIST_SAXI_MODE_ADDR_MASK = 'h7ff, parameter HIST_SAXI_MODE_ADDR_MASK = 'h7ff,
parameter NUM_FRAME_BITS = 4, // number of bits use for frame number parameter NUM_FRAME_BITS = 4, // number of bits use for frame number
......
...@@ -29,16 +29,12 @@ module sens_gamma #( ...@@ -29,16 +29,12 @@ module sens_gamma #(
parameter SENS_GAMMA_ADDR_DATA = 'h1, // bit 20 ==1 - table address, bit 20==0 - table data (18 bits) parameter SENS_GAMMA_ADDR_DATA = 'h1, // bit 20 ==1 - table address, bit 20==0 - table data (18 bits)
parameter SENS_GAMMA_HEIGHT01 = 'h2, // bits [15:0] - height minus 1 of image 0, [31:16] - height-1 of image1 parameter SENS_GAMMA_HEIGHT01 = 'h2, // bits [15:0] - height minus 1 of image 0, [31:16] - height-1 of image1
parameter SENS_GAMMA_HEIGHT2 = 'h3, // bits [15:0] - height minus 1 of image 2 ( no need for image 3) parameter SENS_GAMMA_HEIGHT2 = 'h3, // bits [15:0] - height minus 1 of image 2 ( no need for image 3)
// parameter SENS_GAMMA_STATUS = 'h1, parameter SENS_GAMMA_MODE_WIDTH = 5, // does not include trig
// parameter SENS_GAMMA_TADDR = 'h2, parameter SENS_GAMMA_MODE_BAYER = 0,
// parameter SENS_GAMMA_TDATA = 'h3, // 1.. 2^16, 0 - use HACT???? parameter SENS_GAMMA_MODE_PAGE = 2,
// parameter SENS_GAMMA_STATUS_REG = 'h32 parameter SENS_GAMMA_MODE_EN = 3,
parameter SENS_GAMMA_MODE_WIDTH = 5, // does not include trig parameter SENS_GAMMA_MODE_REPET = 4,
parameter SENS_GAMMA_MODE_BAYER = 0, parameter SENS_GAMMA_MODE_TRIG = 5
parameter SENS_GAMMA_MODE_PAGE = 2,
parameter SENS_GAMMA_MODE_EN = 3,
parameter SENS_GAMMA_MODE_REPET = 4,
parameter SENS_GAMMA_MODE_TRIG = 5
) ( ) (
// input rst, // input rst,
input pclk, // global clock input, pixel rate (96MHz for MT9P006) input pclk, // global clock input, pixel rate (96MHz for MT9P006)
...@@ -346,12 +342,12 @@ module sens_gamma #( ...@@ -346,12 +342,12 @@ module sens_gamma #(
.raddr (table_raddr), // input[11:0] .raddr (table_raddr), // input[11:0]
.ren (table_re[1]), // input TODO: add "en"? .ren (table_re[1]), // input TODO: add "en"?
.regen (table_regen[1]), // input .regen (table_regen[1]), // input
.data_out (table_rdata1), // output[7:0] .data_out (table_rdata1), // output[17:0]
.wclk (mclk), // input .wclk (mclk), // input
.waddr (taddr[10:0]), // input[9:0] .waddr (taddr[10:0]), // input[9:0]
.we (set_tdata_ram[1]), // input .we (set_tdata_ram[1]), // input
.web (8'hff), // input[7:0] .web (8'hff), // input[7:0]
.data_in (tdata) // input[31:0] .data_in (tdata) // input[17:0]
); );
ramp_var_w_var_r #( ramp_var_w_var_r #(
......
...@@ -42,7 +42,10 @@ module sens_parallel12 #( ...@@ -42,7 +42,10 @@ module sens_parallel12 #(
parameter SENS_CTRL_RST_MMCM= 6, // 7: 6 parameter SENS_CTRL_RST_MMCM= 6, // 7: 6
parameter SENS_CTRL_EXT_CLK= 8, // 9: 8 parameter SENS_CTRL_EXT_CLK= 8, // 9: 8
parameter SENS_CTRL_LD_DLY= 10, // 10 parameter SENS_CTRL_LD_DLY= 10, // 10
parameter SENS_CTRL_QUADRANTS=12, // 17:12, enable - 20 parameter SENS_CTRL_QUADRANTS = 12, // 17:12, enable - 20
parameter SENS_CTRL_QUADRANTS_WIDTH = 6,
parameter SENS_CTRL_QUADRANTS_EN = 20, // 17:12, enable - 20 (2 bits reserved)
parameter LINE_WIDTH_BITS = 16, parameter LINE_WIDTH_BITS = 16,
...@@ -154,7 +157,7 @@ module sens_parallel12 #( ...@@ -154,7 +157,7 @@ module sens_parallel12 #(
reg iarst = 0; reg iarst = 0;
reg imrst = 0; reg imrst = 0;
reg rst_mmcm=1; // rst and command - en/dis reg rst_mmcm=1; // rst and command - en/dis
reg [5:0] quadrants=0; //90-degree shifts for data {1:0], hact [3:2] and vact [5:4] reg [SENS_CTRL_QUADRANTS_WIDTH-1:0] quadrants=0; //90-degree shifts for data {1:0], hact [3:2] and vact [5:4]
reg ld_idelay=0; reg ld_idelay=0;
reg sel_ext_clk=0; // select clock source from the sensor (0 - use internal clock - to sensor) reg sel_ext_clk=0; // select clock source from the sensor (0 - use internal clock - to sensor)
...@@ -239,7 +242,7 @@ module sens_parallel12 #( ...@@ -239,7 +242,7 @@ module sens_parallel12 #(
else if (set_ctrl_r && data_r[SENS_CTRL_EXT_CLK + 1]) sel_ext_clk <= data_r[SENS_CTRL_EXT_CLK]; else if (set_ctrl_r && data_r[SENS_CTRL_EXT_CLK + 1]) sel_ext_clk <= data_r[SENS_CTRL_EXT_CLK];
if (mclk_rst) quadrants <= 0; if (mclk_rst) quadrants <= 0;
else if (set_ctrl_r && data_r[SENS_CTRL_QUADRANTS + 8]) quadrants <= data_r[SENS_CTRL_QUADRANTS+:6]; else if (set_ctrl_r && data_r[SENS_CTRL_QUADRANTS_EN]) quadrants <= data_r[SENS_CTRL_QUADRANTS +: SENS_CTRL_QUADRANTS_WIDTH];
if (mclk_rst) ld_idelay <= 0; if (mclk_rst) ld_idelay <= 0;
else ld_idelay <= set_ctrl_r && data_r[SENS_CTRL_LD_DLY]; else ld_idelay <= set_ctrl_r && data_r[SENS_CTRL_LD_DLY];
......
...@@ -104,6 +104,8 @@ module sensor_channel#( ...@@ -104,6 +104,8 @@ module sensor_channel#(
parameter SENS_CTRL_EXT_CLK = 8, // 9: 8 parameter SENS_CTRL_EXT_CLK = 8, // 9: 8
parameter SENS_CTRL_LD_DLY = 10, // 10 parameter SENS_CTRL_LD_DLY = 10, // 10
parameter SENS_CTRL_QUADRANTS = 12, // 17:12, enable - 20 parameter SENS_CTRL_QUADRANTS = 12, // 17:12, enable - 20
parameter SENS_CTRL_QUADRANTS_WIDTH = 6,
parameter SENS_CTRL_QUADRANTS_EN = 20, // 17:12, enable - 20 (2 bits reserved)
parameter SENSIO_STATUS = 'h1, parameter SENSIO_STATUS = 'h1,
parameter SENSIO_JTAG = 'h2, parameter SENSIO_JTAG = 'h2,
// SENSIO_JTAG register bits // SENSIO_JTAG register bits
...@@ -433,6 +435,8 @@ module sensor_channel#( ...@@ -433,6 +435,8 @@ module sensor_channel#(
.SENS_CTRL_EXT_CLK (SENS_CTRL_EXT_CLK), .SENS_CTRL_EXT_CLK (SENS_CTRL_EXT_CLK),
.SENS_CTRL_LD_DLY (SENS_CTRL_LD_DLY), .SENS_CTRL_LD_DLY (SENS_CTRL_LD_DLY),
.SENS_CTRL_QUADRANTS (SENS_CTRL_QUADRANTS), .SENS_CTRL_QUADRANTS (SENS_CTRL_QUADRANTS),
.SENS_CTRL_QUADRANTS_WIDTH (SENS_CTRL_QUADRANTS_WIDTH),
.SENS_CTRL_QUADRANTS_EN (SENS_CTRL_QUADRANTS_EN),
.IODELAY_GRP (IODELAY_GRP), .IODELAY_GRP (IODELAY_GRP),
.IDELAY_VALUE (IDELAY_VALUE), .IDELAY_VALUE (IDELAY_VALUE),
.PXD_DRIVE (PXD_DRIVE), .PXD_DRIVE (PXD_DRIVE),
......
...@@ -104,6 +104,8 @@ module sensors393 #( ...@@ -104,6 +104,8 @@ module sensors393 #(
parameter SENS_CTRL_EXT_CLK = 8, // 9: 8 parameter SENS_CTRL_EXT_CLK = 8, // 9: 8
parameter SENS_CTRL_LD_DLY = 10, // 10 parameter SENS_CTRL_LD_DLY = 10, // 10
parameter SENS_CTRL_QUADRANTS = 12, // 17:12, enable - 20 parameter SENS_CTRL_QUADRANTS = 12, // 17:12, enable - 20
parameter SENS_CTRL_QUADRANTS_WIDTH = 6,
parameter SENS_CTRL_QUADRANTS_EN = 20, // 17:12, enable - 20 (2 bits reserved)
parameter SENSIO_STATUS = 'h1, parameter SENSIO_STATUS = 'h1,
parameter SENSIO_JTAG = 'h2, parameter SENSIO_JTAG = 'h2,
// SENSIO_JTAG register bits // SENSIO_JTAG register bits
...@@ -372,6 +374,8 @@ module sensors393 #( ...@@ -372,6 +374,8 @@ module sensors393 #(
.SENS_CTRL_EXT_CLK (SENS_CTRL_EXT_CLK), .SENS_CTRL_EXT_CLK (SENS_CTRL_EXT_CLK),
.SENS_CTRL_LD_DLY (SENS_CTRL_LD_DLY), .SENS_CTRL_LD_DLY (SENS_CTRL_LD_DLY),
.SENS_CTRL_QUADRANTS (SENS_CTRL_QUADRANTS), .SENS_CTRL_QUADRANTS (SENS_CTRL_QUADRANTS),
.SENS_CTRL_QUADRANTS_WIDTH (SENS_CTRL_QUADRANTS_WIDTH),
.SENS_CTRL_QUADRANTS_EN (SENS_CTRL_QUADRANTS_EN),
.SENSIO_STATUS (SENSIO_STATUS), .SENSIO_STATUS (SENSIO_STATUS),
.SENSIO_JTAG (SENSIO_JTAG), .SENSIO_JTAG (SENSIO_JTAG),
.SENS_JTAG_PGMEN (SENS_JTAG_PGMEN), .SENS_JTAG_PGMEN (SENS_JTAG_PGMEN),
......
...@@ -1422,6 +1422,8 @@ assign axi_grst = axi_rst_pre; ...@@ -1422,6 +1422,8 @@ assign axi_grst = axi_rst_pre;
.SENS_CTRL_EXT_CLK (SENS_CTRL_EXT_CLK), .SENS_CTRL_EXT_CLK (SENS_CTRL_EXT_CLK),
.SENS_CTRL_LD_DLY (SENS_CTRL_LD_DLY), .SENS_CTRL_LD_DLY (SENS_CTRL_LD_DLY),
.SENS_CTRL_QUADRANTS (SENS_CTRL_QUADRANTS), .SENS_CTRL_QUADRANTS (SENS_CTRL_QUADRANTS),
.SENS_CTRL_QUADRANTS_WIDTH (SENS_CTRL_QUADRANTS_WIDTH),
.SENS_CTRL_QUADRANTS_EN (SENS_CTRL_QUADRANTS_EN),
.SENSIO_STATUS (SENSIO_STATUS), .SENSIO_STATUS (SENSIO_STATUS),
.SENSIO_JTAG (SENSIO_JTAG), .SENSIO_JTAG (SENSIO_JTAG),
.SENS_JTAG_PGMEN (SENS_JTAG_PGMEN), .SENS_JTAG_PGMEN (SENS_JTAG_PGMEN),
......
This diff is collapsed.
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