Commit 3b76078a authored by Andrey Filippov's avatar Andrey Filippov

last dct branch mods

parent 3bb9ab01
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
`timescale 1ns/1ps `timescale 1ns/1ps
module compressor393 # ( module compressor393 # (
parameter CMPRS_CHN_MASK = 4'hf, // specify wich compressor channels to use (disable some/all to make room for processing)
parameter CMPRS_NUM_AFI_CHN = 2, // 1 - multiplex all 4 compressors to a single AXI_HP, 2 - split between to AXI_HP parameter CMPRS_NUM_AFI_CHN = 2, // 1 - multiplex all 4 compressors to a single AXI_HP, 2 - split between to AXI_HP
parameter CMPRS_GROUP_ADDR = 'h600, // total of 'h60 parameter CMPRS_GROUP_ADDR = 'h600, // total of 'h60
parameter CMPRS_BASE_INC = 'h10, parameter CMPRS_BASE_INC = 'h10,
...@@ -340,144 +341,165 @@ module compressor393 # ( ...@@ -340,144 +341,165 @@ module compressor393 # (
generate generate
genvar i; genvar i;
for (i=0; i < 4; i=i+1) begin: cmprs_channel_block for (i=0; i < 4; i=i+1) begin: cmprs_channel_block
jp_channel #( if (CMPRS_CHN_MASK & (1<<i)) begin
.CMPRS_NUMBER (i), jp_channel #(
.CMPRS_GROUP_ADDR (CMPRS_GROUP_ADDR), .CMPRS_NUMBER (i),
.CMPRS_BASE_INC (CMPRS_BASE_INC), .CMPRS_GROUP_ADDR (CMPRS_GROUP_ADDR),
.CMPRS_STATUS_REG_BASE (CMPRS_STATUS_REG_BASE), .CMPRS_BASE_INC (CMPRS_BASE_INC),
.CMPRS_HIFREQ_REG_BASE (CMPRS_HIFREQ_REG_BASE), .CMPRS_STATUS_REG_BASE (CMPRS_STATUS_REG_BASE),
.CMPRS_STATUS_REG_INC (CMPRS_STATUS_REG_INC), .CMPRS_HIFREQ_REG_BASE (CMPRS_HIFREQ_REG_BASE),
.CMPRS_HIFREQ_REG_INC (CMPRS_HIFREQ_REG_INC), .CMPRS_STATUS_REG_INC (CMPRS_STATUS_REG_INC),
.CMPRS_MASK (CMPRS_MASK), .CMPRS_HIFREQ_REG_INC (CMPRS_HIFREQ_REG_INC),
.CMPRS_CONTROL_REG (CMPRS_CONTROL_REG), .CMPRS_MASK (CMPRS_MASK),
.CMPRS_STATUS_CNTRL (CMPRS_STATUS_CNTRL), .CMPRS_CONTROL_REG (CMPRS_CONTROL_REG),
.CMPRS_FORMAT (CMPRS_FORMAT), .CMPRS_STATUS_CNTRL (CMPRS_STATUS_CNTRL),
.CMPRS_COLOR_SATURATION (CMPRS_COLOR_SATURATION), .CMPRS_FORMAT (CMPRS_FORMAT),
.CMPRS_CORING_MODE (CMPRS_CORING_MODE), .CMPRS_COLOR_SATURATION (CMPRS_COLOR_SATURATION),
.CMPRS_INTERRUPTS (CMPRS_INTERRUPTS), .CMPRS_CORING_MODE (CMPRS_CORING_MODE),
.CMPRS_TABLES (CMPRS_TABLES), .CMPRS_INTERRUPTS (CMPRS_INTERRUPTS),
.TABLE_QUANTIZATION_INDEX (TABLE_QUANTIZATION_INDEX), .CMPRS_TABLES (CMPRS_TABLES),
.TABLE_CORING_INDEX (TABLE_CORING_INDEX), .TABLE_QUANTIZATION_INDEX (TABLE_QUANTIZATION_INDEX),
.TABLE_FOCUS_INDEX (TABLE_FOCUS_INDEX), .TABLE_CORING_INDEX (TABLE_CORING_INDEX),
.TABLE_HUFFMAN_INDEX (TABLE_HUFFMAN_INDEX), .TABLE_FOCUS_INDEX (TABLE_FOCUS_INDEX),
.FRAME_HEIGHT_BITS (FRAME_HEIGHT_BITS), .TABLE_HUFFMAN_INDEX (TABLE_HUFFMAN_INDEX),
.LAST_FRAME_BITS (LAST_FRAME_BITS), .FRAME_HEIGHT_BITS (FRAME_HEIGHT_BITS),
.CMPRS_CBIT_RUN (CMPRS_CBIT_RUN), .LAST_FRAME_BITS (LAST_FRAME_BITS),
.CMPRS_CBIT_RUN_BITS (CMPRS_CBIT_RUN_BITS), .CMPRS_CBIT_RUN (CMPRS_CBIT_RUN),
.CMPRS_CBIT_QBANK (CMPRS_CBIT_QBANK), .CMPRS_CBIT_RUN_BITS (CMPRS_CBIT_RUN_BITS),
.CMPRS_CBIT_QBANK_BITS (CMPRS_CBIT_QBANK_BITS), .CMPRS_CBIT_QBANK (CMPRS_CBIT_QBANK),
.CMPRS_CBIT_DCSUB (CMPRS_CBIT_DCSUB), .CMPRS_CBIT_QBANK_BITS (CMPRS_CBIT_QBANK_BITS),
.CMPRS_CBIT_DCSUB_BITS (CMPRS_CBIT_DCSUB_BITS), .CMPRS_CBIT_DCSUB (CMPRS_CBIT_DCSUB),
.CMPRS_CBIT_CMODE (CMPRS_CBIT_CMODE), .CMPRS_CBIT_DCSUB_BITS (CMPRS_CBIT_DCSUB_BITS),
.CMPRS_CBIT_CMODE_BITS (CMPRS_CBIT_CMODE_BITS), .CMPRS_CBIT_CMODE (CMPRS_CBIT_CMODE),
.CMPRS_CBIT_FRAMES (CMPRS_CBIT_FRAMES), .CMPRS_CBIT_CMODE_BITS (CMPRS_CBIT_CMODE_BITS),
.CMPRS_CBIT_FRAMES_BITS (CMPRS_CBIT_FRAMES_BITS), .CMPRS_CBIT_FRAMES (CMPRS_CBIT_FRAMES),
.CMPRS_CBIT_BAYER (CMPRS_CBIT_BAYER), .CMPRS_CBIT_FRAMES_BITS (CMPRS_CBIT_FRAMES_BITS),
.CMPRS_CBIT_BAYER_BITS (CMPRS_CBIT_BAYER_BITS), .CMPRS_CBIT_BAYER (CMPRS_CBIT_BAYER),
.CMPRS_CBIT_FOCUS (CMPRS_CBIT_FOCUS), .CMPRS_CBIT_BAYER_BITS (CMPRS_CBIT_BAYER_BITS),
.CMPRS_CBIT_FOCUS_BITS (CMPRS_CBIT_FOCUS_BITS), .CMPRS_CBIT_FOCUS (CMPRS_CBIT_FOCUS),
.CMPRS_CBIT_RUN_RST (CMPRS_CBIT_RUN_RST), .CMPRS_CBIT_FOCUS_BITS (CMPRS_CBIT_FOCUS_BITS),
.CMPRS_CBIT_RUN_STANDALONE (CMPRS_CBIT_RUN_STANDALONE), .CMPRS_CBIT_RUN_RST (CMPRS_CBIT_RUN_RST),
.CMPRS_CBIT_RUN_ENABLE (CMPRS_CBIT_RUN_ENABLE), .CMPRS_CBIT_RUN_STANDALONE (CMPRS_CBIT_RUN_STANDALONE),
.CMPRS_CBIT_CMODE_JPEG18 (CMPRS_CBIT_CMODE_JPEG18), .CMPRS_CBIT_RUN_ENABLE (CMPRS_CBIT_RUN_ENABLE),
.CMPRS_CBIT_CMODE_MONO6 (CMPRS_CBIT_CMODE_MONO6), .CMPRS_CBIT_CMODE_JPEG18 (CMPRS_CBIT_CMODE_JPEG18),
.CMPRS_CBIT_CMODE_JP46 (CMPRS_CBIT_CMODE_JP46), .CMPRS_CBIT_CMODE_MONO6 (CMPRS_CBIT_CMODE_MONO6),
.CMPRS_CBIT_CMODE_JP46DC (CMPRS_CBIT_CMODE_JP46DC), .CMPRS_CBIT_CMODE_JP46 (CMPRS_CBIT_CMODE_JP46),
.CMPRS_CBIT_CMODE_JPEG20 (CMPRS_CBIT_CMODE_JPEG20), .CMPRS_CBIT_CMODE_JP46DC (CMPRS_CBIT_CMODE_JP46DC),
.CMPRS_CBIT_CMODE_JP4 (CMPRS_CBIT_CMODE_JP4), .CMPRS_CBIT_CMODE_JPEG20 (CMPRS_CBIT_CMODE_JPEG20),
.CMPRS_CBIT_CMODE_JP4DC (CMPRS_CBIT_CMODE_JP4DC), .CMPRS_CBIT_CMODE_JP4 (CMPRS_CBIT_CMODE_JP4),
.CMPRS_CBIT_CMODE_JP4DIFF (CMPRS_CBIT_CMODE_JP4DIFF), .CMPRS_CBIT_CMODE_JP4DC (CMPRS_CBIT_CMODE_JP4DC),
.CMPRS_CBIT_CMODE_JP4DIFFHDR (CMPRS_CBIT_CMODE_JP4DIFFHDR), .CMPRS_CBIT_CMODE_JP4DIFF (CMPRS_CBIT_CMODE_JP4DIFF),
.CMPRS_CBIT_CMODE_JP4DIFFDIV2 (CMPRS_CBIT_CMODE_JP4DIFFDIV2), .CMPRS_CBIT_CMODE_JP4DIFFHDR (CMPRS_CBIT_CMODE_JP4DIFFHDR),
.CMPRS_CBIT_CMODE_JP4DIFFHDRDIV2 (CMPRS_CBIT_CMODE_JP4DIFFHDRDIV2), .CMPRS_CBIT_CMODE_JP4DIFFDIV2 (CMPRS_CBIT_CMODE_JP4DIFFDIV2),
.CMPRS_CBIT_CMODE_MONO1 (CMPRS_CBIT_CMODE_MONO1), .CMPRS_CBIT_CMODE_JP4DIFFHDRDIV2 (CMPRS_CBIT_CMODE_JP4DIFFHDRDIV2),
.CMPRS_CBIT_CMODE_MONO4 (CMPRS_CBIT_CMODE_MONO4), .CMPRS_CBIT_CMODE_MONO1 (CMPRS_CBIT_CMODE_MONO1),
.CMPRS_CBIT_FRAMES_SINGLE (CMPRS_CBIT_FRAMES_SINGLE), .CMPRS_CBIT_CMODE_MONO4 (CMPRS_CBIT_CMODE_MONO4),
.CMPRS_COLOR18 (CMPRS_COLOR18), .CMPRS_CBIT_FRAMES_SINGLE (CMPRS_CBIT_FRAMES_SINGLE),
.CMPRS_COLOR20 (CMPRS_COLOR20), .CMPRS_COLOR18 (CMPRS_COLOR18),
.CMPRS_MONO16 (CMPRS_MONO16), .CMPRS_COLOR20 (CMPRS_COLOR20),
.CMPRS_JP4 (CMPRS_JP4), .CMPRS_MONO16 (CMPRS_MONO16),
.CMPRS_JP4DIFF (CMPRS_JP4DIFF), .CMPRS_JP4 (CMPRS_JP4),
.CMPRS_MONO8 (CMPRS_MONO8), .CMPRS_JP4DIFF (CMPRS_JP4DIFF),
.CMPRS_FRMT_MBCM1 (CMPRS_FRMT_MBCM1), .CMPRS_MONO8 (CMPRS_MONO8),
.CMPRS_FRMT_MBCM1_BITS (CMPRS_FRMT_MBCM1_BITS), .CMPRS_FRMT_MBCM1 (CMPRS_FRMT_MBCM1),
.CMPRS_FRMT_MBRM1 (CMPRS_FRMT_MBRM1), .CMPRS_FRMT_MBCM1_BITS (CMPRS_FRMT_MBCM1_BITS),
.CMPRS_FRMT_MBRM1_BITS (CMPRS_FRMT_MBRM1_BITS), .CMPRS_FRMT_MBRM1 (CMPRS_FRMT_MBRM1),
.CMPRS_FRMT_LMARG (CMPRS_FRMT_LMARG), .CMPRS_FRMT_MBRM1_BITS (CMPRS_FRMT_MBRM1_BITS),
.CMPRS_FRMT_LMARG_BITS (CMPRS_FRMT_LMARG_BITS), .CMPRS_FRMT_LMARG (CMPRS_FRMT_LMARG),
.CMPRS_CSAT_CB (CMPRS_CSAT_CB), .CMPRS_FRMT_LMARG_BITS (CMPRS_FRMT_LMARG_BITS),
.CMPRS_CSAT_CB_BITS (CMPRS_CSAT_CB_BITS), .CMPRS_CSAT_CB (CMPRS_CSAT_CB),
.CMPRS_CSAT_CR (CMPRS_CSAT_CR), .CMPRS_CSAT_CB_BITS (CMPRS_CSAT_CB_BITS),
.CMPRS_CSAT_CR_BITS (CMPRS_CSAT_CR_BITS), .CMPRS_CSAT_CR (CMPRS_CSAT_CR),
.CMPRS_CORING_BITS (CMPRS_CORING_BITS), .CMPRS_CSAT_CR_BITS (CMPRS_CSAT_CR_BITS),
.CMPRS_TIMEOUT_BITS (CMPRS_TIMEOUT_BITS), .CMPRS_CORING_BITS (CMPRS_CORING_BITS),
.CMPRS_TIMEOUT (CMPRS_TIMEOUT), .CMPRS_TIMEOUT_BITS (CMPRS_TIMEOUT_BITS),
.NUM_FRAME_BITS (NUM_FRAME_BITS) .CMPRS_TIMEOUT (CMPRS_TIMEOUT),
`ifdef DEBUG_RING .NUM_FRAME_BITS (NUM_FRAME_BITS)
,.DEBUG_CMD_LATENCY (DEBUG_CMD_LATENCY) `ifdef DEBUG_RING
`endif ,.DEBUG_CMD_LATENCY (DEBUG_CMD_LATENCY)
) jp_channel_i ( `endif
// .rst (rst), // input ) jp_channel_i (
.xclk (xclk), // input // .rst (rst), // input
`ifdef USE_XCLK2X .xclk (xclk), // input
.xclk2x (xclk2x), // input `ifdef USE_XCLK2X
`endif .xclk2x (xclk2x), // input
.mrst (mrst), // input `endif
.xrst (xrst), // input .mrst (mrst), // input
.hrst (hrst), // input .xrst (xrst), // input
.mclk (mclk), // input .hrst (hrst), // input
.cmd_ad (cmd_ad), // input[7:0] .mclk (mclk), // input
.cmd_stb (cmd_stb), // input .cmd_ad (cmd_ad), // input[7:0]
.status_ad (status_ad_mux[8 * i +: 8]), // output[7:0] .cmd_stb (cmd_stb), // input
.status_rq (status_rq_mux[i]), // output .status_ad (status_ad_mux[8 * i +: 8]), // output[7:0]
.status_start (status_start_mux[i]), // input .status_rq (status_rq_mux[i]), // output
.irq (cmprs_irq[i]), // output .status_start (status_start_mux[i]), // input
.xfer_reset_page_rd (xfer_reset_page_rd[i]), // input .irq (cmprs_irq[i]), // output
.buf_wpage_nxt (buf_wpage_nxt[i]), // input .xfer_reset_page_rd (xfer_reset_page_rd[i]), // input
.buf_we (buf_we[i]), // input .buf_wpage_nxt (buf_wpage_nxt[i]), // input
.buf_din (buf_din[64 * i +: 64]), // input[63:0] .buf_we (buf_we[i]), // input
.page_ready_chn (page_ready[i]), // input .buf_din (buf_din[64 * i +: 64]), // input[63:0]
.next_page_chn (next_page[i]), // output .page_ready_chn (page_ready[i]), // input
.next_page_chn (next_page[i]), // output
.frame_start_dst (frame_start_dst[i]), // output
.frame_start_conf (frame_start_conf[i]), // input .frame_start_dst (frame_start_dst[i]), // output
.line_unfinished_src (line_unfinished_src[FRAME_HEIGHT_BITS * i +: FRAME_HEIGHT_BITS]), // input[15:0] .frame_start_conf (frame_start_conf[i]), // input
.frame_number_src (frame_number_src[LAST_FRAME_BITS * i +: LAST_FRAME_BITS]), // input[15:0] .line_unfinished_src (line_unfinished_src[FRAME_HEIGHT_BITS * i +: FRAME_HEIGHT_BITS]), // input[15:0]
.frame_done_src (frame_done_src[i]), // input .frame_number_src (frame_number_src[LAST_FRAME_BITS * i +: LAST_FRAME_BITS]), // input[15:0]
.line_unfinished_dst (line_unfinished_dst[FRAME_HEIGHT_BITS * i +: FRAME_HEIGHT_BITS]), // input[15:0] .frame_done_src (frame_done_src[i]), // input
.frame_number_dst (frame_number_dst[LAST_FRAME_BITS * i +: LAST_FRAME_BITS]), // input[15:0] .line_unfinished_dst (line_unfinished_dst[FRAME_HEIGHT_BITS * i +: FRAME_HEIGHT_BITS]), // input[15:0]
.frames_in_sync (frames_in_sync[i]), //input .frame_number_dst (frame_number_dst[LAST_FRAME_BITS * i +: LAST_FRAME_BITS]), // input[15:0]
.frame_done_dst (frame_done_dst[i]), // input .frames_in_sync (frames_in_sync[i]), //input
.suspend (suspend[i]), // output .frame_done_dst (frame_done_dst[i]), // input
.frame_number_finished (frame_number_finished[LAST_FRAME_BITS * i +: LAST_FRAME_BITS]), // output reg[15:0] .suspend (suspend[i]), // output
.dccout (1'b0), // input .frame_number_finished (frame_number_finished[LAST_FRAME_BITS * i +: LAST_FRAME_BITS]), // output reg[15:0]
.hfc_sel (3'b0), // input[2:0] .dccout (1'b0), // input
.statistics_dv (), // output .hfc_sel (3'b0), // input[2:0]
.statistics_do (), // output[15:0] .statistics_dv (), // output
.ts_pre_stb (ts_pre_stb[i]), // input .statistics_do (), // output[15:0]
.ts_data (ts_data[8*i +: 8]), // input[7:0] .ts_pre_stb (ts_pre_stb[i]), // input
.eof_written_mclk (eof_written_mclk[i]), // output .ts_data (ts_data[8*i +: 8]), // input[7:0]
.stuffer_done_mclk (stuffer_done_mclk[i]), // output .eof_written_mclk (eof_written_mclk[i]), // output
.vsync_late (vsync_late[i]), // input .stuffer_done_mclk (stuffer_done_mclk[i]), // output
.frame_num_compressed (frame_num_compressed[i * NUM_FRAME_BITS +: NUM_FRAME_BITS]), // input[3:0] .vsync_late (vsync_late[i]), // input
.frame_num_compressed (frame_num_compressed[i * NUM_FRAME_BITS +: NUM_FRAME_BITS]), // input[3:0]
.hclk (hclk), // input
.fifo_rst (fifo_rst[i]), // input .hclk (hclk), // input
.fifo_ren (fifo_ren[i]), // input .fifo_rst (fifo_rst[i]), // input
.fifo_rdata (fifo_rdata[64 * i +: 64]), // output[63:0] .fifo_ren (fifo_ren[i]), // input
.fifo_rdata (fifo_rdata[64 * i +: 64]), // output[63:0]
.fifo_eof (fifo_eof[i]), // output
.eof_written (eof_written[i]), // input .fifo_eof (fifo_eof[i]), // output
.fifo_flush (fifo_flush[i]), // output .eof_written (eof_written[i]), // input
.flush_hclk (flush_hclk[i]), // output .fifo_flush (fifo_flush[i]), // output
.fifo_count (fifo_count[8* i +: 8]) // output[7:0] .flush_hclk (flush_hclk[i]), // output
`ifdef DEBUG_RING .fifo_count (fifo_count[8* i +: 8]) // output[7:0]
,.debug_do (debug_ring[i]), // output `ifdef DEBUG_RING
.debug_sl (debug_sl), // output ,.debug_do (debug_ring[i]), // output
.debug_di (debug_ring[i+1]) // input .debug_sl (debug_sl), // input
`endif .debug_di (debug_ring[i+1]) // input
`endif
); );
end else begin
// assign unused outputs from missing jp_channel instances
assign status_ad_mux[8 * i +: 8] = 'bx;
assign status_rq_mux[i] = 'b0;
assign cmprs_irq[i] = 'b0;
assign next_page[i] = 'b0;
assign frame_start_dst[i] = 'b0;
assign suspend[i] = 'b0;
assign eof_written_mclk[i] = 'b0;
assign eof_written_mclk[i] = 'b0;
assign stuffer_done_mclk[i] = 'b0;
assign fifo_rdata[64 * i +: 64] = 'bx;
assign fifo_eof[i] = 'b0;
assign fifo_flush[i] = 'b0;
assign flush_hclk[i] = 'b0;
assign fifo_count[8* i +: 8] = 'bx;
`ifdef DEBUG_RING
assign debug_ring[i] = 'bx;
`endif
end
end end
endgenerate endgenerate
......
...@@ -35,7 +35,11 @@ ...@@ -35,7 +35,11 @@
* 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'h039300d9; //parallel - correcting histograms -0.022/1, 79.60% parameter FPGA_VERSION = 32'h03930103; //parallel - three compressor channels -0.177/37, 74.94%
// parameter FPGA_VERSION = 32'h03930102; //parallel - two compressor channels - all met, 67.75%
// parameter FPGA_VERSION = 32'h03930101; //parallel - single compressor channel all met, 61.25%
// parameter FPGA_VERSION = 32'h03930100; //parallel - removing some compressors to make room for DCT-based processing -0.004/3, 80.17 - all channels,
// parameter FPGA_VERSION = 32'h039300d9; //parallel - correcting histograms -0.022/1, 79.60%
// parameter FPGA_VERSION = 32'h039300d8; //parallel - SATA is now logging irq on/off -0.054 /16, 80.50% // parameter FPGA_VERSION = 32'h039300d8; //parallel - SATA is now logging irq on/off -0.054 /16, 80.50%
// parameter FPGA_VERSION = 32'h039300d7; //parallel - updated SATA (v12) all met, 80.32% // parameter FPGA_VERSION = 32'h039300d7; //parallel - updated SATA (v12) all met, 80.32%
// parameter FPGA_VERSION = 32'h039300d6; //parallel - more SATA debug link layer -0.127/18, 80.03% -> -0.002/4, 80.26% // parameter FPGA_VERSION = 32'h039300d6; //parallel - more SATA debug link layer -0.127/18, 80.03% -> -0.002/4, 80.26%
......
...@@ -661,7 +661,10 @@ ...@@ -661,7 +661,10 @@
// parameter HISPI_IOSTANDARD = "PPDS_25", //"DIFF_SSTL18_II" for high current (13.4mA vs 8mA) // parameter HISPI_IOSTANDARD = "PPDS_25", //"DIFF_SSTL18_II" for high current (13.4mA vs 8mA)
// parameter HISPI_IOSTANDARD = "DIFF_HSTL_II_18", //"DIFF_SSTL18_II" for high current (13.4mA vs 8mA) // parameter HISPI_IOSTANDARD = "DIFF_HSTL_II_18", //"DIFF_SSTL18_II" for high current (13.4mA vs 8mA)
//`endif DIFF_HSTL_II_18 //`endif DIFF_HSTL_II_18
// parameter CMPRS_CHN_MASK = 4'hf, // all channels (specify wich compressor channels to use (disable some/all to make room for processing))
// parameter CMPRS_CHN_MASK = 4'h1, // single channel (specify wich compressor channels to use (disable some/all to make room for processing))
// parameter CMPRS_CHN_MASK = 4'h3, // two channels (specify wich compressor channels to use (disable some/all to make room for processing))
parameter CMPRS_CHN_MASK = 4'h7, // three channels (specify wich compressor channels to use (disable some/all to make room for processing))
parameter CMPRS_NUM_AFI_CHN = 1, // 2, // 1 - multiplex all 4 compressors to a single AXI_HP, 2 - split between to AXI_HP parameter CMPRS_NUM_AFI_CHN = 1, // 2, // 1 - multiplex all 4 compressors to a single AXI_HP, 2 - split between to AXI_HP
parameter CMPRS_GROUP_ADDR = 'h600, // total of 'h60 parameter CMPRS_GROUP_ADDR = 'h600, // total of 'h60
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
`timescale 1ns/1ps `timescale 1ns/1ps
`include "system_defines.vh" `include "system_defines.vh"
module mcntrl393 #( module mcntrl393 #(
parameter CMPRS_CHN_MASK = 4'hf, // specify wich compressor channels to use (disable some/all to make room for processing)
// MAXI address space, in 32-bit words // MAXI address space, in 32-bit words
parameter MCONTR_SENS_BASE = 'h680, // .. 'h6bf parameter MCONTR_SENS_BASE = 'h680, // .. 'h6bf
parameter MCONTR_SENS_INC = 'h10, parameter MCONTR_SENS_INC = 'h10,
...@@ -1159,88 +1160,106 @@ module mcntrl393 #( ...@@ -1159,88 +1160,106 @@ module mcntrl393 #(
,.dbg_wpage (dbg_wpage[2*i +:2]) // input[1:0] ,.dbg_wpage (dbg_wpage[2*i +:2]) // input[1:0]
`endif `endif
); );
if (CMPRS_CHN_MASK & (1<<i)) begin
mcntrl_tiled_rw #( mcntrl_tiled_rw #(
.ADDRESS_NUMBER (ADDRESS_NUMBER), .ADDRESS_NUMBER (ADDRESS_NUMBER),
.COLADDR_NUMBER (COLADDR_NUMBER), .COLADDR_NUMBER (COLADDR_NUMBER),
.FRAME_WIDTH_BITS (FRAME_WIDTH_BITS), .FRAME_WIDTH_BITS (FRAME_WIDTH_BITS),
.FRAME_HEIGHT_BITS (FRAME_HEIGHT_BITS), .FRAME_HEIGHT_BITS (FRAME_HEIGHT_BITS),
.MAX_TILE_WIDTH (MAX_TILE_WIDTH), .MAX_TILE_WIDTH (MAX_TILE_WIDTH),
.MAX_TILE_HEIGHT (MAX_TILE_HEIGHT), .MAX_TILE_HEIGHT (MAX_TILE_HEIGHT),
.LAST_FRAME_BITS (LAST_FRAME_BITS), .LAST_FRAME_BITS (LAST_FRAME_BITS),
.MCNTRL_TILED_ADDR (MCONTR_CMPRS_BASE + MCONTR_CMPRS_INC * i), .MCNTRL_TILED_ADDR (MCONTR_CMPRS_BASE + MCONTR_CMPRS_INC * i),
.MCNTRL_TILED_MASK (MCNTRL_TILED_MASK), .MCNTRL_TILED_MASK (MCNTRL_TILED_MASK),
.MCNTRL_TILED_MODE (MCNTRL_TILED_MODE), .MCNTRL_TILED_MODE (MCNTRL_TILED_MODE),
.MCNTRL_TILED_STATUS_CNTRL (MCNTRL_TILED_STATUS_CNTRL), .MCNTRL_TILED_STATUS_CNTRL (MCNTRL_TILED_STATUS_CNTRL),
.MCNTRL_TILED_STARTADDR (MCNTRL_TILED_STARTADDR), .MCNTRL_TILED_STARTADDR (MCNTRL_TILED_STARTADDR),
.MCNTRL_TILED_FRAME_SIZE (MCNTRL_TILED_FRAME_SIZE), .MCNTRL_TILED_FRAME_SIZE (MCNTRL_TILED_FRAME_SIZE),
.MCNTRL_TILED_FRAME_LAST (MCNTRL_TILED_FRAME_LAST), .MCNTRL_TILED_FRAME_LAST (MCNTRL_TILED_FRAME_LAST),
.MCNTRL_TILED_FRAME_FULL_WIDTH (MCNTRL_TILED_FRAME_FULL_WIDTH), .MCNTRL_TILED_FRAME_FULL_WIDTH (MCNTRL_TILED_FRAME_FULL_WIDTH),
.MCNTRL_TILED_WINDOW_WH (MCNTRL_TILED_WINDOW_WH), .MCNTRL_TILED_WINDOW_WH (MCNTRL_TILED_WINDOW_WH),
.MCNTRL_TILED_WINDOW_X0Y0 (MCNTRL_TILED_WINDOW_X0Y0), .MCNTRL_TILED_WINDOW_X0Y0 (MCNTRL_TILED_WINDOW_X0Y0),
.MCNTRL_TILED_WINDOW_STARTXY (MCNTRL_TILED_WINDOW_STARTXY), .MCNTRL_TILED_WINDOW_STARTXY (MCNTRL_TILED_WINDOW_STARTXY),
.MCNTRL_TILED_TILE_WHS (MCNTRL_TILED_TILE_WHS), .MCNTRL_TILED_TILE_WHS (MCNTRL_TILED_TILE_WHS),
.MCNTRL_TILED_STATUS_REG_ADDR (MCONTR_CMPRS_STATUS_BASE + MCONTR_CMPRS_STATUS_INC * i), .MCNTRL_TILED_STATUS_REG_ADDR (MCONTR_CMPRS_STATUS_BASE + MCONTR_CMPRS_STATUS_INC * i),
.MCNTRL_TILED_PENDING_CNTR_BITS(MCNTRL_TILED_PENDING_CNTR_BITS), .MCNTRL_TILED_PENDING_CNTR_BITS(MCNTRL_TILED_PENDING_CNTR_BITS),
.MCNTRL_TILED_FRAME_PAGE_RESET (MCNTRL_TILED_FRAME_PAGE_RESET), .MCNTRL_TILED_FRAME_PAGE_RESET (MCNTRL_TILED_FRAME_PAGE_RESET),
.MCONTR_LINTILE_NRESET (MCONTR_LINTILE_NRESET), .MCONTR_LINTILE_NRESET (MCONTR_LINTILE_NRESET),
.MCONTR_LINTILE_EN (MCONTR_LINTILE_EN), .MCONTR_LINTILE_EN (MCONTR_LINTILE_EN),
.MCONTR_LINTILE_WRITE (MCONTR_LINTILE_WRITE), .MCONTR_LINTILE_WRITE (MCONTR_LINTILE_WRITE),
.MCONTR_LINTILE_EXTRAPG (MCONTR_LINTILE_EXTRAPG), .MCONTR_LINTILE_EXTRAPG (MCONTR_LINTILE_EXTRAPG),
.MCONTR_LINTILE_EXTRAPG_BITS (MCONTR_LINTILE_EXTRAPG_BITS), .MCONTR_LINTILE_EXTRAPG_BITS (MCONTR_LINTILE_EXTRAPG_BITS),
.MCONTR_LINTILE_KEEP_OPEN (MCONTR_LINTILE_KEEP_OPEN), .MCONTR_LINTILE_KEEP_OPEN (MCONTR_LINTILE_KEEP_OPEN),
.MCONTR_LINTILE_BYTE32 (MCONTR_LINTILE_BYTE32), .MCONTR_LINTILE_BYTE32 (MCONTR_LINTILE_BYTE32),
.MCONTR_LINTILE_RST_FRAME (MCONTR_LINTILE_RST_FRAME), .MCONTR_LINTILE_RST_FRAME (MCONTR_LINTILE_RST_FRAME),
.MCONTR_LINTILE_SINGLE (MCONTR_LINTILE_SINGLE), .MCONTR_LINTILE_SINGLE (MCONTR_LINTILE_SINGLE),
.MCONTR_LINTILE_REPEAT (MCONTR_LINTILE_REPEAT), .MCONTR_LINTILE_REPEAT (MCONTR_LINTILE_REPEAT),
.MCONTR_LINTILE_DIS_NEED (MCONTR_LINTILE_DIS_NEED), .MCONTR_LINTILE_DIS_NEED (MCONTR_LINTILE_DIS_NEED),
.MCONTR_LINTILE_COPY_FRAME (MCONTR_LINTILE_COPY_FRAME), .MCONTR_LINTILE_COPY_FRAME (MCONTR_LINTILE_COPY_FRAME),
.MCONTR_LINTILE_ABORT_LATE (MCONTR_LINTILE_ABORT_LATE) .MCONTR_LINTILE_ABORT_LATE (MCONTR_LINTILE_ABORT_LATE)
) mcntrl_tiled_rd_compressor_i ( ) mcntrl_tiled_rd_compressor_i (
.mrst (mrst), // input .mrst (mrst), // input
.mclk (mclk), // input .mclk (mclk), // input
.cmd_ad (cmd_cmprs_ad), // input[7:0] .cmd_ad (cmd_cmprs_ad), // input[7:0]
.cmd_stb (cmd_cmprs_stb), // input .cmd_stb (cmd_cmprs_stb), // input
.status_ad (status_cmprs_ad[i * 8 +: 8]), // output[7:0] .status_ad (status_cmprs_ad[i * 8 +: 8]), // output[7:0]
.status_rq (status_cmprs_rq[i]), // output .status_rq (status_cmprs_rq[i]), // output
.status_start (status_cmprs_start[i]), // input .status_start (status_cmprs_start[i]), // input
.frame_start (cmprs_frame_start_dst[i]), // input .frame_start (cmprs_frame_start_dst[i]), // input
.frame_start_conf (cmprs_frame_start_conf[i]), // output .frame_start_conf (cmprs_frame_start_conf[i]), // output
.next_page (cmprs_next_page[i]), // input compressor consumed page cmprs_buf_wpage_nxt? .next_page (cmprs_next_page[i]), // input compressor consumed page cmprs_buf_wpage_nxt?
.frame_done (cmprs_frame_done_dst[i]), // output .frame_done (cmprs_frame_done_dst[i]), // output
.frame_finished (), // output .frame_finished (), // output
.line_unfinished (cmprs_line_unfinished_dst[i * FRAME_HEIGHT_BITS +: FRAME_HEIGHT_BITS]), // output[15:0] .line_unfinished (cmprs_line_unfinished_dst[i * FRAME_HEIGHT_BITS +: FRAME_HEIGHT_BITS]), // output[15:0]
.suspend (cmprs_suspend[i]), // input .suspend (cmprs_suspend[i]), // input
.frame_number (cmprs_frame_number_dst[i * LAST_FRAME_BITS +: LAST_FRAME_BITS]), // output[15:0] .frame_number (cmprs_frame_number_dst[i * LAST_FRAME_BITS +: LAST_FRAME_BITS]), // output[15:0]
.frames_in_sync (cmprs_frames_in_sync[i]), // output .frames_in_sync (cmprs_frames_in_sync[i]), // output
.master_frame (cmprs_frame_number_src[i * LAST_FRAME_BITS +: LAST_FRAME_BITS]), // input[15:0] .master_frame (cmprs_frame_number_src[i * LAST_FRAME_BITS +: LAST_FRAME_BITS]), // input[15:0]
.master_set (sens_frame_set[i]), // input .master_set (sens_frame_set[i]), // input
// .master_follow (master_follow[i]), // input // .master_follow (master_follow[i]), // input
.xfer_want (cmprs_want[i]), // output .xfer_want (cmprs_want[i]), // output
.xfer_need (cmprs_need[i]), // output .xfer_need (cmprs_need[i]), // output
.xfer_grant (cmprs_channel_pgm_en[i]), // input .xfer_grant (cmprs_channel_pgm_en[i]), // input
.xfer_start_rd (cmprs_start_rd16[i]), // output .xfer_start_rd (cmprs_start_rd16[i]), // output
.xfer_start_wr (), // output .xfer_start_wr (), // output
.xfer_start32_rd (cmprs_start_rd32[i]), // output .xfer_start32_rd (cmprs_start_rd32[i]), // output
.xfer_start32_wr (), // output .xfer_start32_wr (), // output
.xfer_bank (cmprs_bank[i * 3 +: 3]), // output[2:0] .xfer_bank (cmprs_bank[i * 3 +: 3]), // output[2:0]
.xfer_row (cmprs_row[ADDRESS_NUMBER * i +: ADDRESS_NUMBER]), // output[14:0] .xfer_row (cmprs_row[ADDRESS_NUMBER * i +: ADDRESS_NUMBER]), // output[14:0]
.xfer_col (cmprs_col[COL_WDTH * i +: COL_WDTH]), // output[6:0] .xfer_col (cmprs_col[COL_WDTH * i +: COL_WDTH]), // output[6:0]
.rowcol_inc (cmprs_rowcol_inc[i * FRAME_WBP1 +: FRAME_WBP1]), // output[13:0] .rowcol_inc (cmprs_rowcol_inc[i * FRAME_WBP1 +: FRAME_WBP1]), // output[13:0]
.num_rows_m1 (cmprs_num_rows_m1[i * MAX_TILE_WIDTH +: MAX_TILE_WIDTH]), // output[5:0] .num_rows_m1 (cmprs_num_rows_m1[i * MAX_TILE_WIDTH +: MAX_TILE_WIDTH]), // output[5:0]
.num_cols_m1 (cmprs_num_cols_m1[i * MAX_TILE_HEIGHT +: MAX_TILE_HEIGHT]), // output[5:0] .num_cols_m1 (cmprs_num_cols_m1[i * MAX_TILE_HEIGHT +: MAX_TILE_HEIGHT]), // output[5:0]
.keep_open (cmprs_keep_open[i]), // output .keep_open (cmprs_keep_open[i]), // output
.xfer_partial (cmprs_partial[i]), // output .xfer_partial (cmprs_partial[i]), // output
.xfer_page_done (cmprs_seq_done[i]), // input .xfer_page_done (cmprs_seq_done[i]), // input
.xfer_page_rst_wr (), // output .xfer_page_rst_wr (), // output
.xfer_page_rst_rd (cmprs_xfer_reset_page_rd[i]) // output @negedge .xfer_page_rst_rd (cmprs_xfer_reset_page_rd[i]) // output @negedge
); );
end else begin
// assign unused outputs from missing mcntrl_tiled_rd_compressor_i instances
assign status_cmprs_ad[i * 8 +: 8] = 'bx;
assign status_cmprs_rq[i] = 'b0;
assign cmprs_frame_start_conf[i] = 'b0;
assign cmprs_frame_done_dst[i] = 'b0;
assign cmprs_line_unfinished_dst[i * FRAME_HEIGHT_BITS +: FRAME_HEIGHT_BITS] = 'bx;
assign cmprs_frame_number_dst[i * LAST_FRAME_BITS +: LAST_FRAME_BITS] = 'bx;
assign cmprs_frames_in_sync[i] = 'b0;
assign cmprs_want[i] = 'b0;
assign cmprs_need[i] = 'b0;
assign cmprs_start_rd16[i] = 'b0;
assign cmprs_start_rd32[i] = 'b0;
assign cmprs_bank[i * 3 +: 3] = 'b0;
assign cmprs_row[ADDRESS_NUMBER * i +: ADDRESS_NUMBER] = 'bx;
assign cmprs_col[COL_WDTH * i +: COL_WDTH] = 'bx;
assign cmprs_rowcol_inc[i * FRAME_WBP1 +: FRAME_WBP1] = 'bx;
assign cmprs_num_rows_m1[i * MAX_TILE_WIDTH +: MAX_TILE_WIDTH] = 'bx;
assign cmprs_num_cols_m1[i * MAX_TILE_HEIGHT +: MAX_TILE_HEIGHT] = 'bx;
assign cmprs_keep_open[i] = 'bx;
assign cmprs_partial[i] = 'bx;
assign cmprs_xfer_reset_page_rd[i] = 'bx;
end
end end
endgenerate endgenerate
......
...@@ -1144,6 +1144,7 @@ assign axi_grst = axi_rst_pre; ...@@ -1144,6 +1144,7 @@ assign axi_grst = axi_rst_pre;
); );
mcntrl393 #( mcntrl393 #(
.CMPRS_CHN_MASK (CMPRS_CHN_MASK),
.MCONTR_SENS_BASE (MCONTR_SENS_BASE), .MCONTR_SENS_BASE (MCONTR_SENS_BASE),
.MCONTR_SENS_INC (MCONTR_SENS_INC), .MCONTR_SENS_INC (MCONTR_SENS_INC),
.MCONTR_CMPRS_BASE (MCONTR_CMPRS_BASE), .MCONTR_CMPRS_BASE (MCONTR_CMPRS_BASE),
...@@ -1266,6 +1267,7 @@ assign axi_grst = axi_rst_pre; ...@@ -1266,6 +1267,7 @@ assign axi_grst = axi_rst_pre;
.MAX_TILE_HEIGHT (MAX_TILE_HEIGHT), .MAX_TILE_HEIGHT (MAX_TILE_HEIGHT),
.MCNTRL_TILED_CHN2_ADDR (MCNTRL_TILED_CHN2_ADDR), .MCNTRL_TILED_CHN2_ADDR (MCNTRL_TILED_CHN2_ADDR),
.MCNTRL_TILED_CHN4_ADDR (MCNTRL_TILED_CHN4_ADDR), .MCNTRL_TILED_CHN4_ADDR (MCNTRL_TILED_CHN4_ADDR),
.MCNTRL_TILED_MASK (MCNTRL_TILED_MASK), .MCNTRL_TILED_MASK (MCNTRL_TILED_MASK),
.MCNTRL_TILED_MODE (MCNTRL_TILED_MODE), .MCNTRL_TILED_MODE (MCNTRL_TILED_MODE),
.MCNTRL_TILED_STATUS_CNTRL (MCNTRL_TILED_STATUS_CNTRL), .MCNTRL_TILED_STATUS_CNTRL (MCNTRL_TILED_STATUS_CNTRL),
...@@ -1978,6 +1980,7 @@ assign axi_grst = axi_rst_pre; ...@@ -1978,6 +1980,7 @@ assign axi_grst = axi_rst_pre;
wire afi2_wrissuecap1en; // output wire afi2_wrissuecap1en; // output
compressor393 #( compressor393 #(
.CMPRS_CHN_MASK (CMPRS_CHN_MASK),
.CMPRS_NUM_AFI_CHN (CMPRS_NUM_AFI_CHN), .CMPRS_NUM_AFI_CHN (CMPRS_NUM_AFI_CHN),
.CMPRS_GROUP_ADDR (CMPRS_GROUP_ADDR), .CMPRS_GROUP_ADDR (CMPRS_GROUP_ADDR),
.CMPRS_BASE_INC (CMPRS_BASE_INC), .CMPRS_BASE_INC (CMPRS_BASE_INC),
......
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