Altera_Forum
Honored Contributor
13 years agoWhy the task cannot be synthesisd?
I just try to use a task to improve the programming efficiency. The code is as following:
task TwoNumberMin; input [RamWidth-1:0] a,b; input clk; output [RamWidth-1:0] min; always @(posedge clk) begin if (a>b) min<=b; else min<=a; end endtask TwoNumberMin(.a(noiseCeil),.b(LPF_out_1d),.clk(clk),.min(modifiedValue)); But there is always error "Error (10170): Verilog HDL syntax error near text "always"; expecting ";" I can't understand this message. The commands inside the task are all synthesisd, but why my code can not be synthesisd? Please help me, thanks!