wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SystemVerilog Assessment 4 – Worksheet Questions

Total questions: 100

Worksheet time: 50mins

Name
Class
Date
1.

Which construct is used to define temporal behavior in assertions?

a)

task

b)

always

c)

initial

d)

sequence

2.

What does ## represent in a sequence?

a)

Delay operator

b)

Bitwise AND

c)

Logical AND

d)

Concatenation

3.

Which of the following is used to monitor coverage of sequences?

a)

coverpoint

b)

covergroup

c)

cover

d)

assert

4.

What does |-> denote in a property definition?

a)

Conjunction

b)

Implication

c)

Delay

d)

Equality

5.

Which assertion type is evaluated in procedural code blocks?

a)

Temporal

b)

Concurrent

c)

Immediate

d)

Static

6.

Which system task immediately terminates the simulation upon invocation?

a)

$info

b)

$warning

c)

$fatal

d)

$error

7.

What is the primary purpose of $warning?

a)

To stop simulation

b)

To log non-critical issues

c)

To display debug info

d)

To raise fatal errors

8.

Which task is best used for general informational messages during simulation?

a)

$error

b)

$info

c)

$warning

d)

$fatal

9.

Which task allows you to specify an exit code when terminating simulation?

a)

$error

b)

$fatal

c)

$warning

d)

$info

10.

Which of the following does not affect simulation control flow?

a)

$fatal

b)

$warning

c)

$info

d)

$error

11.

Which task is most appropriate for logging assertion failures without stopping simulation?

a)

$warning

b)

$info

c)

$error

d)

$fatal

12.

Which task is least severe in terms of simulation impact?

a)

$warning

b)

$error

c)

$info

d)

$fatal

13.

Which construct is used to define functional coverage?

a)

coverpoint

b)

cover

c)

covergroup

d)

assert

14.

What does coverpoint represent?

a)

A sequence of events

b)

A sampled variable or expression

c)

A testbench module

d)

A simulation time marker

15.

What does cross coverage measure?

a)

Simulation speed

b)

Assertion failures

c)

Timing violations

d)

Combinations of multiple coverpoints

16.

Which type of bin is automatically created by the simulator?

a)

explicit

b)

illegal

c)

default

d)

ignore

17.

Which bin type is used to mark invalid or undesired values?

a)

default

b)

cross

c)

ignore

d)

illegal

18.

When is coverage data sampled in a covergroup?

a)

During reset

b)

When sample() is called

c)

At every clock edge

d)

At simulation end

19.

Which of the following can be used inside a covergroup definition?

a)

coverpoint

b)

cover

c)

initial

d)

always

20.

Which keyword is used to define transition bins?

a)

bins with |->

b)

transitions

c)

trans bin

d)

bins with =>

21.

Which of the following can cause cross coverage bins to remain unhit?

a)

Disabled covergroup

b)

All of the above

c)

Missing combinations in stimulus

d)

Incorrect sampling

22.

What does the get() method do in a mailbox?

a)

Sends a message

b)

Retrieves and removes a message

c)

Deletes the mailbox

d)

Checks mailbox size

23.

What happens if try_get() is called on an empty mailbox?

a)

Simulation continues

b)

Causes a fatal error

c)

Returns null

d)

Blocks until a message is available

24.

What happens if a process calls get(n) and fewer than n keys are available?

a)

it creates the sufficient number of keys

b)

It blocks until keys are available

c)

It returns immediately

d)

it throws an error

25.

Which method allows non-blocking retrieval from a mailbox?

a)

sample()

b)

try_get()

c)

peek()

d)

get()

26.

Which of the following is true about peek() in mailboxes?

a)

It blocks if mailbox is empty

b)

It removes the message

c)

It reads without removing

d)

It deletes the mailbox

27.

Which of the following statements about covergroup is true?

a)

It can only track one variable

b)

It cannot be used with assertions

c)

It is mandatory for all simulations

d)

It is used for functional coverage

28.

What does the sample() method do in the context of a covergroup?

a)

It triggers the covergroup to record data

b)

It displays the coverage report

c)

It retrieves the last sampled value

d)

It resets the covergroup

29.

Which of the following is a valid way to define a covergroup in SystemVerilog?

a)

cover my_group { coverpoint a; }

b)

covergroup my_group; coverpoint a; endgroup;

c)

group my_group { coverpoint a; }

d)

covergroup my_group { coverpoint a; }

30.

Two threads call sem.get(1) simultaneously. What happens?

a)

One thread blocks

b)

Simulation fails

c)

Semaphore resets

