• 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. Disable Statements in NCVLOG

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 65
  • Views 14526
  • 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

Disable Statements in NCVLOG

anshman
anshman over 16 years ago

 Hi,

 I am using diable statements in the fork, join_none statments, after sometime I want to disable all the threads which were started by fork but it is not working. 

example: 

 fork:label
    run.run_forever_t();
    begin
        #199;
        disable label;
    end
join_none:label

 in the above example task run_forever_t should stop after 199ns after fork was exercised but it keeps running,

 

Regards

Anshuman

  • Cancel
  • Shalom B
    Shalom B over 16 years ago

    anshman said:

    I am using diable statements in the fork, join_none statments, after sometime I want to disable all the threads which were started by fork but it is not working. 

    ...

     in the above example task run_forever_t should stop after 199ns after fork was exercised but it keeps running,

    Try "disable fork;"

     Shalom

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • anshman
    anshman over 16 years ago

     I have tried it, it is not woking. 

    Thanks 

    Anshuman

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StephenH
    StephenH over 16 years ago

    The disable only affect sub-processes in the current fork, so the code you've written is not right for what you're trying to do.
    You should instead do something like this, which I tested:

    module background;

    task run_forever_t;
      forever #10 $display("tick");
    endtask

    initial begin
      $display("start");
      fork
        begin : background_process
          fork
            run_forever_t();
            #199;
          join_any;  // join after either thread finishes
          $display("tock");
          disable fork;  // kill the threads that haven't finished
        end : background_process
      join_none;
      #100;
      $display("Stopped");

    end

    endmodule

    The outer fork allows the whole thing to run in the background, which I believe was your original intention.
    The inner fork is needed so that the disable can kill off the run_forever() task.

    Hope this helps.

    Steve.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • anshman
    anshman over 16 years ago

     Thanks ! 

    It worked fine.

     Regards

    Anshuman 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • asedehi99
    asedehi99 over 16 years ago

    thanks guys...that did help

    • 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