gpt4 book ai didi

floating-point - 如何将 vhdl 定点库包含到 ghdl-0.33?

转载 作者:行者123 更新时间:2023-12-04 03:10:33 26 4
gpt4 key购买 nike

我是 ghdl 模拟器的新手,在 Windows 上使用 ghdl。我在我的电脑上安装了 ghdl (ghdl-0.33-win32) 并尝试了简单的加法器代码并且它有效。我目前需要模拟一些我使用过 David Bishop 的定点和浮点包的数学方程式。当我将库包含到我的库中并编译它时,它会出现错误:

"fixed_pkg" not found in library "ieee"

或者如果我将 fixed_pkg_c 文件复制到我的项目文件中进行编译:

"fixed_pkg" not found in library "work"

谁能告诉我包含这些固定和 float 包的方法(或我应该遵循的命令集)?

最佳答案

A ghdl-0.33-win32安装为 VHDL 标准的 IEEE 1076-2008 修订版提供部分支持。

此支持包括 David Bishop 的定点和浮点综合合格库,这些库包含在该修订版中(请参阅 IEEE 标准 1076-2008,16。预定义语言环境,16.10 定点包和 16.11 浮点包)。作为该修订版中接受的 IEEE 包,它们可以在 IEEE 库中找到。

ghdl 支持的默认版本是 93c(-1993 支持范围索引中的混合文字和表达式边界,该标准的后续版本支持)。

使用 -2008 修订合规性调用 ghdl 是通过使用 --std=08 选项分析 (-a) 和详细说明 (-e) 命令来完成的。

发现使用 mcode(即时代码)即时代码生成版本的 ghdl(例如 Win32 发行版)有一个区别:

来自最新GHDL Documentation关于 Invoking GHDL 的部分对于运行命令:

run -r

Runs/simulates a design. The options and arguments are the same as for the elaboration command.

  • GGC/LLVM: simply, the filename of the executable is determined and it is executed. Options are ignored. You may also directly execute the program. The executable must be in the current directory.
  • mcode: the design is elaborated and the simulation is launched. As a consequence, you must use the same options used during analysis.

在诸如为 Win32 分发的 mcode 版本中,-e 详细命令是多余的,运行命令 (-r) 必须包含与分析命令 (-a) 相同的选项。

与 GCC 或 LLVM 版本的 ghdl 不同,mcode 版本需要为运行命令提供详细说明的任何相关选项。

对于 GCC 或 LLVM ghdl 实现以及 VHDL 文件和实体,用于分析、阐述和模拟在文件中找到的实体的命令是:

ghdl -a --std=08 vhdl_file_name
ghdl -e --std=08 entity_name
ghdl -r entity_name

用于模拟的运行命令 (-r) 还允许选择多个架构之一或已声明的配置。

对于 ghdl 的 mcode 版本,细化命令被忽略,既没有来自分析的目标代码文件,也没有生成单独的可执行文件,但有一个库文件(对于名为 work 的工作库,对于 -2008,这将被命名为默认为work-obj08.cf)用于协调标准要求的分析顺序。

对于 ghdl 的 mcode 版本,最少的命令是:

ghdl -a --std=08 vhdl_file_name
ghdl -r --std=08 entity_name

如果详细说明命令是多余的,则必须将使用运行命令进行仿真之前的详细说明以及与分析命令共享的任何有效详细说明选项传递给运行命令。

要使用 --std=08 访问 IEEE -2008 库中的 fixed_pkg 包,您的实体或架构必须在上下文子句的范围内,使 fixed_pkg 中的声明可见:

library ieee;
use ieee.fixed_pkg.all;

use 子句使 fixed_pkg 中的声明可见。

Tristan 刚刚发布 ghdl-0.34目前包括 win32 mcode 版本 (mingw32) 和 64 位 LLVM 版本 (mingw64)。配套GHDL Documentation在颜色条突出显示的段落中提供有用的提示。

因为 ghdl 是开源的,所以它在很大程度上取决于用户反馈来纠正操作和文档中的差异。

差异可以报告为 issue (需要 github 登录)。反射(reflect) ghdl 文档中不够清晰的问题可能会导致改进。

GTKWave,一个支持GHDL 波形格式的波形查看器可以从Sourceforge 获得。 . ghdl 还支持 gtkwave 使用的 VCD 和 FST 波形转储文件格式。

关于floating-point - 如何将 vhdl 定点库包含到 ghdl-0.33?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45643593/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com