Changeset 22 in XOpenSparcT1 for trunk/WB2ALTDDR3/dram_wb.v
- Timestamp:
- 03/31/11 12:31:26 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WB2ALTDDR3/dram_wb.v
r17 r22 22 22 module dram_wb( 23 23 input clk200, 24 input rup,25 input rdn,24 // input rup, 25 // input rdn, 26 26 27 27 input wb_clk_i, … … 64 64 ); 65 65 66 wire app_af_afull; 66 67 wire [127:0] rd_data_fifo_out; 67 68 reg [ 23:0] rd_addr_cache; 68 wire [ 127:0] wr_dout;69 wire [ 71:0] wr_dout; 69 70 wire [ 31:0] cmd_out; 70 71 reg wb_stb_i_d; … … 78 79 //wire [13:0] seriesterminationcontrol; 79 80 80 dram dram_ctrl( 81 dram # 82 ( 83 //synthesis traslate off 84 .SIM_ONLY (1) 85 //synthesis traslate on 86 ) 87 dram_ctrl( 81 88 .sys_clk(clk200), 82 89 .sys_rst_n(sysrst), // Resets all 83 90 .phy_init_done(phy_init_done), 91 92 .app_af_cmd({2'b00,!cmd_out[31]}), //command for the controller 000:write 001:read 93 .app_af_addr(cmd_out[30:0]), 94 .app_af_wren(push_tran), //write enable for address fifo 95 .app_wdf_wren(cmd_out[31] & push_tran), // write enable for write data fifo 96 .app_wdf_data({wr_dout[63:0],wr_dout[63:0]}), 84 97 .app_wdf_mask_data(mask_data), 85 .app_af_addr(cmd_out[31:1]),98 86 99 .rd_data_valid(rd_data_valid), 87 100 .rd_data_fifo_out(rd_data_fifo_out), 88 .app_wdf_data(wr_dout[127:0]), 89 90 // in dubbio 91 .app_wdf_wren(1'b1), 92 .app_af_wren(1'b1), 93 .app_af_afull(), 94 .app_wdf_afull(), 95 .app_af_cmd(), 96 .clk0_tb(), 97 .idly_clk_200(clk200), 98 .rst0_tb(ddr3_reset), 99 100 .ddr2_dqs(ddr3_dqs), 101 .ddr2_dqs_n(ddr3_dqs_n), 101 102 .clk0_tb(ddr_clk), 103 .rst0_tb(ddr3_reset), 104 .app_af_afull(app_af_afull), 105 .app_wdf_afull(), 106 .idly_clk_200(clk200), 107 102 108 .ddr2_ck(ddr3_ck), 103 109 .ddr2_ck_n(ddr3_ck_n), 104 110 .ddr2_dq(ddr3_dq), 111 .ddr2_dqs(ddr3_dqs), 112 .ddr2_dqs_n(ddr3_dqs_n), 105 113 .ddr2_ras_n(ddr3_ras_n), 106 114 .ddr2_cas_n(ddr3_cas_n), … … 112 120 .ddr2_a(ddr3_a), 113 121 .ddr2_dm(ddr3_dm) 114 // |115 //non sostituiti\|/116 // V117 // .phy_clk(ddr_clk), // User clock118 // .local_ready(dram_ready),119 // .local_burstbegin(push_tran),120 // .local_read_req(!cmd_out[31] && push_tran),121 // .local_write_req(cmd_out[31] && push_tran),122 // .local_wdata({wr_dout[63:0],wr_dout[63:0],wr_dout[63:0],wr_dout[63:0]}),123 // .local_size(3'b001)124 125 122 ); 123 124 assign dram_ready = phy_init_done && !app_af_afull; 126 125 127 126 /* comment by sal … … 179 178 */ 180 179 181 assign ddr_rst=!phy_init_done; 180 assign ddr_rst=!phy_init_done; 182 181 183 182 /*oct_alt_oct_power_f4c oct … … 190 189 191 190 always @( * ) 192 case(cmd_out[1:0]) 193 2'b00:mask_data<={24'h000000,wr_dout[71:64]}; 194 2'b01:mask_data<={16'h0000,wr_dout[71:64],8'h00}; 195 2'b10:mask_data<={8'h00,wr_dout[71:64],16'h0000}; 196 2'b11:mask_data<={wr_dout[71:64],24'h000000}; 191 case(cmd_out[0]) 192 1'b0:mask_data<={8'h00,wr_dout[71:64]}; 193 1'b1:mask_data<={wr_dout[71:64],8'h00}; 197 194 endcase 198 195 … … 304 301 305 302 always @( * ) 306 case(wb_adr_i[4:3]) 307 2'b00:wb_dat_o<=rd_data_fifo_out_d[63:0]; 308 2'b01:wb_dat_o<=rd_data_fifo_out_d[127:64]; 309 2'b10:wb_dat_o<=rd_data_fifo_out_d[191:128]; 310 2'b11:wb_dat_o<=rd_data_fifo_out_d[255:192]; 303 case(wb_adr_i[3]) 304 1'b0:wb_dat_o<=rd_data_fifo_out_d[63:0]; 305 1'b1:wb_dat_o<=rd_data_fifo_out_d[127:64]; 311 306 endcase 312 307 313 308 always @(posedge wb_clk_i or posedge wb_rst_i) 314 309 if(wb_rst_i) 315 rd_addr_cache<=24'hFFFFFF; 310 begin 311 //written<=0; 312 rd_addr_cache<=24'hFFFFFF; 313 end 316 314 else 317 315 begin
Note: See TracChangeset
for help on using the changeset viewer.