在嵌套配置中找不到体系结构名称
Cannot find architecture name in nested configuration
我正在构建一个 VGA 输出块,它使用提供类似界面的嵌套元素来构建图片。 configuration
然后确定实际的屏幕布局。
到目前为止,我已经为每个块创建了一个配置,但我真的很想使用一个嵌套的配置。在使用它的 BNF, and I've found example code 中是允许的,但我无法编译我的代码。
里面work
有
entity everything is
...
end entity;
architecture syn of everything is
...
begin
gfx : vga;
end architecture;
component source is
...
end component;
entity vga is
...
end entity;
architecture syn of vga is
...
begin
src : source;
end architecture;
entity testpattern is
...
end entity;
architecture syn of testpattern is
...
end entity;
现在我想使用 configuration
:
将所有这些放在一起
configuration conf of everything is
for syn
for gfx : vga
use entity work.vga(syn);
for syn -- Error reported here
for src : source
use entity work.testpattern(syn);
end for;
end for;
end for;
end for;
end configuration;
我从 Quartus 收到一条错误消息
Error (10392): VHDL Block Specification error at everything.vhd(106): cannot find "syn"
BNF 表示此时需要一个不合格的(架构)名称。这里缺少什么?
一些修改(添加,并将您的组件声明移动到架构声明部分):
entity source is
end entity;
architecture foo of source is
begin
end architecture;
entity vga is
end entity;
architecture syn of vga is
component source is
end component;
begin
src : source;
end architecture;
entity everything is
end entity;
architecture syn of everything is
component vga is
end component;
begin
gfx : vga;
end architecture;
entity testpattern is
end entity;
architecture syn of testpattern is
begin
end architecture;
configuration conf of everything is
for syn
for gfx : vga
use entity work.vga(syn);
for syn -- Error reported here
for src : source
use entity work.testpattern(syn);
end for;
end for;
end for;
end for;
end configuration;
并且您的代码分析、阐述和模拟(同时什么都不做)。
%% ghdl -a richter.vhdl
%% ghdl -e conf
%% ghdl -r conf
%%
为源添加了实体和体系结构。
vga 的组件声明。
将源的组件声明移动到 vga 的体系结构 syn。
摆脱所有烦人的“...”。
您可能需要 testpattern 的配置,它使用所有内容的配置 conf 来让您的 testbench(如果 testpattern 是一个测试台)进行详细说明和 运行。在这里展示这一点还为时过早。
附录
今天看到你回答一个VHDL问题后,我又看了看这个问题和你的评论:
Hm, I have the component definition living in a package, because I need that in multiple places. The largest difference otherwise would be the entity source and the unused architecture for it -- do I always need to define an entity with the same name as a component, even if I'm not going to use it? – Simon Richter Oct 26 '16 at 2:05
我在 vga
和 source
的包中用组件声明修改了上面的代码,删除了源的实体和架构:
package components_pkg is
component vga is
end component;
component source is
end component;
end package;
---------------------------------------
use work.components_pkg.all;
entity vga is
end entity;
architecture syn of vga is
begin
src : source;
end architecture;
---------------------------------------
use work.components_pkg.all;
entity everything is
end entity;
architecture syn of everything is
begin
gfx : vga;
end architecture;
---------------------------------------
entity testpattern is
end entity;
architecture syn of testpattern is
begin
end architecture;
---------------------------------------
configuration conf of everything is
for syn
for gfx : vga
use entity work.vga(syn);
for syn -- Error reported here
for src : source
use entity work.testpattern(syn);
end for;
end for;
end for;
end for;
end configuration;
这也分析、阐述和运行s(什么都不做)。
这表明可以使用组件声明代替资源库工作中可见的实体声明,
还演示了未使用的组件声明被忽略(通过 use 子句可见)。
您仍然收到错误 ID: 10392,这意味着 testpattern
的架构 syn
并未在详细说明配置声明 conf
的类型上进行分析。
如果 syn
架构被注释掉,另一个 VHDL 工具会在清空工作库时给出类似的消息 -
ghdl -e conf
/usr/local/bin/ghdl1-llvm: cannot find architecture "syn" of entity "testpattern"
这归结为当详细说明配置 conf
并且详细说明失败时,在实体 testpattern
的库工作中没有找到架构 syn
。
您可能会注意到设计单位按分析顺序显示在上面(由“----...”分隔)。
我正在构建一个 VGA 输出块,它使用提供类似界面的嵌套元素来构建图片。 configuration
然后确定实际的屏幕布局。
到目前为止,我已经为每个块创建了一个配置,但我真的很想使用一个嵌套的配置。在使用它的 BNF, and I've found example code 中是允许的,但我无法编译我的代码。
里面work
有
entity everything is
...
end entity;
architecture syn of everything is
...
begin
gfx : vga;
end architecture;
component source is
...
end component;
entity vga is
...
end entity;
architecture syn of vga is
...
begin
src : source;
end architecture;
entity testpattern is
...
end entity;
architecture syn of testpattern is
...
end entity;
现在我想使用 configuration
:
configuration conf of everything is
for syn
for gfx : vga
use entity work.vga(syn);
for syn -- Error reported here
for src : source
use entity work.testpattern(syn);
end for;
end for;
end for;
end for;
end configuration;
我从 Quartus 收到一条错误消息
Error (10392): VHDL Block Specification error at everything.vhd(106): cannot find "syn"
BNF 表示此时需要一个不合格的(架构)名称。这里缺少什么?
一些修改(添加,并将您的组件声明移动到架构声明部分):
entity source is
end entity;
architecture foo of source is
begin
end architecture;
entity vga is
end entity;
architecture syn of vga is
component source is
end component;
begin
src : source;
end architecture;
entity everything is
end entity;
architecture syn of everything is
component vga is
end component;
begin
gfx : vga;
end architecture;
entity testpattern is
end entity;
architecture syn of testpattern is
begin
end architecture;
configuration conf of everything is
for syn
for gfx : vga
use entity work.vga(syn);
for syn -- Error reported here
for src : source
use entity work.testpattern(syn);
end for;
end for;
end for;
end for;
end configuration;
并且您的代码分析、阐述和模拟(同时什么都不做)。
%% ghdl -a richter.vhdl
%% ghdl -e conf
%% ghdl -r conf
%%
为源添加了实体和体系结构。 vga 的组件声明。 将源的组件声明移动到 vga 的体系结构 syn。 摆脱所有烦人的“...”。
您可能需要 testpattern 的配置,它使用所有内容的配置 conf 来让您的 testbench(如果 testpattern 是一个测试台)进行详细说明和 运行。在这里展示这一点还为时过早。
附录
今天看到你回答一个VHDL问题后,我又看了看这个问题和你的评论:
Hm, I have the component definition living in a package, because I need that in multiple places. The largest difference otherwise would be the entity source and the unused architecture for it -- do I always need to define an entity with the same name as a component, even if I'm not going to use it? – Simon Richter Oct 26 '16 at 2:05
我在 vga
和 source
的包中用组件声明修改了上面的代码,删除了源的实体和架构:
package components_pkg is
component vga is
end component;
component source is
end component;
end package;
---------------------------------------
use work.components_pkg.all;
entity vga is
end entity;
architecture syn of vga is
begin
src : source;
end architecture;
---------------------------------------
use work.components_pkg.all;
entity everything is
end entity;
architecture syn of everything is
begin
gfx : vga;
end architecture;
---------------------------------------
entity testpattern is
end entity;
architecture syn of testpattern is
begin
end architecture;
---------------------------------------
configuration conf of everything is
for syn
for gfx : vga
use entity work.vga(syn);
for syn -- Error reported here
for src : source
use entity work.testpattern(syn);
end for;
end for;
end for;
end for;
end configuration;
这也分析、阐述和运行s(什么都不做)。
这表明可以使用组件声明代替资源库工作中可见的实体声明,
还演示了未使用的组件声明被忽略(通过 use 子句可见)。
您仍然收到错误 ID: 10392,这意味着 testpattern
的架构 syn
并未在详细说明配置声明 conf
的类型上进行分析。
如果 syn
架构被注释掉,另一个 VHDL 工具会在清空工作库时给出类似的消息 -
ghdl -e conf
/usr/local/bin/ghdl1-llvm: cannot find architecture "syn" of entity "testpattern"
这归结为当详细说明配置 conf
并且详细说明失败时,在实体 testpattern
的库工作中没有找到架构 syn
。
您可能会注意到设计单位按分析顺序显示在上面(由“----...”分隔)。