In reply to Farhad:
Hi
I quote this page of the Cookbook:
“Finally the test_pkg can be compiled, but only after we have successfully compiled everything it requires.”
There is some thing that confuses me here. As far as I can see, the test_pkg contents which is shown in the same link, actually either imports or includes everything it requires. So why is it that, as shown in the example makefile, we have to compile them separately, before compiling test_pkg itself? Can’t we just compile the test_pkg alone?
Thanks
In principal you can pack anything of your environment and sequences test in one package, compiling it in the right order. Afterwards you can import this packae into your UVM toplevel module. But thgis is not a good approach, because it does snot allow reuse.
A better approach is to pack all data relaveant for a specific agent or env into a package. In the test_pkg you are importing these packages and adding the global env and the test code to be compiled. Afterwards you can simply import this test_pkg in the toplevel module of your UVM environment.