The way I do to use unisims with ghdl:
Code:
Library UNISIM;
use UNISIM.vcomponents.all;
In project path I make a dir called unisim and then copy all files of vhdl/src/unisims in ISE install path in my case /opt/Xilinx92i/vhdl/src/unisims/ for 9.2i version and /opt/Xilinx/10.1/ISE/vhdl/src/unisims for 10.1.
Code:
mkdir unisim
cp /opt/Xilinx/10.1/ISE/vhdl/src/unisims/* unisim/
Then compile the unisim librarys with:
Code:
k@klap:~/vhdl$ ghdl -a --work=unisim --ieee=synopsys -fexplicit unisim/unisim_VCOMP.vhd
k@klap:~/vhdl$ ghdl -a --work=unisim --ieee=synopsys -fexplicit unisim/unisim_SMODEL.vhd
k@klap:~/vhdl$ ghdl -a --work=unisim --ieee=synopsys -fexplicit --warn-no-vital-generic unisim/unisim_VITAL.vhd
unisim/unisim_VITAL.vhd:150882:18:warning: universal integer bound must be numeric literal or attribute
unisim/unisim_VITAL.vhd:182323:57: variable "write_a_write_b" is not visible here
unisim/unisim_VITAL.vhd:182324:57: variable "read_a_write_b" is not visible here
unisim/unisim_VITAL.vhd:182325:57: variable "write_a_read_b" is not visible here
unisim/unisim_VITAL.vhd:182326:57: variable "write_b_write_a" is not visible here
unisim/unisim_VITAL.vhd:182327:57: variable "read_b_write_a" is not visible here
unisim/unisim_VITAL.vhd:182328:57: variable "write_b_read_a" is not visible here
/usr/lib/ghdl/bin/ghdl: compilation error
We need to comment the lines (182323,1823234, 182325, 182326, 182327, 182328) on file unisim_VITAL.vhd:
Code:
variable Write_A_Write_B : memory_collision_type := Write_A_Write_B;
variable Read_A_Write_B : memory_collision_type := Read_A_Write_B;
variable Write_A_Read_B : memory_collision_type := Write_A_Read_B;
variable Write_B_Write_A : memory_collision_type := Write_B_Write_A;
variable Read_B_Write_A : memory_collision_type := Read_B_Write_A;
variable Write_B_Read_A : memory_collision_type := Write_B_Read_A;
If we try to repeat the last command we are going to get the reference to others lines, then when we open the unisim_VITAL.vhd its more easy search for the line variable Write_A_Write_B: memory_collision_type:= etc. and comment this line and next 5.
On 9.2i version lines are (176564, 176565, 176566, 176567, 176568, 176569) and (188630,188631,188632, 188633, 188634, 188635).
Now you are going to be able to compile your project with:
Code:
ghdl -a --ieee=synopsys -Punisim -fexplicit
I think that is the same with simprims librarys that are in the same path that unisims.
I add a simple example of a RAM using unisims
I found the next url:
armadeus.com/wiki/index.php?title=How_to_simulate_post_synthesis_and_post_place_%26_route_design_with_GHDL