Skip to content

Commit baba267

Browse files
author
Sebastien Bourdeauducq
committedFeb 24, 2012
ddrphy: request wrdata_en/rddata_en at the same time as the command
1 parent 17b2588 commit baba267

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed
 

‎milkymist/dfii/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ def get_fragment(self):
4242
),
4343
self.phase.address.eq(self._address.field.r),
4444
self.phase.bank.eq(self._baddress.field.r),
45+
self.phase.wrdata_en.eq(self._command.re & self._wren.r),
46+
self.phase.rddata_en.eq(self._command.re & self._rden.r),
4547
self.phase.wrdata.eq(self._wrdata.field.r),
4648
self.phase.wrdata_mask.eq(0)
4749
]
4850
sync = [
49-
self.phase.wrdata_en.eq(self._command.re & self._wren.r),
50-
self.phase.rddata_en.eq(self._command.re & self._rden.r),
5151
If(self.phase.rddata_valid, self._rddata.field.w.eq(self.phase.rddata))
5252
]
5353
return Fragment(comb, sync)

‎verilog/s6ddrphy/s6ddrphy.v

+12-8
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
*
44
************* DATAPATH SIGNALS ***********
55
* Assert dfi_wrdata_en and present the data
6-
* on dfi_wrdata_mask/dfi_wrdata one cycle after
7-
* a write command.
6+
* on dfi_wrdata_mask/dfi_wrdata in the same
7+
* cycle as the write command.
88
*
9-
* Assert dfi_rddata_en one cycle after a read
9+
* Assert dfi_rddata_en in the same cycle as the read
1010
* command. The data will come back on dfi_rddata
11-
* 3 cycles later, along with the assertion of
11+
* 4 cycles later, along with the assertion of
1212
* dfi_rddata_valid.
1313
*
1414
* This PHY only supports CAS Latency 3.
@@ -340,22 +340,26 @@ endgenerate
340340
* DQ/DQS/DM control
341341
*/
342342

343+
reg d_dfi_wrdata_en_p1;
344+
always @(posedge sys_clk)
345+
d_dfi_wrdata_en_p1 <= dfi_wrdata_en_p1;
346+
343347
reg r_dfi_wrdata_en;
344348
always @(posedge clk2x_270)
345-
r_dfi_wrdata_en <= dfi_wrdata_en_p1;
349+
r_dfi_wrdata_en <= d_dfi_wrdata_en_p1;
346350

347351
reg r2_dfi_wrdata_en;
348352
always @(posedge clk2x_270)
349353
r2_dfi_wrdata_en <= r_dfi_wrdata_en;
350354

351355
assign drive_dqs = r2_dfi_wrdata_en;
352-
assign drive_dq = dfi_wrdata_en_p1;
356+
assign drive_dq = d_dfi_wrdata_en_p1;
353357

354358
wire rddata_valid;
355-
reg [3:0] rddata_sr;
359+
reg [4:0] rddata_sr;
356360
assign dfi_rddata_valid_w0 = rddata_sr[0];
357361
assign dfi_rddata_valid_w1 = rddata_sr[0];
358362
always @(posedge sys_clk)
359-
rddata_sr <= {dfi_rddata_en_p0, rddata_sr[3:1]};
363+
rddata_sr <= {dfi_rddata_en_p0, rddata_sr[4:1]};
360364

361365
endmodule

0 commit comments

Comments
 (0)
Please sign in to comment.