Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

regarding task call in verilog

Status
Not open for further replies.

sumanthhv

Newbie level 4
Joined
Sep 9, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,322
dear forum members.

i've defined a task like this :

task my_task;
input x,y;
begin
$display("task my_task called")
wait(x)
if (~y)
begin
$display("both x and y must be high at all times");
$finish;
end
$display("normal exit");
endtask

in my main testbench i'm calling the task like this:

module my_tb;
.
.
.
.
always
begin
my_task(w,z)
end
.
.
initial
.
.
.
$finish;
.
.
.
endmodule

the simulator prints "task my_task called" once and exits via $finish in my_tb. But when i modified the task like this things worked as expected:

task my_task;
input x,y;
begin
$display("task my_task called")
wait(my_tb.w)
if (~my_tb.z)
begin
$display("both x and y must be high at all times");
$finish;
end
$display("normal exit");
endtask

this solution looks crude and clumsy to me. Why aren't parameters getting passed properly? i tried declaring the task as automatic, to no avail.

Thanks in advance,
Sumanth
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top