in my SystemVerilog module, I want to have all inputs in one single array and all outputs in another array.
The assumption is that the number of input and outputs are the same, an the bus assignements are in the same order in the input/output list.
Background is, that I will generate the code automatically from a register/pin-list with several hundred named input/output pins.
I achieved the assignements in the below code.
Currently the output assignement only works with one assignement per output-pin/bus. What I actually want is an one-liner as indicated in the commented assignement (last line).
Any idea how to do this ?
module sv_multipincheck (in1, in2, inXY, out1, out2, outXY );
//The input and output definitions
input real in1, in2[3:0] , inXY;
output real out1, out2[4:1], outXY;
//creating the input array
real inArray [0:5];
assign inArray = {in1, in2[3:0], inXY};
//creating the output array
real outArray [0:5];
assign out1 = outArray[0];
assign out2 = outArray[1:4]; //reversed order !!!
assign outXY = outArray[5];
//assign [out1, out2, outZ] = '{outArray[0], outArray[1:4], outArray[5]} ; <-- this is what I actually want
...