【发布时间】: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。
【问题讨论】:
-
命令 (-s) 首先。 Invoking GHDL — GHDL 2017-03-01 documentation
-
是的,你是对的。
-
myentity.vhdl:19:28:error: 只有一种类型的逻辑运算符可以用于组合关系 使用
y <= not b and (c or a) and b;参见 IEEE Std 1076-2008 9. 表达式, 9.1 一般。 BNF 定义了关系中括号的语法要求 - shift_expression - simple_expression - term - factor - 涉及不同逻辑运算符的初级生产扩展。