当前位置:网站首页>Solve the error that the simulation output is STX under the frequency division module Modelsim
Solve the error that the simulation output is STX under the frequency division module Modelsim
2022-07-29 06:33:00 【qq_ forty-six million four hundred and seventy-five thousand on】
The following is a uart A routine of , Take this program for example , stay modelsim The output frequency division signal below is stx type , That is, the uncertainty signal , Let's analyze the reasons :
module uart_clkdiv(clk, rst_n, clkout);
input clk;
input rst_n;
output clkout;
reg clkout;
reg [15:0] cnt;
always @(posedge clk or negedge rst_n)
begin
if (!rst_n)
begin
cnt <= 16'b0;
clkout <= 1'b0;
end
else if(cnt == 16'd1)//pc communication set 13
begin
clkout <= 1'b1;
cnt <= cnt + 16'd1;
end
else if(cnt == 16'd3)//pc communication set 26
begin
clkout <= 1'b0;
cnt <= 16'd0;
end
else
begin
cnt <= cnt + 16'd1;
end
end
endmodule
The green part is the changed code . The reason for the error is that there is no reset signal to make the variables cnt clkout Generate an initial value , It causes the output to be uncertain . During the simulation testbench In, the reset signal should be reset by pulling down several clock cycles . Therefore, the initial value of each variable needs to be clearly specified during simulation , Prevent uncertain signals .
边栏推荐
- 通过os-shell引发的mysql拿shell的思考
- 虹科为您分享EtherCAT demo,教您如何从其他协议快速过渡到EtherCAT工业总线
- 六、 网络互联与互联网
- Self study understanding of [chain forward star]
- Arrays&Object&System&Math&Random&包装类
- Ue5 texture system explanation and common problem setting and Solutions
- day03_1_流程控制
- UDP套接口通信实验
- 虹科分享 | FPGA 实现的直通与存储转发切换延迟
- THINKPHP5 常见问题
猜你喜欢

What are the advantages of software testing? See how much you know

Access、Hybrid和Trunk三种模式的理解

六、 网络互联与互联网

虹科分享 | 带你全面认识“CAN总线错误”(二)——CAN错误类型

通过os-shell引发的mysql拿shell的思考

Vivado IP核之浮点数开方 Floating-point

自动化测试的生命周期是什么?

Overview and summary of GI engine in redshift 024, the official tutorial

day13_ Under multithreading

FTP的两种模式详解
随机推荐
虹科分享 | 为什么说EtherCAT是提高控制系统性能的最佳解决方案?
Ue5 landscape conversion Nanite conversion method and it does not support the use method of starting dynamic mesh with lumen and lumen
四、 局域网和城域网
APP受到的那些漏洞攻击
虹科分享 | FPGA 实现的直通与存储转发切换延迟
[interview questions] the latest software test interview questions in 2022 (400) [with answers] continue to update
HOG+SVM实现行人检测
UE4 高光官方参考值
虹科白皮书 | 在工业4.0阶段,如何利用TSN时间敏感网络技术打造数字化工厂?
day15_泛型
七、 下一代互联网IPV6
子网数、主机数与子网掩码的关系
虹科分享 | 带你全面了解“CAN总线错误”(三)——CAN节点状态与错误计数器
waf防护是什么
Official tutorial redshift 07 instances and proxy
Sliding window leetcode 76. minimum covering substring (hard) 76.76. minimumwindow substring (hard)
黑客攻击入侵服务器的6种常见方式
Clickhouse failed to import CSV without error but no data
【面试题】2022年最新软件测试面试题(400道)【附带答案】持续更新...
day06_类与对象