5871 - ERROR - <filepath filename="">(line_num): net <net_name> is constantly driven from multiple places at instance <instance_name>, on port <port_name></port_name></instance_name></net_name></filepath>. How to fix it?

5871 - ERROR - <filepath filename="">(line_num): net <net_name> is constantly driven from multiple places at instance <instance_name>, on port <port_name></port_name></instance_name></net_name></filepath>. How to fix it?

The error is caused by modifying a register on two or more different processes, with the first instance found on the line mentioned by the error message (line_num).

Sample Code:

module sample_multiple_instance(in1, in2, out1); input in1,in2; output out1;

reg samp_reg; assign out1 = samp_reg; always@(in1) begin samp_reg <= samp_reg-1; end always@(in2) begin samp_reg <= samp_reg+1;

end endmodule 

ERROR - .../sample.v(13): net out1 is constantly driven from multiple places at instance sub_3, on port o[0].

The register that is causing the error is "samp_reg" which being modified on two processes, the first of which is found on line 13.