In the below Verilog Code, I want to assign my outputs into two modules namely two_input_checker and three_input_checker. But when I assigned them directly as shown as below, it gives a error.
module logical_function_check (
IN1, IN2, IN3, IN4, IN5, IN6,
IN8, IN9, IN10, IN11, IN12, IN13,
OP1, OP2, OP3, OP4, OP5, OP6,
OP8, OP9, OP10, OP11, OP12, OP13,
pass1, pass2, pass3, pass4, pass5, pass6,
fail1, fail2, fail3, fail4, fail5, fail6,
pass, fail,
clk
);
input OP1, OP2, OP3, OP4, OP5, OP6, OP8, OP9, OP10, OP11, OP12, OP13;
output IN1, IN2, IN3, IN4, IN5, IN6, IN8, IN9, IN10, IN11, IN12, IN13;
output pass1, pass2, pass3, pass4, pass5, pass6, fail1, fail2, fail3, fail4, fail5, fail6;
output pass, fail;
input clk;
two_input_checker two_input_checker_inst(
.A1(IN1),
.A2(IN4),
.A3(IN10),
.A4(IN13),
.B1(IN2),
.B2(IN5),
.B3(IN9),
.B4(IN12),
.op1(OP3),
.op2(OP6),
.op3(OP8),
.op4(OP11),
.pass1(pass1),
.pass2(pass2),
.pass3(pass3),
.pass4(pass4),
.fail1(fail1),
.fail2(fail2),
.fail3(fail3),
.fail4(fail4),
.pass(pass),
.fail(fail),
.clk(clk),
.enable(1'b1)
);
three_input_checker three_input_checker_inst (
.A1(IN1),
.A2(IN3),
.A3(IN11),
.B1(IN2),
.B2(IN4),
.B3(IN10),
.C1(IN13),
.C2(IN5),
.C3(IN9),
.op1(OP12),
.op2(OP6),
.op3(OP8),
.pass1(pass1),
.pass2(pass2),
.pass3(pass3),
.fail1(fail1),
.fail2(fail2),
.fail3(fail3),
.pass(pass),
.fail(fail),
.clk(clk),
.enable(1'b0)
);
endmodule
The error is shown below.
How can I fix that error and assign the outputs? Or are there any other method to do that?
I am assuming here that you are assigning one signal to two output ports. You need to use different signals for the two modules' outputs and then OR these signals. Signals cannot be driven from multiple drivers. Example for signal pass1: