Http://www.cnblogs.com/edaplayer/p/3678897.html
Before the school to novice FPGA when encountered SDRAM, and now suddenly found online there are a lot of ready-made code, friend Crystal, Altera has a mobile_dram_altera_max_ii_cpld_design_example version of, hehe, Take doctrine really good, later have the opportunity to try to write their own.
But when using sdram_control_4port found, full page when the image data error, brush screen position and expected a great discrepancy, and only the VGA bar display is normal, vertical bar and fractal diagram are completely deformed, it seems certainly not the same mom born. The question is exactly where, I try to draw half a single line to see, found unexpectedly beyond the screen half of the position, this is obviously unscientific. Catch waveform to see, send data into the FIFO is normal, that seems to be SDRAM storage or output data problems, the SDRAM code to study all over again, still no fruit, finally Baidu SDRAM page write, see the privilege mentioned, SDRAM page read and write to the end of the operation by sending a burst stop command, Otherwise read and write will continue to read and write from the current operation address! Oh,mygod. Finally look at the key code, found that the burst Stop command is never sent to SDRAM, is the following code, in the COMMAND.V file.
else if ((do_precharge==1) & ((Oe1 = = 1) | (Rw_flag = = 1))) Begin
Burst terminate if write is active//cmd = 110 burst Stop
Ras_n <= 1;
Cas_n <= 1;
We_n <= 0;
Look at the execution conditions of this process block (do_precharge==1) & ((Oe1 = = 1) | (Rw_flag = = 1)), how can I find out when this condition is set up ...
So I changed do_precharge==1 to pmstop = = 1, hehe, problem solving.
In fact, this SDRAM controller original code is nwlogic, the friend Crystal made a change, cut some signals, the use of the source of the friend can lead to data read and write errors, unless your board and friends of the same crystal. The necessary signals and commands must be completed according to the needs of the UF crystal.
Turn-friend Crystal sdram_control_4port full page operation bug?