15467 views|6 replies

820

Posts

2

Resources
The OP
 

The vivado simulation output waveform signal input is all Z and the output is all X [Copy link]

Source file:

`timescale 1ns / 1ps
module clk_counter(
    input               sys_clk,
    input               rst_n,
    input               gate,
    output reg[31:0]       clk_cnt,
    output reg          counter_valid
    );
    always@(posedge sys_clk or negedge rst_n)
    begin
        if(rst_n == 1'b0)
            begin
                clk_cnt <= 32'd0;
                counter_valid <= 1'b0;
            end
        else if(gate == 1'b1)
            begin
                clk_cnt <= clk_cnt + 32'd1;
            end
        else if(gate == 1'b0)
            begin
                counter_valid <= 1'b1;
            end
    end
endmodule

Simulation stimulus file:

`timescale 1ns / 1ps
module vtf_clk_counter;
    //inputs
    reg               clk;
    reg               rst_n;
    reg               gate;   
    //outputs 
    wire[31:0]       clk_cnt;    
    wire          counter_valid;
    
    clk_counter uut(
        .sys_clk(clk),
        .rst_n(rst_n),
        .gate(gate),
        .clk_cnt(clk_cnt),
        .counter_valid(counter_valid)
    );
    initial begin
        clk = 0;
        rst_n = 0;
        gate = 0;
        #100;
            rst_n = 1;
        #100;
            gate = 1;
        #1000;
            gate = 0;
    end
    always #25 clk = ~clk;
endmodule

Simulation waveform:

What is the problem with this simulation waveform?

This post is from EE_FPGA Learning Park

Latest reply

It may be that the simulation file was not added to the project.  Details Published on 2024-3-21 22:56
 

820

Posts

2

Resources
2
 

The input and output signals are all defined, and initial values are assigned to the signals, but there is nothing in the simulation waveform.

This post is from EE_FPGA Learning Park
 
 

5979

Posts

8

Resources
3
 

There is no problem with the file. Let’s enlarge the waveform and see. The current time scale is ms, which is too big.

This post is from EE_FPGA Learning Park

Comments

OK, thanks, the problem has been solved  Details Published on 2022-6-11 14:28
Personal signature生活就是油盐酱醋再加一点糖,快活就是一天到晚乐呵呵的忙
===================================
做一个简单的人,踏实而务实,不沉溺幻想,不庸人自扰
 
 
 

820

Posts

2

Resources
4
 
chenzhufly published on 2022-6-7 10:45 There is no problem with the file. Let’s enlarge the waveform and see. The current time scale is ms, which is too big.

OK, thanks, the problem has been solved

This post is from EE_FPGA Learning Park

Comments

If you have solved it, please tell me how you solved it, so that you can learn from it for other forum friends who have the same problem.  Details Published on 2022-6-13 11:15
 
 
 

5979

Posts

8

Resources
5
 
1nnocent published on 2022-6-11 14:28 OK, thank you, the problem has been solved

If you solve it, please tell me how you solved it, so that others who encounter the same problem can learn from it.

This post is from EE_FPGA Learning Park

Comments

You posted the simulation pictures and said there was no problem. I thought it was because I was careless and didn't adjust the timeline. Now I have forgotten it. It seems that when the top-level module called this module, the bit width of the parameters did not correspond well, and the 32-bit clk_count[31:0] was transmitted as a single-bit width.  Details Published on 2022-6-13 13:23
Personal signature生活就是油盐酱醋再加一点糖,快活就是一天到晚乐呵呵的忙
===================================
做一个简单的人,踏实而务实,不沉溺幻想,不庸人自扰
 
 
 

820

Posts

2

Resources
6
 
chenzhufly published on 2022-6-13 11:15 If you solve it, please tell me how you solved it, so that others who encounter the same problem can learn from it

You posted the simulation picture and said it was fine, thinking that you were careless and didn't adjust the timeline.

I forgot about it now. It seems that when the top-level module calls this module, the parameter bit width does not correspond well, and the 32-bit clk_count[31:0] is passed to one bit width.

This post is from EE_FPGA Learning Park
 
 
 

1

Posts

0

Resources
7
 
It may be that the simulation file was not added to the project.
This post is from EE_FPGA Learning Park
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Featured Posts
MATLAB APP Designer serial port debugging tool writing

This post was last edited by lb8820265 on 2019-5-9 23:11 Previously, we introduced two ways to use VC6 to make serial ...

About the original picture and packaging

Does anyone have the original picture and package of STM32F103 series?

How to use CPLD to collect asynchronous signals

Scenario: Use CPLD to decode a serial data channel. The data has no accompanying clock and has a fixed frequency but a d ...

Measuring poles and zeros from a Bode plot

This post was last edited by Jack315 on 2021-1-25 00:52 The transfer function of a single zero is: 522846 The Bode plot ...

Encoder counting principle and motor speed measurement principle - multi-picture analysis

This post was last edited by DDZZ669 on 2021-2-14 23:30 Encoder is a sensor used to measure mechanical rotation or displ ...

35 "Ten Thousand Miles" Raspberry Pi Car——ROS Learning (Realizing Hello World)

The best way to learn ROS is to use it. The ROS official website has a Chinese version of the tutorial . After install ...

36 "Ten Thousand Miles" Raspberry Pi Car——ROS Learning (VSCode to Implement Hello World)

It is very convenient to run ROS projects in VSCode. In this section, we use ROS to write and run the "Hello world" pro ...

[The strongest open source] Hand-rubbed 120W switching power supply

I recently took the time to make a switching power supply 645265 645262 645263 645264 645261 645260

Record a blue screen pit

I mentioned a while ago that my company's computers would occasionally blue screen. Now I think about it, the blue scree ...

ESP8266 01+DHT11 acquisition

Could anyone give me some advice? When I collect DHT11 data through one of GPIO 0 and 2, the 8266 01 keeps restarting. O ...

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list