|
Message
From: digitalhomesolutions at cox.net<digitalhomesolutions@c...>
Date: Thu Apr 19 09:22:49 CEST 2007
Subject: [oc] task/module in case statement
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
|
 |