d)

Both threads proceed

31.

You define a cross coverage: "cross mode, enable;" After simulation, some cross bins are unhit. What’s the best explanation?

a)

mode is constant

b)

enable is never high

c)

Cross coverage is disabled

d)

Certain combinations never occur

32.

You define a covergroup but forget to call sample(). What happens?

a)

All bins are ignored

b)

Coverage is collected automatically

c)

Coverage report shows zero hits

d)

Simulation fails

33.

You define a covergroup to track values of a 2-bit signal: "covergroup cg @(posedge clk); coverpoint mode; endgroup" After simulation, bin[2] is never hit. What’s the best debugging step?

a)

Check if mode is randomized

b)

Replace coverpoint with assert

c)

Use disable iff

d)

Add assert(mode!=2)

34.

In SystemVerilog, which statement repeats code a fixed number of times?

a)

repeat

b)

while

c)

do...while

d)

forever

35.

Which loop guarantees at least one execution of the loop body?

a)

do...while

b)

while

c)

for

d)

repeat

36.

Which SystemVerilog loop is typically used when the number of iterations is known beforehand?

a)

do...while

b)

while

c)

forever

d)

for

37.

Which control-flow statement in SystemVerilog selects a branch based on a single expression's value?

a)

repeat

b)

if-else

c)

case

d)

fork-join

38.

In a case statement, what does default: do?

a)

Matches any value not matched by other branches

b)

Is only used in casez statements

c)

Forces simulation to stop

d)

Causes syntax error if not last item

39.

What is the difference between unique and unique0 on an if?

a)

unique0 reports an error if exactly one condition true.

b)

unique reports an error if zero or multiple conditions true; unique0 allows zero true but errors on multiple true.

c)

They are identical.

d)

unique allows multiple true branches; unique0 does not.

40.

What is a priority if used for?

a)

Ensures mutually exclusive priority encoding — later conditions checked only if earlier ones false; suppresses uniqueness checking.

b)

Optimizes performance in simulation only

c)

Forces parallel evaluation of conditions

d)

Declares a sequence of concurrent statements

41.

Which keyword helps the simulator check that if/else if branches are mutually exclusive and flags an assertion if they are not?

a)

unique

b)

parallel

c)

exclusive

d)

priority

42.

Which of the following is TRUE about SystemVerilog function?

a)

A function can contain timing controls like # and @.

b)

A function must return a value (or be declared void) and cannot use timing controls.

c)

A function can return multiple values.

d)

A function call spawns a new thread.

43.

What does an automatic task or function do?

a)

Allocates local variables statically once for entire simulation.

b)

Runs in a separate process automatically.

c)

Prevents the use of fork inside the task.

d)

Allocates local variables per invocation (reentrant).

44.

Which SystemVerilog method of argument passing allows you to specify arguments by their parameter names in any order?

a)

By position

b)

By value only

c)

By reference

d)

By name (.arg(expr))

45.

If a task has prototype task t(int a, int b); which call uses positional argument passing?

a)

t(b:2, a:1);

b)

t(.b(2), .a(1));

c)

t(1, 2);

d)

t(.a(1), .b(2));

46.

In SystemVerilog, pass-by-position and pass-by-name differ how?

a)

They are identical.

b)

Position matches parameters by order; name matches parameters by explicit parameter names.

c)

Position passes by reference; name passes by value.

d)

Position uses .name() syntax; name uses order-only.

47.

Which statement about fork...join in SystemVerilog is TRUE?

a)

fork...join_none waits for the first child to finish.

b)

fork...join is equivalent to sequential execution.

c)

fork...join spawns parallel threads and join waits for all to complete.

d)

fork...join_any waits for none of the children to finish.

48.

What does fork ... join_none do?

a)

Waits for all children to complete.

b)

Immediately kills children.

c)

Waits for one child only.

d)

Returns immediately and does not wait for any child; children run concurrently.

49.

Which SystemVerilog construct groups signal declarations and procedural code to bundle ports — used for connecting modules?

a)

Interface

b)

Task

c)

Package

d)

Class

50.

What is a virtual interface in SystemVerilog?

a)

An interface that is synthesized differently.

b)

A purely simulation-only net type that cannot be used in UVM.

c)

A handle (class-like pointer) that allows classes to reference an interface instance at runtime.

d)

A special interface for virtual clocking only.

51.

Which of the following statements about class member access is true?

a)

public members are hidden from derived classes.

b)

local class members are visible outside the class.

c)

protected members are visible to the class and derived classes but not outside.

d)

