The testbench is developed in QuestaSim Base (2024.1_1). One of the things the testbench does is it randomizes some test stimulus and the randomization is done using a class. I noticed that if the class generating the randomized stimuli is taken out of simulation environment (commented out) the simulation restarts properly after the restart -f command.
When the class is the part of the simulation environment, after issuing the restart -f command, the simulator goes through the notion of loading all the elements of the testbench but fails to load the design and to start properly. Another thing I noticed was when the simulation is terminated with quit -sim and a script is run to restart the simulation, it fails with a message that the design cannot be loaded. The only way to start the simulation is to quit it, restart QuestaSim and re-run the script.
Why would a testbench containing a class fail to restart? Does the class have to be somehow ‘deconstructed’ before the simulation ends?