A
Andrew Mazin
Guest
Hi All,
I would like to use default values for unspecified verilog task arguments.
For example, I've created the task:
task my_task;
input a;
input b;
input c;
integer a, b;
......
endtask
While running this task, I am passing 2 (not 3!) arguments to it, such as:
my_task(1,2);
Verilog accepts this, assigning value "x" to c.
Then, I am trying to write something like:
task my_task;
input a;
input b;
input c;
integer a, b;
begin
if (c == 1'bx) c = 1;
......
endtask
in order to set default value for c, but this doesn't work.
Is there a way to set default value for unspecified verilog task argument?
Thanks,
-Andrew
I would like to use default values for unspecified verilog task arguments.
For example, I've created the task:
task my_task;
input a;
input b;
input c;
integer a, b;
......
endtask
While running this task, I am passing 2 (not 3!) arguments to it, such as:
my_task(1,2);
Verilog accepts this, assigning value "x" to c.
Then, I am trying to write something like:
task my_task;
input a;
input b;
input c;
integer a, b;
begin
if (c == 1'bx) c = 1;
......
endtask
in order to set default value for c, but this doesn't work.
Is there a way to set default value for unspecified verilog task argument?
Thanks,
-Andrew