2016-10-25 51 views
1

我正在构建一个VGA输出块,它使用提供类似接口来构建图片的嵌套元素。然后configuration确定实际的屏幕布局。在嵌套配置中找不到架构名称

到目前为止,我已经为每个块创建了一个配置,但我真的想使用单个嵌套配置。这是允许在BNF,我发现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表示,预计这个宝会有一个不合格的(架构)名称INT。这里缺少什么?

回答

1

一些修改(添加和移动你的组件声明的架构声明部分):

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问题后,我又看看这个问题,你的评论:

嗯,我有分量的定义生活在一个包,因为我需要在多个地方。否则,最大的区别是实体源和它的未使用体系结构 - 即使我不打算使用它,我是否总是需要定义一个与组件名称相同的实体? - 西蒙里克特年10月26 '16在2:05

我修饰组件声明上述代码的封装,vgasource,删除源实体和架构:

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; 

这也分析,阐述和运行(而无所作为)。

这表明组件声明可以代替资源库的工作看得见的实体声明中使用,

还演示了不使用被忽略组件声明(由使用条款可见)。

,你仍然收到错误ID: 10392意味着架构syntestpattern并没有同时在配置声明conf得到阐述类型进行分析。

随着清空工作库的另一个VHDL工具提供了类似的消息,如果syn架构被注释掉 -

ghdl -e的conf
在/ usr/local/bin目录/ ghdl1-LLVM:找不到架构“SYN”实体“的testpattern”

这是什么归结为是有没有在图书馆工作发现实体testpattern架构syn当配置conf了阐述和ELA boration失败。

您可以注意到设计单位按照分析顺序显示在上面(用“----...”分隔)。

+0

嗯,我有'组件定义生活在一个包中,因为我需要在多个地方。否则,最大的区别是“实体源”和未使用的“体系结构” - 我是否总是需要定义一个与“组件”同名的“实体”,即使我不打算使用它? –

+0

您的问题中的代码示例不是[MCVE](http://stackoverflow.com/help/mcve),似乎没有重现该问题。我无法推断您的语境条款,也无法猜测“...”中的内容。所做的更改允许所有实体/体系结构对进行分析,之后配置声明的工作不变。检查抽象模型和实际设计之间的差异。没有使用的组件声明无关紧要(只要它们在语法和语义上都是正确的)。 – user1155120

相关问题