0
votes

I'm running automated testbenches with ghdl (0.32rc1). Some of my testbenches require unisim primitives from Xilinx ISE.

I have prepared two external files, if one would like to test my example. To run my example, you'll need a Xilinx ISE or Vivado installation, so you can find the MUXCY primitive. It's located in the folder <InstallDir>\ISE_DS\ISE\vhdl\src\unisims\primitive.

I analyzed the three files with the following ghdl commands:

PS D:\Temp\ghdl> C:\Tools\GHDL\0.32RC1\bin\ghdl.exe -a --work=work C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\primitive\MUXCY.vhd
PS D:\Temp\ghdl> C:\Tools\GHDL\0.32RC1\bin\ghdl.exe -a --work=poc .\arith_prefix_and.vhdl
PS D:\Temp\ghdl> C:\Tools\GHDL\0.32RC1\bin\ghdl.exe -a --work=test .\arith_prefix_and_tb.vhdl
.\arith_prefix_and_tb.vhdl:96:16:warning: universal integer bound must be numeric literal or attribute

So far no errors.
Now I started the simulation, which is just ghdl.exe -r on Windows (Linux: -e and -r):

PS D:\Temp\ghdl> C:\Tools\GHDL\0.32RC1\bin\ghdl.exe -r --work=test arith_prefix_and_tb
.\arith_prefix_and.vhdl:79:40:warning: 'mux' is not bound
.\arith_prefix_and.vhdl:43:14:warning: (in default configuration of arith_prefix_and(rtl))

Now ghdl reports that mux could not be bound.
I also tried the parameters --syn-binding and -P., but nothing changed.

What do I have to do to bind the MUXCY component?

P.S. Can someone create a 'ghdl' tag? I don't have enough reputation :)

1

1 Answers

2
votes

Here is how I would fix this:

First, analyze the MUXCY in the unisim library as it is intended to be, like so:

ghdl -a --work=unisim C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\primitive\MUXCY.vhd

Note the --work=unisim in that command.

Then, make sure you add library UNISIM; at the top of your arith_prefix_and.vhdl file.

That should do it.

What I think is happening here is that, since you are overwriting the name of the work library to poc with the --work=poc when analyzing arith_prefix_and.vhdl, it does not see the the MUXCY entity analyzed in the actual library named work, and so it cannot find a default entity to which to bind the MUXCY component.