Can I put an assert statement inside of a task?

In reply to ianmurph:
Concurrent assertions are DISALLOWED in tasks or in classes because they are dynamically instanced. However immediate assertions are legal.
Since your assertion impact interface signals, your best bet is to put the concurrent assertions in the interface. However, there is a mechanism to emulate concurrent assertions in classes using tasks. I explain this in my paper Understanding the SVA Engine,
https://verificationacademy.com/verification-horizons/july-2020-volume-16-issue-2

Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
** SVA Handbook 4th Edition, 2016 ISBN 978-1518681448

  1. SVA Package: Dynamic and range delays and repeats SVA: Package for dynamic and range delays and repeats | Verification Academy
  2. Free books: * Component Design by Example FREE BOOK: Component Design by Example … A Step-by-Step Process Using VHDL with UART as Vehicle | Verification Academy
  1. Papers:

Udemy courses by Srinivasan Venkataramanan (http://cvcblr.com/home.html)
https://www.udemy.com/course/sva-basic/
https://www.udemy.com/course/sv-pre-uvm/