In reply to zz8318:
Please read carefully what Dave mentioned regarding posting a minimal complete example. It needs to be an complete set of code that will compile for both SV and C++. Posting incomplete code sections with ‘while(…)’ and ‘…’ DOES NOT HELP since they can’t be compiled to determine what the issue is.
Dave posted a complete example that works. Please post a complete example which exhibits the issue you are seeing.