quartus verilog megawizard memory

T

Travis Dunham

Guest
can anyone provide some assistance with how to interface with a megawizard 2 port memory? I've got an assignment to build a push/pop stack using memory created from the megawizard. The stipulation is that when a value is pushed onto the stack the existing data get pushed down 1 location. I've created a stack using registers with syntax such as stack[k]<=stack[k-1] in a for loop, which works great, but I'm not sure how to create a stack using the memory from the megawizard. I'm able to instantiate the memory, but not sure how to implement the 'push' down or up functionality.

Thanks
 
Hi Travis!

I'm able to instantiate the memory, but not sure how to implement the 'push' down or up functionality.
It seems to me not to be a problem with the memory but with the memory
control.

What about a pointer, that always points to the next free memory word? A
push operation writes a data word to the pointer location and increments
the pointer and a pop operation decrements the pointer and reads the
data word from the new pointed location.

Ralf
 

Welcome to EDABoard.com

Sponsor

Back
Top