Search the Community
Showing results for tags 'program'.
I am sharing something I stumbled on and learned from and also a question. Question) It seems I don't need to instantiate a program block for its initial statement/s to run. If I just add it to the compile-list of files (note it is doing nothing necessary), it is compiled and initial statements in it run. I am using VCS. Why don't I need to instantiate the program block. It is as if it is automatically created as a singleton. Statement) If I put an initial block in this program, the sim dies immediately when that initial block is done, even if there are other initial statements in the top-level module. As I experiment with a program block for one of the first times, this has caused me some headaches. Then, I learned from the LRM: From SystemVerilog 1800 LRM, explaining why my simulation dies when "When all initial procedures within a program have reached their end, that program shall immediately terminate all descendent threads of initial procedures within that program. If there is at least one initial procedure within at least one program block, the entire simulation shall terminate by means of an implicit call to the $finish system task immediately after all the threads and all their descendent threads originating from all initial procedures within all programs have ended."