There is no access protection in SystemVerilog classes.

52.

What does static mean when applied to a class variable?

a)

Each object gets its own copy.

b)

The variable is shared across all class instances (class-level).

c)

The variable is read-only.

d)

The variable is virtual.

53.

What does $cast do in SystemVerilog?

a)

Immediately converts integers to real numbers.

b)

Removes references to an object.

c)

Performs a safe dynamic cast between class handles, returning boolean success; can be used with if (!$cast(dest, src)) to test.

d)

Performs a static compile-time cast only.

54.

What is the scope resolution operator in SystemVerilog?

a)

::

b)

->

c)

.

d)

:

55.

Which of these is a correct use of typedef?

a)

typedef is not supported in SystemVerilog.

b)

typedef class { } MyClass;

c)

typedef int myint; — creates an alias myint for int.

d)

typedef myint int;

56.

What is randc?

a)

A compile-time constant.

b)

An alias for rand.

c)

A qualifier that randomizes cyclically through all legal values before repeating (pseudo-random cycle).

d)

A randomization method that produces the same value every call.

57.

Which randomize usage allows local constraints for that invocation only?

a)

randomize() with { ... } — the with clause supplies temporary constraints for that call.

b)

rand_mode()

c)

randomize() only

d)

randomize_local()

58.

Which keyword marks a class method as not tied to an instance (i.e., callable on the class itself)?

a)

static

b)

local

c)

automatic

d)

virtual

59.

What does the super keyword allow you to do in a derived class?

a)

Refer to the package-level class.

b)

Convert object to parent type.

c)

Access methods and fields of the parent class (call parent constructor or parent method).

d)

Access private members only.

60.

What is an external method in class context?

a)

A method declared in the class with extern and defined outside.

b)

Not supported in SystemVerilog.

c)

A method declared with import.

d)

A method that cannot access class members.

61.

Which SystemVerilog construct allows multiple processes to run concurrently inside a module or initial block?

a)

always only

b)

fork ... join

c)

begin ... end

d)

function only

62.

Which is a correct description of unique0 case?

a)

Errors if zero matches.

b)

Checks uniqueness and allows zero matches but errors on multiple matches.

c)

Not supported.

d)

Same as unique.

63.

How do you declare a typedef for an array type?

a)

typedef int my_arr_t[8];

b)

int typedef my_arr_t[8];

c)

typedefd int my_arr_t[8];

d)

Not allowed in SystemVerilog

64.

In SystemVerilog, what will be the outcome of the following code snippet?

a)

Runtime error — conflicting constraints cause failure

b)

id will be randomly chosen between 4 and 5

c)

Compilation error — constraints cannot be modified in a with-clause

d)

id will always be 4

65.

For constrained random fields, how do you temporarily add a constraint for a single randomize() call?

a)

obj.randomize_inside(x > 10);

b)

Not possible to add temporary constraints.

c)

obj.randomize() with { x > 10; }

d)

obj.randomize_local({x>10});

66.

How are pure virtual methods declared for tasks?

a)

Tasks cannot be virtual.

b)

pure virtual task mytask(); — analogous to functions, tasks can be declared pure virtual to force derived classes to implement them.

c)

task mytask() pure;

d)

Use virtual pure only for functions.

67.

What is the default value of an uninitialized wire in SystemVerilog?

a)

x (unknown)

b)

z (high impedance)

c)

0

d)

1

68.

Which of the following statements about wire is correct?

a)

Wire can store values between clock edges

b)

Wire can be assigned using always_ff blocks

c)

Wire represents combinational logic connections

d)

Wire supports procedural assignments

69.

What is the default size of a reg variable in SystemVerilog?

a)

32 bits

b)

1 bit

c)

16 bits

d)

8 bits

70.

Which statement about the logic data type is correct?

a)

Logic can only be used in continuous assignments

b)

Logic is deprecated in SystemVerilog

c)

Logic can only be used in procedural assignments

d)

Logic can be used in both continuous and procedural assignments

71.

What is the size of a shortint data type in SystemVerilog?

a)

8 bits

b)

32 bits

c)

64 bits

d)

16 bits

72.

What is the precision of shortreal data type?

a)

128-bit quad precision

b)

32-bit single precision

c)

16-bit half precision

d)

64-bit double precision

73.

Which statement about real data types is correct?

a)

Real variables can be used in sensitivity lists

b)

Real variables are 2-state variables

c)

Real variables are 4-state variables

d)

Real variables can store X and Z values

74.

How are strings stored internally in SystemVerilog?

a)

