|
Answer» Program block is newly added in SystemVerilog. It serves these PURPOSES
- It separates testbench from DUT
- It helps in ensuring that testbench doesn't have any race condition with DUT
- It provides an entry point for execution of testbench
- It provides syntactic context (via program ... endprogram) that specifies scheduling in the Reactive Region.
Having said this the major difference between module and program blocks are
- Program blocks can't have always block inside them, modules can have.
- Program blocks can't contain UDP, modules, or other instance of program block inside them. Modules don't have any such restrictions.
- Inside a program block, program variable can only be assigned using blocking assignment and non-program variables can only be assigned using non-blocking assignments. No such restrictions on module
- Program blocks get executed in the re-ACTIVE region of scheduling queue, module blocks get executed in the active region
- A program can call a TASK or function in modules or other programs. But a module can not call a task or function in a program.
Program block is newly added in SystemVerilog. It serves these purposes Having said this the major difference between module and program blocks are
|