OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 5684|回复: 4

再问一个modelsim仿真错误问题

[复制链接]

27

主题

73

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
267
金钱
267
注册时间
2017-6-15
在线时间
29 小时
发表于 2018-11-20 14:08:09 | 显示全部楼层 |阅读模式
1金钱
图片中是仿真时提示的错误,但不知道怎么解决的,改怎么解决
下面是源代码
// Copyright (C) 1991-2013 Altera Corporation
// Your use of Altera Corporation's design tools, logic functions
// and other software and tools, and its AMPP partner logic
// functions, and any output files from any of the foregoing
// (including device programming or simulation files), and any
// associated documentation or information are expressly subject
// to the terms and conditions of the Altera Program License
// Subscription Agreement, Altera MegaCore Function License
// Agreement, or other applicable license agreement, including,
// without limitation, that your use is for the sole purpose of
// programming logic devices manufactured by Altera and sold by
// Altera or its authorized distributors.  Please refer to the
// applicable agreement for further details.

// *****************************************************************************
// This file contains a Verilog test bench template that is freely editable to  
// suit user's needs .Comments are provided in each section to help the user   
// fill out necessary details.                                                  
// *****************************************************************************
// Generated on "11/20/2018 13:46:00"

// Verilog Test Bench template for design : led
//
// Simulation tool : ModelSim (Verilog)
//

`timescale 1 ps/ 1 ps
module led_vlg_tst();
// constants                                          
// general purpose registers
reg eachvec;
// test vector input registers
reg CLK;
reg RST_n;
// wires                                               
wire LED0;

// assign statements (if any)                          
led i1 (
// port map - connection between master ports and signals/registers   
        .CLK(CLK),
        .LED0(LED0),
        .RST_n(RST_n)
);
initial                                                
begin                                                  
// code that executes only once                        
// insert code here --> begin                          

// --> end                                             
$display("Running testbench");                       
end  
begin
      CLK=1'b0;
      RST_n=1'b1;       
          #100
          RST_n=1'b0;
          #100
          RST_n=1'b1;
end
always                                                
// optional sensitivity list                           
// @(event1 or event2 or .... eventn)                  
begin                                                  
// code executes for every event on sensitivity list   
// insert code here --> begin                          

@eachvec;                                             
// --> end                                             
end                                                   
endmodule


QQ截图20181119170544.jpg
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

557

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165081
金钱
165081
注册时间
2010-12-1
在线时间
2103 小时
发表于 2018-11-21 02:21:45 | 显示全部楼层
回复

使用道具 举报

9

主题

202

帖子

0

精华

资深版主

Rank: 8Rank: 8

积分
839
金钱
839
注册时间
2018-7-29
在线时间
128 小时
发表于 2018-11-21 19:24:12 | 显示全部楼层
initial                                                
begin                                                  
// code that executes only once                        
// insert code here --> begin                          

// --> end                                             
$display("Running testbench");                       
end  
begin
      CLK=1'b0;
      RST_n=1'b1;        
          #100
          RST_n=1'b0;
          #100
          RST_n=1'b1;
end
这一段代码有问题,后面一个begin/end之间的语句应该放在initial后面那个begin/end之间,也就是说你多写了一个begin/end;
回复

使用道具 举报

27

主题

73

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
267
金钱
267
注册时间
2017-6-15
在线时间
29 小时
 楼主| 发表于 2018-11-22 13:30:52 | 显示全部楼层
SunML 发表于 2018-11-21 19:24
initial                                                
begin                                       ...

但是编译的时候没有错误
回复

使用道具 举报

9

主题

202

帖子

0

精华

资深版主

Rank: 8Rank: 8

积分
839
金钱
839
注册时间
2018-7-29
在线时间
128 小时
发表于 2018-11-22 18:30:21 | 显示全部楼层
banshan 发表于 2018-11-22 13:30
但是编译的时候没有错误

改改试下呗
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-7-8 00:13

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表