1
\$\begingroup\$

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.

asked May 10, 2021 at 5:05
\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

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
answered May 10, 2021 at 5:11
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.