首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用GHDL模拟器模拟测试平台时,组件实例“uut未绑定”

使用GHDL模拟器模拟测试平台时,组件实例“uut未绑定”
EN

Stack Overflow用户
提问于 2016-07-21 19:18:43
回答 1查看 15.3K关注 0票数 4

我在使用硬件描述语言(http://ghdl.readthedocs.io/en/latest/)来模拟我的VHDL设计时遇到了问题。所以,当我使用GHDL命令ghdl -e Averager_tb编译测试平台时,我得到了警告:

代码语言:javascript
运行
复制
Averager_tb.VHD:33:3:warning: component instance "uut" is not bound
Averager_tb.VHD:11:14:warning: (in default configuration of averager_tb(behaviour))

为了编译用于模拟的测试平台,我使用以下命令:

代码语言:javascript
运行
复制
ghdl -a Averager_tb.VHD # the test bench file is Averager_tb.VHD
ghdl -e Averager_tb # the entity for the test bench is Averager_tb

并且我的设计的输出在整个测试平台中保持不变,我还发现design中的print语句没有执行。

要执行编译后的测试台模拟,我使用以下命令:

代码语言:javascript
运行
复制
ghdl -r Averager_tb

但是,当我使用Aldec Riviera Pro 2015.06模拟器在http://www.edaplayground.com上模拟相同的测试平台时,我发现设计中的打印语句被执行了,并且输出如我预期的那样发生了变化。

为什么会这样?我该如何修复它?

下面是我的设计中的实体声明

代码语言:javascript
运行
复制
-- Entity Declaration in Design
entity Averager is
port (
clk : in std_logic;
ClockEnable : in std_logic;
Averager_In : in std_logic_vector(7 downto 0);
Averager_Out : out std_logic_vector(7 downto 0)
);
end Averager;

下面是测试平台:

代码语言:javascript
运行
复制
-- TEST BENCH

architecture behaviour of Averager_tb is
  signal X : real := 0.0; -- a real math variable initialized to 0
  signal sine : real := 0.0; -- a real math variable initialized to 0

  component Averager
  port(
    clk : in std_logic;
    ClockEnable : in std_logic;
    Averager_In : in std_logic_vector(7 downto 0);
    Averager_Out : out std_logic_vector(7 downto 0)
    );
  end component;

  signal clk : std_logic := '0';
  signal ADC_clk : std_logic := '0';
  signal Input : std_logic_vector(7 downto 0);
  signal FPGAOutput : std_logic_vector(7 downto 0);
  signal int_sine : integer;
  constant clk_period : time := 5 ns;

begin
    -- Instantiate the Unit Under Test (UUT)
  UUT : Averager
  port map (
    clk => clk,
    ClockEnable => ADC_clk,
    Averager_In => Input,
    Averager_Out => FPGAOutput
  );

  ...
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-07-21 19:49:00

弄清楚了,这是一个愚蠢的错误,我忘了编译设计和测试台。解决方案是像这样编译和运行:

代码语言:javascript
运行
复制
ghdl -a Averager_Bettertb.VHD
ghdl -a Averager.VHD
ghdl -e Averager_tb
ghdl -r Averager_tb #--stop-time=10us
票数 9
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38502857

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档