Forum Discussion
Altera_Forum
Honored Contributor
7 years agoYes - use a counter to measure time, in clock cycles. That's how I would do it.
As for your code - fundamentally it's about right. What signal type are you proposing for 'read_pointer'? Depending on what that is will determine whether you need single quotes around the '1'. I'd suggest using an 'unsigned' type or an integer with a positive range. Then you wouldn't put single quotes around your + 1. Whether you need a 'buffer' signal depends whether 'read_pointer' in a output port to your entity. You can't read output ports. So, if so, you'd need a local buffer which you'd increment and also assign to the relevant output port. Cheers, Alex