【问题标题】:Error when trying to specify VHDL standard in GHDL尝试在 GHDL 中指定 VHDL 标准时出错
【发布时间】:2017-08-04 21:39:43
【问题描述】:

GHDL 的新功能。这是我的 VHDL 代码:

/*
Name: test.vhd
Description: Demonstrates basic design in VHDL code.
Date: 04. August 2017 AD
*/

--first part: libraries
library IEEE;
use IEEE.STD_LOGIC_1164.all;

--second part: entity declaration
entity myEntity is
    port(a, b, c: in STD_LOGIC; y: out STD_LOGIC);
end;

--third part: entity implementation
architecture aom of myEntity is
begin
    y <= not b and (c or a and b);
end;

尝试使用 ghdl -s test.vhd 编译它会出现以下错误:test.vhd:1:1:error: block comment are not allowed before vhdl 2008

所以我试试这个:ghdl --std=08 -s test.vhd,我得到了这个:ghdl:error: unknown command '--std=08', try --help

【问题讨论】:

  • 是的,你是对的。
  • myentity.vhdl:19:28:error: 只有一种类型的逻辑运算符可以用于组合关系 使用 y &lt;= not b and (c or a) and b; 参见 IEEE Std 1076-2008 9. 表达式, 9.1 一般。 BNF 定义了关系中括号的语法要求 - shift_expression - simple_expression - term - factor - 涉及不同逻辑运算符的初级生产扩展。

标签: vhdl ghdl


【解决方案1】:

应该这样编译:ghdl -s --std=08 test.vhd。 所以,-s 标志应该首先出现。 所有学分都转到user1155120

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-15
    • 2022-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-12
    • 1970-01-01
    相关资源
    最近更新 更多