Skip to question
SystemVerilogDesignVerificationFirmwareArchitectureASIC Interview Questions→
/Interview questions/Distinguish SystemVerilog Functions and Tasks

Q158·Free·SystemVerilog

Distinguish SystemVerilog Functions and Tasks

Difficulty
Easy
Topic
Timing
Language
SV
Interview prompt

Question

A testbench needs one reusable parity calculation and one reusable bus transaction that waits for clock edges and returns both data and status. Which choice assigns the two jobs correctly?

Choose one

Answer choices

  1. A. Use functions for both because SystemVerilog functions may contain arbitrary timing controls when called from a testbench.
  2. B. Use tasks for both because functions cannot have arguments in SystemVerilog.
  3. C. Use a function for the zero-time parity calculation and a task for the clocked bus transaction; the task may consume simulation time and return multiple outputs, while synthesizable uses of either remain tool- and context-bounded.
  4. D. Use a task for parity because tasks are the only subprograms allowed to return a value, and a function for the bus transaction because functions may wait on clocks.
Exact question handoffPractice Q158

Solve it in the question bank, keep your progress, and reveal the reviewed solution when your access allows.

Open in question bank →
Solution accessEach time you open this Solution, one Practice Credit is used; it is not permanently unlocked. Premium Solution content also uses one credit per opening.
Continue learning

Subroutines and Lifetime

Review functions, tasks, arguments, storage lifetime, reentrancy, and side effects.

  • Timing
  • SystemVerilog
  • Clocking
Subroutines and Lifetime →
Continue practicing

Related questions

Q422 · SystemVerilogSystemVerilog function timing ruleEasyP→Q913 · SystemVerilogSeparate a function from a taskEasyP→
ASIC.FYI · Learn silicon end to end.info@asic.fyi