It takes time to recompile. So is it possible to run multiple RTL test cases out of the same modelsim work library? Actually is it the way how we setup multiple test cases environment since we don’t want to compile all rtl+tb per each test case?
The issue I can think of is your rtl code may have lots of `ifdef. Sure the final code that you put into chip or fpga have a fixed defines. But when you run simulation, many times you want to run with different defines. +define+arg affects compile phase so different tests may have different compiled libraries. So they can’t share.
What hollis mentioned is on the RTL side.In fact test cases tend to have their own test tasks, sequences, etc. The compiled library will be different even RTL is the same. So in regression tests, each test has their compiled library. Yes it is not optimal due to long compilation time. One way to speed up is to pre-compile codes that you think will remain the same across tests into some library and then include that library in compiling.