在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 12974|回复: 5

[求助] modelsim仿真时,clk显示nodata,求解决

[复制链接]
发表于 2012-6-14 17:23:15 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

x
我用quartus2 11.0版本的创建了工程,并编写了如下的testbench:`timescale 10 ns/ 1 ps
module serial_1_vlg_tst();
// constants                                          
// general purpose registers
reg eachvec;
// test vector input registers
reg clk;
reg key_input;
reg rst;
reg rxd;
// wires                                               
wire [7:0]  en;
wire [7:0]  rxd_buf;
wire [7:0]  seg_data;
wire tr;
wire txd;

// assign statements (if any)                          
serial_1 i1 (
// port map - connection between master ports and signals/registers   

.clk(clk),

.en(en),

.key_input(key_input),

.rst(rst),

.rxd(rxd),

.rxd_buf(rxd_buf),

.seg_data(seg_data),

.tr(tr),

.txd(txd)
);
initial                                                
begin  
#20 rst=1'b1;

#20 rst=1'b0;

#20 key_input=1'b1;

#17000 key_input=1'b0;

#5       rxd= 1'b1;

repeat(100000)  #2  clk=~clk;

$monitor("New txd is %d and occurs at %t",txd,$time);


$monitor("New rxd_buf is %d and occurs at %t",rxd_buf,$time);


$monitor("New en is %d and occurs at %t",en,$time);

$monitor("New seg_data is %d and occurs at %t",seg_data,$time);



// code that executes only once                        
// insert code here --> begin                          

// --> end                                             
$display("Running testbench");  
#10000;

end
always #2 clk=~clk;                                                      
always@(tr)
begin
  if (tr<=0) begin
       repeat(3) #10420  rxd=1'b0; //接收起始位以及数据前两个0位
     repeat(2) #10420  rxd=1'b1;
               #10420  rxd=1'b0; //接收到0x35

  
#10420  rxd=1'b1;
               #10420  rxd=1'b0;  
               #10420  rxd=1'b1;
     
#10420  rxd=1'b1; //保持高位,串口停止接收



end
  else begin
      #5   rxd=1'bz;

end
@eachvec;

end
endmodule
               


可是联合仿真之后,波形中时钟没有数据,具体可以从图中看到,其他数据有,谁能指点一下?
 楼主| 发表于 2012-6-14 17:25:00 | 显示全部楼层

RE: modelsim仿真时,clk显示nodata,求解决

9L}90MXORYDT97PA{_OK3V3.jpg 仿真图
 楼主| 发表于 2012-6-14 17:25:54 | 显示全部楼层
急求解啊
发表于 2012-6-14 17:31:04 | 显示全部楼层
加上:
initial
  clk = 0;
然后再:
always #2 clk=~clk;
发表于 2012-6-14 19:12:54 | 显示全部楼层
clk没有初始值
发表于 2012-6-15 09:56:42 | 显示全部楼层
clk没有付初值哦。 clk = 0;
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

X

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-6-2 03:39 , Processed in 0.024236 second(s), 11 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表