VHDL 编写 testbench

[复制链接]
2294|9
 楼主| cuianbin 发表于 2013-1-23 15:26 | 显示全部楼层 |阅读模式
本帖最后由 cuianbin 于 2013-1-23 15:30 编辑

最近在用DSPbuilder  想对生成的VHDL 代码进行Modelsim仿真,无奈以前用的是Verilog 现在转到VHDL 上来 有些不适应,关于Testbench 的问题 请教大家:
LIBRARY ieee  ;
USE ieee.numeric_std.all  ;
USE ieee.std_logic_1164.all  ;
ENTITY sinwave_gn_tb  IS
END ;

ARCHITECTURE sinwave_gn_tb_arch OF sinwave_gn_tb IS
   COMPONENT sinwave_gn  
    PORT (
      clock  : in std_logic ;
      output  : out std_logic_vector (7 downto 0) ;
      aclr  : in std_logic ;
      sinctrl  : in std_logic );
  END COMPONENT ;

  SIGNAL clock   :  std_logic := '0'  ;
  SIGNAL output   :  std_logic_vector (7 downto 0)  ;
  SIGNAL aclr   :  std_logic := '0'  ;
  SIGNAL sinctrl   :  std_logic := '0'  ;
constant clk_period: TIME:=50ns;
BEGIN
  DUT  : sinwave_gn  
    PORT MAP (
      clock   => clock  ,
      output   => output  ,
      aclr   => aclr  ,
      sinctrl   => sinctrl   ) ;
      
      
      ClockProcess: process
     begin
      clock<='0';
      wait for clk_period/2;
      clock<='1';
      wait for clk_period/2;
     end process ClockProcess;
      
   simProcess: process
     begin
     aclr<='1';
     sinctrl<='1' ;
     wait for 50ns;
     aclr<='0';
     wait for 1000ns;
     aclr<='0';
     end process simProcess;
     
END sinwave_gn_tb_arch;
老是有警告:an abstract literal and an identifier  must have a separater between them   
ococ 发表于 2013-1-23 17:15 | 显示全部楼层
50ns 改为 50 ns,数字和时间单位之间加空格。
 楼主| cuianbin 发表于 2013-1-23 20:14 | 显示全部楼层
是的!谢谢! 再请教个问题 我的Modelsim 出问题了,只要一点菜单栏 就会蹦出这个来   重装了 还是这个样子  怎么解决呢?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
resxpl 发表于 2013-1-23 20:22 | 显示全部楼层
simProcess结束之前,增加一句:
wait;
GoldSunMonkey 发表于 2013-1-23 22:33 | 显示全部楼层
resxpl 发表于 2013-1-23 20:22
simProcess结束之前,增加一句:
wait;

回复一下,这个好用么??
1003704680 发表于 2013-1-25 00:10 | 显示全部楼层
resxpl 发表于 2013-1-23 20:22
simProcess结束之前,增加一句:
wait;

能解释一下么
resxpl 发表于 2013-1-25 00:16 | 显示全部楼层
我也在等楼主回复.
一般的testbench都应该以wait结束.
时钟及其他周期信号除外.
GoldSunMonkey 发表于 2013-1-26 00:16 | 显示全部楼层
我已经给你回复了,你看见了么??在你的那个帖子里面
cherished 发表于 2013-2-20 10:26 | 显示全部楼层
GoldSunMonkey 发表于 2013-1-26 00:16
我已经给你回复了,你看见了么??在你的那个帖子里面

猴哥,请问,在写testbench的时候,有多个模块需要连接。在testbench中怎么写呢?急求。。。
ococ 发表于 2013-2-20 13:28 | 显示全部楼层
cherished 发表于 2013-2-20 10:26
猴哥,请问,在写testbench的时候,有多个模块需要连接。在testbench中怎么写呢?急求。。。 ...

模块例化连接在一起就行了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:来到这个论坛,乐于分享,好好学习!!

86

主题

439

帖子

5

粉丝
快速回复 在线客服 返回列表 返回顶部