0

I have a code in VHDL which requires an array of elements as generic. COEF_LIST : coef :=(0,0,1,1,2,-2,1,-2,1)

How do I send new set of COEF_LIST from my system verilog testbench to VHDL entity?

Generic in VHDL is same as parameter in verilog.

I declared coef as

  parameter  real COEFF[8:0] = '{0,0,1,1,2,-2,1,-2,1}; 

in system verilog.

I tried passing using (in my verilog testbench)

 vhdl_entity  #(
                 .COEF_LIST(COEFF)
               )

I get the following error

                 **.COEF_LIST(COEFF)
                                |

ncelab: *E,CFIGTC (./vhdl_entity_tb.vams,41|36): VHDL generic vhdl_entity.COEF_LIST (../views/rtl/vhdl_entity.vhd: line 34, position 14) type is not compatible with Verilog. irun: E,ELBERR: Error during elaboration (status 1), exiting.*

This doesn't work. How do I make it compatible with VHDL? I am using incisiv 13.20.008 version

Could anyone please suggest what to do?

3
  • Can you give more details of what goes wrong? (Preferably by editing your post) Commented Jun 3, 2014 at 22:16
  • Try simplifying the problem by setting a default argument on the VHDL entity to see if that works. You have declared as an array of real but the VHDL elaborator may be seeing the array as a list of integers. See what happens when you add decimal points to the numbers. Commented Jun 4, 2014 at 4:24
  • Post the declaration of the VHDL entity (just the generic would be enough, no ports) to better show what's going on. Commented Jun 4, 2014 at 7:56

1 Answer 1

2

Seems like you declared your COEF_LIST as an array of integers in VHDL, whereas you are trying to pass an array of reals from SystemVerilog. Try changing to:

parameter int COEFF[8:0] = '{0,0,1,1,2,-2,1,-2,1};
Sign up to request clarification or add additional context in comments.

2 Comments

Assuming COEF_LIST : coef :=(0,0,1,1,2,-2,1,-2,1) is a generic declaration in a generic interface list, the type declaration for coef is not knowable from the information present. Your answer works only if the array type coef has a base type of integer and incisiv provides implicit type conversion. This seems like a type incompatibility issue between two language domains requiring fixes in both domains.
@DavidKoontz Hence the "seems like" in the answer and not "because".

Your Answer

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.