没有方向的实体端口声明:为什么允许,我在这里创建了什么?
Entity port declaration without direction: Why is it allowed and what did I create here?
我只需要检查旧模块中的某些内容并找到以下实体声明:
entity myOldModule is
port
(
clk: in std_logic;
reset: in std_logic;
data: in std_logic;
valid: std_logic;
...
);
end myOldModule;
注意有效端口声明中缺少的 in
。它在更高级别模块的组件声明中也丢失了。但是它确实按预期编译和运行。所以我的问题是:
a) 为什么 VHDL 语法允许这样做?我认为端口列表语法是:port_name: mode data_type;
b) 该语句创建的等效结构是什么?端口是否默认为 in
?我猜,非顶层实体端口只是变平为常规信号,但如果方法不正确,则在 VHDL 中什么也做不了。那么这里发生了什么?
使用 LatticeDiamond 12.3 或 ModelSim 2020.3 并使用 VHDL2002 进行编译,并且从未抱怨过(至少没有错误)。
如第 6.5.2 章中的one source (VHDL 2000) of the standard says in chapter 4.3.2, or another source (VHDL 2008):
If no mode is explicitly given in an interface declaration other than an interface file declaration, mode in
is assumed.
我只需要检查旧模块中的某些内容并找到以下实体声明:
entity myOldModule is
port
(
clk: in std_logic;
reset: in std_logic;
data: in std_logic;
valid: std_logic;
...
);
end myOldModule;
注意有效端口声明中缺少的 in
。它在更高级别模块的组件声明中也丢失了。但是它确实按预期编译和运行。所以我的问题是:
a) 为什么 VHDL 语法允许这样做?我认为端口列表语法是:port_name: mode data_type;
b) 该语句创建的等效结构是什么?端口是否默认为 in
?我猜,非顶层实体端口只是变平为常规信号,但如果方法不正确,则在 VHDL 中什么也做不了。那么这里发生了什么?
使用 LatticeDiamond 12.3 或 ModelSim 2020.3 并使用 VHDL2002 进行编译,并且从未抱怨过(至少没有错误)。
如第 6.5.2 章中的one source (VHDL 2000) of the standard says in chapter 4.3.2, or another source (VHDL 2008):
If no mode is explicitly given in an interface declaration other than an interface file declaration, mode
in
is assumed.