SystemVerilog Concepts
SystemVerilog Concepts
2. Why logic is introduced in SV? Or Why reg and wires are not sufficient?
'logic' was introduced in SystemVerilog to overcome the limitations of 'reg' and 'wire'.
Unlike 'reg', which can have multiple drivers, 'logic' can hold 4 states (0, 1, x, z) and is easier
to use for modeling digital circuits without ambiguity.
Wire: To connect the output of a module to the input of another module, To connect a signal
from a test-bench to a module under test.
Reg: To store the value of a counter, To store the state of a finite state machine.
Logic: To represent the output of a multiplexer, To represent the value of a signal that is
driven by multiple sources, such as the output of a shared bus.
Union: All members share the same memory, and only one member can hold a value at a
time, as writing to one will overwrite the others.
Both structure and union holds different data types (not like array which hold only same
data type)
17. What are SystemVerilog interfaces and why are they introduced?
Interfaces group related signals together, simplifying module connections and improving
readability and maintainability of code.
19. What is the final block? Difference between initial and final block.
The final block is executed at the end of the simulation, while the initial block is executed at
the start. Final blocks are used for cleanup tasks.