标题: quartus和modelsim联合仿真输出为红色是为什么 [打印本页]

作者: Dmark    时间: 2022-8-7 23:30
标题: quartus和modelsim联合仿真输出为红色是为什么



verilog的逻辑代码:
module seg_test(
input clk,
input rst_n,
output reg clk_1k
);
reg [19:0] count;
always@(posedge clk or negedge rst_n)
begin
        if(rst_n==1'b0)
        begin
                count<=1'b0;
        end
        else if(count==20'd49)
                begin
                        clk_1k<=~clk_1k;
                        count<=1'b0;
                end
        else
                begin
                        count<=count+1'b1;
                end
end
endmodule


test bench代码:
`timescale 1 ps/ 1 ps
module seg_test_vlg_tst();

reg clk;
reg rst_n;                                 
wire clk_1k;

seg_test i1 (
        .clk(clk),
        .clk_1k(clk_1k),
        .rst_n(rst_n)
);
initial                                                
begin                                          
   clk=1'b0;
        rst_n=1'b0;
        #10;
        rst_n=1'b1;            
end                                                   
always                     
begin                                                
   clk=~clk;
        #10;                                       
end                                                   
endmodule



51hei截图20220807233023.png (226.17 KB, 下载次数: 63)

仿真图

仿真图





欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1