Altera_Forum
Honored Contributor
15 years agoVerilog delays~?
Hello, I'm writing a verilog prog on my DE1 to read off the flash memory... but I cannot
figure out how I can wait until the read completes before continuing in my program. I set f_read = 1 outside to allow the read to begin we set f_busy = 1 during this time. After 1 ms, we finish up and reset the registers || //50MHz = 20 ns/cycle || always @(posedge CLOCK_50) begin || if (f_read == 1) begin || f_busy <= 1; || || if (f_count == 0) begin || || //set up signals here || || //wait 0.2 ms || end else if(f_count == 1) begin || || //data is now valid, store it || || //wait 1 ms || end else if(f_count == 5) begin || || f_count <= 0; //reset stuff || f_busy <= 0; || end || || if(f_busy == 1) begin || f_count <= f_count+1; || end || end || end So, say I have a task called read_flash. We set f_read in here - what can I put in there to wait for f_busy to equal 0?