Queue size

Hello,

I want to store only the last 20 addresses in the queue.
address change every clock cycle. When I do push_back queue is storing all the elements
Is there a way to pop out the 1st entry when 21st entry is push_back - ed

logic[7:0] q[$];

If the incoming address is matching any of the 20 entries, I need to call another task.

Thanks,
JeffD

In reply to dvuvmsv:

Why not check for size of queue and if q.size()==20 , then pop_front?

Thanks