• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. clocking...endclocking block question in the ifv

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 65
  • Views 13600
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

clocking...endclocking block question in the ifv

DouglasYaya
DouglasYaya over 12 years ago
Hi, All
 
I am a new beginner in the IFV, now I have a question of  how to implement the clocking...endclocking in IFV.
 
For the following code, I am intened to see the "din" in the waveform has a delay of 3ns to the "clk", I have never successed, could you tell me wheter the code has some issue(e.g., missed ports declaration) or list several key TCL commands for it?
 
I really appreciate you help!
 
Thanks,
Douglas 

 
 
 
`timescale 1ns/1ps
module  reg_s
    (
        clk,
        rst,
        din,
        dout
    );

    input                       rst;
    input                       clk;
    input                       din;

    output                      dout;

    reg                         dout;


    always @(posedge rst or posedge clk)
    begin
        if(rst == 1'b1)
        begin
            dout    <= 1'b0;
        end
        else
        begin
            dout    <= din;
        end
    end
endmodule


interface   reg_s_if(input clk);

    logic                       rst;
    logic                       din;
    logic                       dout;

    clocking cb @(posedge clk);
        default input #2ns output #3ns;
        input                 dout;
        output din;
 
proterty  p_dout;
  ...
endproperty 
    endclocking
 
    ap_dout :assert  property(p_dout);
 
    modport drv_mp(clocking cb, output rst);

    modport dut_mp(input din, rst, output dout);

endinterface


module  tb;

    logic                       clk;
    
    initial
    begin
        clk     = 1'b0;
        forever
        begin
            #5ns;
            clk = ~clk;
        end
    end
    
    reg_s_if        u_reg_s_if(clk);

    reg_s           u_reg_s
                    (
                    .rst    (   u_reg_s_if.rst  ),
                    .clk    (   u_reg_s_if.clk  ),
                    .din    (   u_reg_s_if.din  ),
                    .dout   (   u_reg_s_if.dout )
                    );
                   
endmodule

  • Cancel
  • TAM1
    TAM1 over 12 years ago

     IFV is doing a formal proof and to do so it reduces the circuit description to a cycle-based model. As a cycle-based model, all of the timing information is ignored. The circuit will only change state on the edges of the clocks that you've defined. The effects of a clocking block will only be visible during a simulation run.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • DouglasYaya
    DouglasYaya over 12 years ago

    Thank you, TAM1, you've corrected my understanding!

    Yes, exactly, I can see the timing effect during the simulation run(In QestaSim) but not the IFV.

    BTW, I want to confirm again, you mean the "only simulation run", is that something like such one? Since I successed the timing effect in this pattern.

     program automatic test(...) ;

    logic ...;

    logic ...; 

      dut u_dut(...);

    intial

    begin

    ... 

    end 

    endporgram

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information