【问题标题】:GHDL, Precompile Vendor Primitives and CocotbGHDL、预编译供应商原语和 Cocotb
【发布时间】:2019-07-02 19:46:45
【问题描述】:

我有一个使用 Lattice Diamond 生成的 IP 模块的设计。这使用了作为供应商库的 diamond 附带的 Macxo3l 库。

使用 GHDL,我可以使用来自 https://ghdl.readthedocs.io/en/latest/building/PrecompileVendorPrimitives.html 的指令然后是命令来编译包括这个库的设计。

ghdl -i --ieee=synopsys -P=lattice/ --workdir=work cores/*.vhd
ghdl -i --workdir=work src/*.vhd

但是我无法使用 cocotb 进行编译。下面是我的make文件。我在哪里使用命令 VHDL_SOURCES_Lib,我在 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

编译它却给了我错误:

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

我能够使用 GHDL 运行 cocotb 示例。我应该如何指示 cocotb 包含 Vendor Primitive 文件。

感谢您提供的任何帮助。

【问题讨论】:

    标签: ghdl lattice-diamond cocotb


    【解决方案1】:

    我认为您应该按照文档所述在 VHDL_SOURCES_Lib 中添加确切的文件名:

    VHDL_SOURCES_lib

    要包含在 VHDL 库 lib 中的 VHDL 源文件列表(目前仅限 GHDL)。

    但是要添加预编译库,您必须将编译选项传递给 ghdl:-P=lattice/

    使用 COMPILE_ARGS 添加它:

    COMPILE_ARGS=-P=lattice/
    

    【讨论】:

    • 谢谢,将 COMPILE_ARGS 选项添加为 ''COMPILE_ARGS=--ieee=synopsys -P=$(WPWD)/../lattice/''' 有帮助。它现在似乎在编译文件,因为它打印了大量的调试信息,但随后似乎重新编译它们并失败了。与以前相同的错误。我会有另一场比赛,看看我可以更进一步。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多