標(biāo)題: quartus和modelsim聯(lián)合仿真輸出為紅色是為什么 [打印本頁]

作者: Dmark    時(shí)間: 2022-8-7 23:30
標(biāo)題: quartus和modelsim聯(lián)合仿真輸出為紅色是為什么



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, 下載次數(shù): 63)

仿真圖

仿真圖





歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1