// wire [31:0] axird_bram_rdata; // .data_out(rdata[31:0]), // data out
output[31:0]axird_rdata,// combinatorial multiplexed (add external register layer, modify axibram_read?) .data_out(rdata[31:0]), // data out
// wire [31:0] port0_rdata; //
// wire [31:0] status_rdata; //
// Channels 2 and 3 control signals
// TODO: move line_unfinished and suspend to internals of this module (and control comparator modes)
inputframe_start_chn2,// resets page, x,y, and initiates transfer requests (in write mode will wait for next_page)
inputnext_page_chn2,// page was read/written from/to 4*1kB on-chip buffer
outputpage_ready_chn2,// == xfer_done, connect externally | Single-cycle pulse indicating that a page was read/written from/to DDR3 memory
outputframe_done_chn2,// 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_chn2,// number of the current (ufinished ) line, REALATIVE TO FRAME, NOT WINDOW?.
inputsuspend_chn2,// suspend transfers (from external line number comparator)
inputframe_start_chn3,// resets page, x,y, and initiates transfer requests (in write mode will wait for next_page)
inputnext_page_chn3,// page was read/written from/to 4*1kB on-chip buffer
outputpage_ready_chn3,// == xfer_done, connect externally | Single-cycle pulse indicating that a page was read/written from/to DDR3 memory
outputframe_done_chn3,// 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_chn3,// number of the current (ufinished ) line, REALATIVE TO FRAME, NOT WINDOW?.
inputsuspend_chn3,// suspend transfers (from external line number comparator)
// DDR3 interface
// DDR3 interface
outputSDRST,// DDR3 reset (active low)
outputSDRST,// DDR3 reset (active low)
...
@@ -204,34 +266,341 @@ module mcntrl393 #(
...
@@ -204,34 +266,341 @@ module mcntrl393 #(
outputSDDMU,// UDM I/O pad (actually only output)
outputSDDMU,// UDM I/O pad (actually only output)
inoutDQSU,// UDQS I/O pad
inoutDQSU,// UDQS I/O pad
inoutNDQSU//,
inoutNDQSU//,
// output DUMMY_TO_KEEP // to keep PS7 signals from "optimization"
// output DUMMY_TO_KEEP // to keep PS7 signals from "optimization"
// input MEMCLK
// input MEMCLK
// temporary debug data
// temporary debug data
,output[11:0]tmp_debug// add some signals generated here?
,output[11:0]tmp_debug// add some signals generated here?
);
);
localparamBUFFER_DEPTH=10;
wirerst=rst_in;
wirerst=rst_in;
wireaxi_rst=rst_in;
// Not yet connected
// wire [7:0] status_other_ad; // Other status byte-wide address/data
// wire status_other_rq; // Other status request
// wire status_other_start; // Other status packet transfer start (currently with 0 latency from status_root_rq)
//cmd_ps_pio_stb
// command port 0 (filled by software - 32w->32r) - used for mode set, refresh, write levelling, ...
// TODO: move to internal !
// Interface to channels to read/write memory (including 4 page BRAM buffers)
wirewant_rq0;
wireneed_rq0;
wirechannel_pgm_en0;
wire[9:0]seq_data0;// only 10 bits used
// wire seq_wr0; // not used
wireseq_set0;
wireseq_done0;
wirebuf_wr_chn0;
wire[6:0]buf_waddr_chn0;
wire[63:0]buf_wdata_chn0;
wirewant_rq1;
wireneed_rq1;
wirechannel_pgm_en1;
// wire [9:0] seq_data1=seq_data0; // use the same
// wire seq_wr1; // not used
// wire seq_set1; // not used
wireseq_done1;
wirebuf_rd_chn1;
wire[6:0]buf_raddr_chn1;
wire[63:0]buf_rdata_chn1;
wirewant_rq2;
wireneed_rq2;
wirechannel_pgm_en2;
wire[31:0]seq_data2x;// may be shared with other channel
wireseq_wr2x;// may be shared with other channel
wireseq_set2x;// may be shared with other channel
wireseq_done2;
wirebuf_wr_chn2;
wire[6:0]buf_waddr_chn2;
wire[63:0]buf_wdata_chn2;
wirewant_rq3;
wireneed_rq3;
wirechannel_pgm_en3;
wire[31:0]seq_data3x;// may be shared with other channel
wireseq_wr3x;// may be shared with other channel
wireseq_set3x;// may be shared with other channel
wireseq_done3;
wirebuf_rd_chn3;
wire[6:0]buf_raddr_chn3;
wire[63:0]buf_rdata_chn3;
wirewant_rq4;
wireneed_rq4;
wirechannel_pgm_en4;
wire[31:0]seq_data4;
wireseq_wr4;
wireseq_set4;
wireseq_done4;
wirebuf_wr_chn4;
wire[6:0]buf_waddr_chn4;
wire[63:0]buf_wdata_chn4;
// Command tree - insert register layer if needed
wire[7:0]cmd_mcontr_ad;
wirecmd_mcontr_stb;
wire[7:0]cmd_ps_pio_ad;
wirecmd_ps_pio_stb;
wire[7:0]cmd_scanline_chn2_ad;
wirecmd_scanline_chn2_stb;
wire[7:0]cmd_scanline_chn3_ad;
wirecmd_scanline_chn3_stb;
// Status tree:
wire[7:0]status_mcontr_ad;// Memory controller status byte-wide address/data
wire[7:0]status_mcontr_ad;// Memory controller status byte-wide address/data
wirestatus_mcontr_rq;// Memory controller status request
wirestatus_mcontr_rq;// Memory controller status request
wirestatus_mcontr_start;// Memory controller status packet transfer start (currently with 0 latency from status_root_rq)
wirestatus_mcontr_start;// Memory controller status packet transfer start (currently with 0 latency from status_root_rq)
// Not yet connected
wire[7:0]status_other_ad;// Other status byte-wide address/data
wire[7:0]status_ps_pio_ad;// PS PIO channels status byte-wide address/data
wirestatus_other_rq;// Other status request
wirestatus_ps_pio_rq;// PS PIO channels status request
wirestatus_other_start;// Other status packet transfer start (currently with 0 latency from status_root_rq)
wirestatus_ps_pio_start;// PS PIO channels status packet transfer start (currently with 0 latency from status_root_rq)
wire[7:0]status_scanline_chn2_ad;// PS scanline channel2 (memory read) status byte-wide address/data
wirestatus_scanline_chn2_rq;// PS scanline channel2 (memory read) channels status request
wirestatus_scanline_chn2_start;// PS scanline channel2 (memory read) channels status packet transfer start (currently with 0 latency from status_root_rq)
wire[7:0]status_scanline_chn3_ad;// PS scanline channel3 (memory read) status byte-wide address/data
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)
regselect_cmd0;
regselect_buf0;
regselect_buf1;
regselect_buf2;
regselect_buf3;
regselect_buf4;
regselect_buf0_d;// delayed by 1 clock, for combining with regen?
regselect_buf2_d;
regselect_buf4_d;
status_router2status_router2_mctrl_top_i(
// Buffers R/W from AXI
reg[BUFFER_DEPTH-1:0]buf_waddr;
reg[31:0]buf_wdata;
regcmd_we;
regbuf1_we;
regbuf3_we;
wire[BUFFER_DEPTH-1:0]buf_raddr;
wire[31:0]buf0_data;
wire[31:0]buf2_data;
wire[31:0]buf4_data;
wirebuf0_rd;
wirebuf0_regen;
wirebuf2_rd;
wirebuf2_regen;
wirebuf4_rd;
wirebuf4_regen;
// common for channels 2 and 3
wire[2:0]lin_rw_bank;// memory bank
wire[ADDRESS_NUMBER-1:0]lin_rw_row;// memory row
wire[COLADDR_NUMBER-4:0]lin_rw_col;// start memory column in 8-bursts
wire[5:0]lin_rw_num128;// number of 128-bit words to transfer (8*16 bits) - full bursts of 8 ( 0 - maximal length, 64)
wirelin_rd_start;// start generating commands for read sequence
wirelin_wr_start;// start generating commands for write sequence