Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17249 Discussions

verilog task passing values

Altera_Forum
Honored Contributor II
4,739 Views

In verilog ,I have doubt while passing different values of one argument to task  

 

eg:- 

module sample_ref(input wire clkA, rstA ,SA, output wire d); 

 

initial 

begin 

repeat(6) 

@(posedge clkA)# 1; 

operation(rstA,SA); 

end 

 

task operation(input wire rst, s); 

begin 

if(rst) 

$display("@%0t test1",$time); 

else if(s) 

$display("@%0t test2",$time); 

end 

endtask 

endmodule 

 

 

// here when I try to pass values of variable SA to s inside the task at different times(not at initial time), it didn't enter in to the task. Please explain these..
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
2,992 Views

Without the other code that doesn't work, is impossible to comment on what might be wrong

0 Kudos
Altera_Forum
Honored Contributor II
2,992 Views

A task cannot have a wire as an argument

0 Kudos
Altera_Forum
Honored Contributor II
2,992 Views

An initial statement cannot have an always block.

0 Kudos
Altera_Forum
Honored Contributor II
2,992 Views

 

--- Quote Start ---  

An initial statement cannot have an always block. 

--- Quote End ---  

 

 

Where is there an always block?
0 Kudos
Altera_Forum
Honored Contributor II
2,992 Views

actually I'm verifying(using Verilog) a DUT by using reference model in that I have doubt on pass arguments to the task inside if else statement. 

 

 

initial 

begin 

repeat(6) 

@(posedge clkA)# 1; 

operation(rstA,SA); 

end 

 

task operation(input rst, s); 

begin 

if(rst) 

$display("@%0t test1",$time); 

else if(s) 

$display("@%0t test2",$time); 

end 

endtask 

 

 

here when I try to pass values of variable SA to s inside the task at different times(not at initial time), it didn't enter in to the task. Please explain these
0 Kudos
Altera_Forum
Honored Contributor II
2,992 Views

Instead of just repeating your question from the first post - how about showing us some code that exhibits the problems?

0 Kudos
Altera_Forum
Honored Contributor II
2,992 Views

I saw one at "always @(posedge clkA)". Or I thought I did, or I'm crazy...

0 Kudos
Reply