I am working on a project and have encountered a problem with one of my modules. I am trying to add offsets to 11 bits input from another model and output them to vga controller. My inputs are declared like so -
input logic signed Player_TLX [10:0], //Current Player Top Left X pos
input logic signed Player_TLY [10:0], //Current Player Top Left Y pos
and the calculation I am trying to do are -
if (Fire && !In_Air) begin //Projectile Launch
topLeftY_FixedPoint <= (Player_TLY + Player_Height)*FIXED_POINT_MULTIPLIER ;
topLeftX_FixedPoint <= Player_TLX + Player_Half_Width ;
In_Air <= TRUE ;
Enemy_Hit <= FALSE;
end
Where player height, width and the multiplier are constants. This lines give me the error -
Error (10686): SystemVerilog error at Projectile_moveCollision.sv(65): Player_TLY has an aggregate value
Error (10686): SystemVerilog error at Projectile_moveCollision.sv(66): Player_TLX has an aggregate value
I have tried using local parameters for the calculations but got similar error , is there a way to make such calculations? am I using the wrong data type for this? help would be appreciated.
1 Answer 1
You have the ranges in the declaration in the wrong place. You had an unpacked array of 11 single bits (an aggregate). You want a packed array of 11-bits (an integral)
input logic signed [10:0] Player_TLX, //Current Player Top Left X pos
input logic signed [10:0] Player_TLY, //Current Player Top Left Y pos