Reputation: 21
I have a design where I use an IP module generated by Lattice Diamond. This uses the Macxo3l library which is shipped with diamond as a vendor library.
Using GHDL I can compile the design including this library using the instructions from https://ghdl.readthedocs.io/en/latest/building/PrecompileVendorPrimitives.html then the commands.
ghdl -i --ieee=synopsys -P=lattice/ --workdir=work cores/*.vhd
ghdl -i --workdir=work src/*.vhd
However I have been unable to make this compile using cocotb. Below is my make file. Where I use the command VHDL_SOURCES_Lib which I found reference to at https://cocotb.readthedocs.io/en/latest/building.html
TOPLEVEL_LANG ?= vhdl
PWD=$(shell pwd)
ifeq ($(OS),Msys)
WPWD=$(shell sh -c 'pwd -W')
PYTHONPATH := $(WPWD)/../model;$(PYTHONPATH)
else
WPWD=$(shell pwd)
PYTHONPATH := $(WPWD)/../model:$(PYTHONPATH)
endif
VHDL_SOURCES_Lib = $(WPWD)/../lattice/
VHDL_SOURCES = $(WPWD)/../cores/Adder.vhd $(WPWD)/../cores/Counter.vhd $(WPWD)/../cores/Multiplyer.vhd $(WPWD)/../cores/SinCos.vhd $(WPWD)/../src/top.vhd
TOPLEVEL := top
MODULE := test_of_top
include $(shell cocotb-config --makefiles)/Makefile.inc
include $(shell cocotb-config --makefiles)/Makefile.sim
Compiling this however gives me the error:
make results.xml
make[1]: Entering directory '/HDL/cocotbTest'
make[1]: *** No rule to make target '/HDL/cocotbTest/../cores/Adder.vhd', needed by 'analyse'. Stop.
make[1]: Leaving directory '/HDL/cocotbTest'
/home/anaconda3/lib/python3.6/site-packages/cocotb/share/makefiles/Makefile.sim:84: recipe for target 'sim' failed
make: *** [sim] Error 2
I am able to run the cocotb examples using GHDL. How should I instruct cocotb to include the Vendor Primitive files.
Thank you for any help you can provide.
Upvotes: 2
Views: 867
Reputation: 3751
I think you should add the exact filenames in VHDL_SOURCES_Lib as documentation said :
VHDL_SOURCES_lib
A list of the VHDL source files to include in the VHDL library lib (currently GHDL only).
But to add precompiled library as you show, you have to pass a compile option to ghdl : -P=lattice/
Use COMPILE_ARGS to add it:
COMPILE_ARGS=-P=lattice/
Upvotes: 1