• 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. question about PSL

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 65
  • Views 14658
  • 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

question about PSL

jxker
jxker over 13 years ago

Hi, all:

I want to do assertion check in a "for" loop, and I want to do assertion check in every loop(totally 10 times in my file), but it seems that the assertion check only done once, and at the very beginning of the file instead of after going into the loop.       ncsim shows "ncsim: *E, ASRTST (./top.v, 55): (time 0 FS) Assertion top.assert_P1 has failed (1 cycles, starting 0 FS)".

following is my code, Can you help me?

-------------------------------------------------------------------------------

class rand_cov;
   rand bit[4:0] data_a;
endclass

module top;
   int i;
   int succ;
   bit[4:0] data;
  
   rand_cov cov_t;
  
   initial begin
      cov_t = new();
      for(i=0; i<10; i++) begin
           $display("NO. %d", i);
           succ = cov_t.randomize();
           data = cov_t.data_a;
           $display("data = %0d", data);
           //psl property P1 = always ( !(data == 14) );
           //psl assert_P1: assert P1;
      end  
   end
endmodule

  • Cancel
Parents
  • jxker
    jxker over 13 years ago

    Hi, TAM1

    Thank you for your help, you helped a lot.

    According to you advise, I think we should put the delay (#1) after "data" is assignment(data = cov_t.data_a), otherwise, the tenth assertion check(i = 9) will not be done.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • jxker
    jxker over 13 years ago

    Hi, TAM1

    Thank you for your help, you helped a lot.

    According to you advise, I think we should put the delay (#1) after "data" is assignment(data = cov_t.data_a), otherwise, the tenth assertion check(i = 9) will not be done.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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