I am not really sure why you want to do this. Is the behavior of the sequence going
to change depending on which test (i.e test_name) it is invoked from? If so, it may
not be a good idea. I would rather create different sequences which can be invoked
from different tests.
Anyways if you still need it, one easy way is to use the config_db to store
the test_name during the build_phase of the test, and during the body of the sequence
you can extract the name from the config_db.
I am not really sure why you want to do this. Is the behavior of the sequence going
to change depending on which test (i.e test_name) it is invoked from? If so, it may
not be a good idea. I would rather create different sequences which can be invoked
from different tests.
Anyways if you still need it, one easy way is to use the config_db to store
the test_name during the build_phase of the test, and during the body of the sequence
you can extract the name from the config_db.
could you please explain the drawback of changing behavior of sequence depending on test?
In reply to y-yang:
My 2cents.
You can of course use the command line processor of UVM to extract not only the testcase name called but seed and other parameters.