When the Virtex-5 DDR2 design is simulated at low frequencies, there is a tWR violation when the sequence of commands is WRITE -> ACTIVATE -> PRECHARGE.
Existing Code
elsif (state_r = CTRL_ACTIVE) then
precharge_ok_cnt_r <= TO_UNSIGNED(TRAS_COUNT,5);
elsif (precharge_ok_cnt_r /= "00000") then
Modified Code
elsif (state_r = CTRL_ACTIVE) then
if (precharge_ok_cnt_r <= TO_UNSIGNED(TRAS_COUNT,5)) then
precharge_ok_cnt_r <= TO_UNSIGNED(TRAS_COUNT,5);
else
precharge_ok_cnt_r <= precharge_ok_cnt_r - 1;
end if;
elsif (precharge_ok_cnt_r /= "00000") then