- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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..Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without the other code that doesn't work, is impossible to comment on what might be wrong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A task cannot have a wire as an argument
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
An initial statement cannot have an always block.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- An initial statement cannot have an always block. --- Quote End --- Where is there an always block?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Instead of just repeating your question from the first post - how about showing us some code that exhibits the problems?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I saw one at "always @(posedge clkA)". Or I thought I did, or I'm crazy...

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page