Circular buffer is similar to the normal buffer, except that if the write pointer reaches the last location, it gets reset to the first location of the buffer ..
You can implement this action using a simple if-statement .. :
if (last) then
pointer <= first;
end if;