// TODO: Add number of blocks to R/W? (blocks can be different) - total length?
// TODO: Add number of blocks to R/W? (blocks can be different) - total length?
// Read back current address (fro debugging)?
// Read back current address (fro debugging)?
parameterMCNTRL_SCANLINE_STATUS_REG_ADDR='h4,
parameterMCNTRL_SCANLINE_STATUS_REG_ADDR='h4,
parameterMCNTRL_SCANLINE_PENDING_CNTR_BITS=2// Number of bits to count pending trasfers, currently 2 is enough, but may increase
parameterMCNTRL_SCANLINE_PENDING_CNTR_BITS=2,// Number of bits to count pending trasfers, currently 2 is enough, but may increase
// if memory controller will allow programming several sequences in advance to
// if memory controller will allow programming several sequences in advance to
// spread long-programming (tiled) over fast-programming (linear) requests.
// spread long-programming (tiled) over fast-programming (linear) requests.
// But that should not be too big to maintain 2-level priorities
// But that should not be too big to maintain 2-level priorities
parameterMAX_TILE_WIDTH=6,// number of bits to specify maximal tile (width-1) (6 -> 64)
parameterMAX_TILE_HEIGHT=6,// number of bits to specify maximal tile (height-1) (6 -> 64)
parameterMCNTRL_TILED_ADDR='h120,
parameterMCNTRL_TILED_MASK='h3f0,// both channels 0 and 1
parameterMCNTRL_TILED_MODE='h0,// set mode register: {extra_pages[1:0],write_mode,enable,!reset}
parameterMCNTRL_TILED_STATUS_CNTRL='h1,// control status reporting
parameterMCNTRL_TILED_STARTADDR='h2,// 22-bit frame start address (3 CA LSBs==0. BA==0)
parameterMCNTRL_TILED_FRAME_FULL_WIDTH='h3,// Padded line length (8-row increment), in 8-bursts (16 bytes)
parameterMCNTRL_TILED_WINDOW_WH='h4,// low word - 13-bit window width (0->'n4000), high word - 16-bit frame height (0->'h10000)
parameterMCNTRL_TILED_WINDOW_X0Y0='h5,// low word - 13-bit window left, high word - 16-bit window top
parameterMCNTRL_TILED_WINDOW_STARTXY='h6,// low word - 13-bit start X (relative to window), high word - 16-bit start y
// Start XY can be used when read command to start from the middle
// TODO: Add number of blocks to R/W? (blocks can be different) - total length?
// Read back current address (fro debugging)?
parameterMCNTRL_TILED_TILE_WH='h7,// low word - 6-bit tile width in 8-bursts, high - tile height (0 - > 64)
parameterMCNTRL_TILED_STATUS_REG_ADDR='h5,
parameterMCNTRL_TILED_PENDING_CNTR_BITS=2,// Number of bits to count pending trasfers, currently 2 is enough, but may increase
// 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
parameterMCNTRL_TILED_FRAME_PAGE_RESET=1'b0// reset internal page number to zero at the frame start (false - only when hard/soft reset)
)(
)(
inputrst_in,
inputrst_in,
...
@@ -246,6 +267,16 @@ module mcntrl393 #(
...
@@ -246,6 +267,16 @@ module mcntrl393 #(
// optional I/O for channel synchronization
// optional I/O for channel synchronization
output[FRAME_HEIGHT_BITS-1:0]line_unfinished_chn3,// number of the current (ufinished ) line, REALATIVE TO FRAME, NOT WINDOW?.
output[FRAME_HEIGHT_BITS-1:0]line_unfinished_chn3,// number of the current (ufinished ) line, REALATIVE TO FRAME, NOT WINDOW?.
inputsuspend_chn3,// suspend transfers (from external line number comparator)
inputsuspend_chn3,// suspend transfers (from external line number comparator)
// Channel 4 (tiled tes)
inputframe_start_chn4,// resets page, x,y, and initiates transfer requests (in write mode will wait for next_page)
inputnext_page_chn4,// page was read/written from/to 4*1kB on-chip buffer
outputpage_ready_chn4,// == xfer_done, connect externally | Single-cycle pulse indicating that a page was read/written from/to DDR3 memory
outputframe_done_chn4,// single-cycle pulse when the full frame (window) was transferred to/from DDR3 memory
// optional I/O for channel synchronization
output[FRAME_HEIGHT_BITS-1:0]line_unfinished_chn4,// number of the current (ufinished ) line, REALATIVE TO FRAME, NOT WINDOW?.
inputsuspend_chn4,// suspend transfers (from external line number comparator)
// DDR3 interface
// DDR3 interface
outputSDRST,// DDR3 reset (active low)
outputSDRST,// DDR3 reset (active low)
...
@@ -319,7 +350,6 @@ module mcntrl393 #(
...
@@ -319,7 +350,6 @@ module mcntrl393 #(
// wire rpage_nxt_chn2;
// wire rpage_nxt_chn2;
wirebuf_wr_chn2;
wirebuf_wr_chn2;
wirebuf_wpage_nxt_chn2;
wirebuf_wpage_nxt_chn2;
// wire [6:0] buf_waddr_chn2;
wire[63:0]buf_wdata_chn2;
wire[63:0]buf_wdata_chn2;
wirewant_rq3;
wirewant_rq3;
...
@@ -331,20 +361,21 @@ module mcntrl393 #(
...
@@ -331,20 +361,21 @@ module mcntrl393 #(
wireseq_done3;
wireseq_done3;
wirerpage_nxt_chn3;
wirerpage_nxt_chn3;
wirebuf_rd_chn3;
wirebuf_rd_chn3;
// wire [6:0] buf_raddr_chn3;
wire[63:0]buf_rdata_chn3;
wire[63:0]buf_rdata_chn3;
wirewant_rq4;
wirewant_rq4;
wireneed_rq4;
wireneed_rq4;
wirechannel_pgm_en4;
wirechannel_pgm_en4;
wire[31:0]seq_data4;
wireseq_wr4;
// wire seq_tiled_start_rd;
wireseq_set4;
wire[31:0]seq_data4x;// may be shared with other channel
wireseq_wr4x;// may be shared with other channel
wireseq_set4x;// may be shared with other channel
wireseq_done4;
wireseq_done4;
wirerpage_nxt_chn4;
wirerpage_nxt_chn4;
wirebuf_wr_chn4;
wirebuf_wr_chn4;
wirebuf_wpage_nxt_chn4;
wirebuf_wpage_nxt_chn4;
// wire [6:0] buf_waddr_chn4;
wire[63:0]buf_wdata_chn4;
wire[63:0]buf_wdata_chn4;
// Command tree - insert register layer if needed
// Command tree - insert register layer if needed
...
@@ -356,6 +387,8 @@ module mcntrl393 #(
...
@@ -356,6 +387,8 @@ module mcntrl393 #(
wirecmd_scanline_chn2_stb;
wirecmd_scanline_chn2_stb;
wire[7:0]cmd_scanline_chn3_ad;
wire[7:0]cmd_scanline_chn3_ad;
wirecmd_scanline_chn3_stb;
wirecmd_scanline_chn3_stb;
wire[7:0]cmd_tiled_chn4_ad;
wirecmd_tiled_chn4_stb;
// Status tree:
// Status tree:
...
@@ -375,6 +408,10 @@ module mcntrl393 #(
...
@@ -375,6 +408,10 @@ module mcntrl393 #(
wirestatus_scanline_chn3_rq;// PS scanline channel3 (memory read) channels status request
wirestatus_scanline_chn3_rq;// PS scanline channel3 (memory read) channels status request
wirestatus_scanline_chn3_start;// PS scanline channel3 (memory read) channels status packet transfer start (currently with 0 latency from status_root_rq)
wirestatus_scanline_chn3_start;// PS scanline channel3 (memory read) channels status packet transfer start (currently with 0 latency from status_root_rq)
wire[7:0]status_tiled_chn4_ad;// PS tiled channel4 (memory read) status byte-wide address/data
wirestatus_tiled_chn4_rq;// PS tiled channel4 (memory read) channels status request
wirestatus_tiled_chn4_start;// PS tiled channel4 (memory read) channels status packet transfer start (currently with 0 latency from status_root_rq)