1/1

|
task/module in case statement
by Unknown on Apr 19, 2007 |
Not available! | ||
|
A task can be called from case statement provided it should not have
initial, always or assign statements. A case statement can not have sub
module instance. Also function, task, always, initial, assign are at same
level in hierarchy, so putting one in another is syntax error.
cheers!!!
shreshtha kumar
On 4/19/07, digitalhomesolutions at cox.net digitalhomesolutions at cox.net>
wrote:
Is it possible to call up a module or task from within a case statement?
I'm using the following code and when I place the sub-module in the
case statement I get an error?
module controller_top(iclk, led);
input iclk;
output led;
reg clock_count;
always @(posedge iclk)
begin
case (clock_count)
0: begin
clock_count = clock_count + 1;
wb_write u1(iclk,led);
end
endcase
end
task wb_write;
input clk;
output q;
reg [19:0] COUNT;
initial
begin
COUNT=0;
end
assign q=COUNT[19];
always @(posedge clk)
begin
COUNT = COUNT + 1;
end
endtask
endmodule
_______________________________________________
http://www.opencores.org/mailman/listinfo/cores
--
shreshthakumar at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.opencores.org/forums.cgi/cores/attachments/20070419/611e11bc/attachment.htm
|
|||
|
task/module in case statement
by Unknown on Apr 19, 2007 |
Not available! | ||
|
Is it possible to call up a module or task from within a case statement?
I'm using the following code and when I place the sub-module in the case statement I get an error? module controller_top(iclk, led); input iclk; output led; reg clock_count; always @(posedge iclk) begin case (clock_count) 0: begin clock_count = clock_count + 1; wb_write u1(iclk,led); end endcase end task wb_write; input clk; output q; reg [19:0] COUNT; initial begin COUNT=0; end assign q=COUNT[19]; always @(posedge clk) begin COUNT = COUNT + 1; end endtask endmodule |
|||
1/1

