I got
reg OUT; cannot be driven by primitives or continuous assignment.
error.
The Counter module is:
module Counter(
input clk,
input clear,
input load,
input up_down, // UP/~DOWN
input[3:0] IN,
input count,
output reg[3:0] OUT
);
always @(posedge clk, negedge clear)
if (~clear) OUT <= 4'b0000;
else if(load) OUT <= IN;
else if(count)
begin
if(up_down) OUT <= OUT + 1'b1;
else OUT <= OUT - 1'b1;
end
else OUT <= OUT;
endmodule
And the testbench is:
module test;
.
.
.
reg [3:0] IN;
reg [3:0] OUT;
Counter c1(clk, clear, load, up_down, IN, count, OUT);
endmodule
The error is in the Counter c1(clk, clear, load, up_down, IN, count, OUT); line.