I am trying to define a module, but SystemVerilog thinks that my "works" is 3 bits. Does having that logic right after a 3-bit vector of "In" affect it? I am trying to connect to a test bench that instantiates this module but keep getting a port width mismatch. I put the error messages below (The message is from when I tried to do .In(In) etc.).
Module header:
module random
(input logic [2:0] In, works,
output logic [7:0] Out);
Test header:
module random_test;
logic [2:0] In;
logic works;
logic [7:0] Out;
random r(.In, .works, .Out);
Error:
Warning-[PCWM-W] Port connection width mismatch
tests.sv, 8
"random r( .In (In), .works (works), .Out (Out));"
The following 1-bit expression is connected to 3-bit port "works" of module
"random", instance "r".
Expression: works
Instantiated module defined at: "random.sv", 4
Use +lint=PCWM for more details.
Warning-[PCWM-W] Port connection width mismatch
tests.sv, 8
"random r( .In (In), .works (works), .Out (Out));"
The following 8-bit expression is connected to 1-bit port "Out" of module
"random", instance "r".
Expression: Out
Instantiated module defined at: "random.sv", 4
Use +lint=PCWM for more details.