As unpacked arrays of characters

b)

As dynamic arrays of bytes

c)

As packed arrays of bits

d)

As fixed-size character arrays

75.

What happens when you assign a shorter string to a longer string variable?

a)

The string is truncated

b)

Compilation error occurs

c)

The string is padded with null characters

d)

The string variable resizes automatically

76.

When is the void data type typically used in SystemVerilog?

a)

For function return types that return nothing

b)

For parameter declarations

c)

For array indexing

d)

For variable declarations

77.

Which of the following is a valid use of void?

a)

void my_var;

b)

function void display_msg();

c)

parameter void PARAM = 5;

d)

void array[10];

78.

What is the default value of the first enumerated constant if not explicitly specified?

a)

1

b)

X

c)

Z

d)

0

79.

Which syntax correctly defines an enumerated type with typedef?

a)

typedef enum {RED, GREEN, BLUE} color_t;

b)

enum color_t {RED, GREEN, BLUE} typedef;

c)

enum typedef {RED, GREEN, BLUE} color_t;

d)

typedef {RED, GREEN, BLUE} enum color_t;

80.

How do you declare a dynamic array in SystemVerilog?

a)

int arr[];

b)

int arr[10];

c)

int arr[*];

d)

int arr[$];

81.

Which array type uses a hash table for storage?

a)

Dynamic array

b)

Associative array

c)

Fixed array

d)

Queue

82.

What symbol is used to declare a queue in SystemVerilog?

a)

[#]

b)

[]

c)

[*]

d)

[$]

83.

Which method adds an element to the front of a queue?

a)

insert()

b)

push_front()

c)

add()

d)

push_back()

84.

Which operator is used for non-blocking assignments?

a)

==

b)

<=

c)

=

d)

===

85.

When should non-blocking assignments be used?

a)

In sequential logic

b)

In function definitions

c)

In continuous assignments

d)

In combinational logic

86.

What is the difference between packed and unpacked structures?

a)

Packed structures use more memory

b)

Packed structures are slower

c)

There is no difference

d)

Packed structures are stored as contiguous bits

87.

Which keyword is used to create a packed structure?

a)

struct packed

b)

packed struct

c)

pack struct

d)

struct

88.

What is the key characteristic of a union in SystemVerilog?

a)

Members must be of the same data type

b)

All members have separate memory locations

c)

All members share the same memory location

d)

Members are accessed sequentially

89.

Which syntax correctly declares a union?

a)

union struct {int a; bit[31:0] b;} my_union;

b)

packed union {int a; bit[31:0] b;} my_union;

c)

struct union {int a; bit[31:0] b;} my_union;

d)

union {int a; bit[31:0] b;} my_union;

90.

Which loop construct is specifically designed for arrays and queues?

a)

do-while

b)

while

c)

foreach

d)

for

91.

What is the purpose of the 'initial' block in SystemVerilog?

a)

To create a testbench

b)

To initialize variables at simulation start

c)

To define a module

d)

To define a clock signal

92.

Which array method returns a new array with elements sorted in ascending order?

a)

sort()

b)

shuffle()

c)

reverse()

d)

rsort()

93.

The method rsort() in SystemVerilog is used to:

a)

Shuffle the array randomly

b)

Rotate the array by one position

c)

Sort the array in descending order

d)

Reverse the array in place

94.

Which method is used to randomize the order of array elements?

a)

reverse()

b)

sort()

c)

rsort()

d)

shuffle()

95.

If an array is [1, 2, 3, 4], what will reverse() return?

a)

[2, 1, 4, 3]

b)

[3, 4, 1, 2]

c)

[4, 3, 2, 1]

d)

[1, 2, 3, 4]

96.

Which ordering method modifies the array elements in place rather than returning a new array?

a)

rsort()

b)

All of the above

c)

sort()

d)

reverse()

97.

Given the enum: typedef enum {IDLE=2, RUN=5, STOP=9} state_t; state_t s = RUN; What will s.next() return?

a)

9

b)

2

c)

IDLE

d)

STOP

98.

Consider: typedef enum {RED=1, GREEN=2, BLUE=3} color_t; color_t c = RED; What is the result of $display("%0d", c.num());?

a)

2

b)

3

c)

1

d)

4

99.

If an enum is declared as: typedef enum {A=1, B=4, C=7} enum_t; What will enum_t.first() and enum_t.last() return?

a)

1 and 7

b)

B and C

c)

A and C

d)

Undefined

100.

Which string method returns the length of a string?

a)

size()

b)

find()

c)

substr()

d)

len()