当前位置:网站首页>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 .
边栏推荐
猜你喜欢
随机推荐
Sequence list and linked list
OSPF理论介绍
虹科教您 | 想进入TSN领域?虹科教您如何搭建TSN测试系统
什么是DNS放大攻击
Clickhouse failed to import CSV without error but no data
day14_ Unit test & Date common class & String common class
一文看懂网络安全五年之巨变
基于FPGA的IIR型滤波器设计
day17_ Under collection
解决分频模块modelsim下仿真输出为stx的错误
V-ray 5 ACEScg 工作流程设置
day06_类与对象
Webshell管理工具的流量特征
7110 digital trend 2 solution
Personal views on time complexity
c语言面试准备一(谈谈理解系类)
多线程服务器编程
Day16 set
钓鱼邮件处置
电脑系统没有standard tcp/ip port端口的处理操作









