• 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. e tcm/event order

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 65
  • Views 517
  • 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

e tcm/event order

DANDOOOOO
DANDOOOOO over 15 years ago

Hello,

I have the following issue:
I have two event, one is generated from an hdl signal (signal_r) and the other is emitted from a tcm (test_e). I have another tcm, which is waiting from both event, and after when is occurred it do something depending on the occurred event. The problem is that, this two event can happen in the same clock cycle, and in that case the emitted event (test_e) has "higher" priority (I mean here, that if both event occurs in the same cycle, only action fo the emitted event should be executed).


The issue is that, when the two events occurs in the same cycle, the event from the HDL signal is emitted first, and the tcm executes the action associated with this event, and the action associated with the other event is not executed. But my expectation is that, only the action associated with the second event should be executed. This is because the tcm which is emitting the second event runs only after the other tcm which is waiting for the events. My question is that, is there any way to modify the tmc’s execution order to avoid this problem.


I hope I was understandable. I wrote a sample code to explain my problem:

extend sys {
    sig_clock : in simple_port of bit is instance;
        keep sig_clock.hdl_path() == "clk";

    sig_signal : inout simple_port of bit is instance;
        keep sig_signal.hdl_path() == "signal";       

    event clk is rise(sig_clock$) @sim;
   
    event signal_r is rise(sig_signal$) @clk;
    on signal_r { message(LOW, "signal_r");};
   
    event test_e;
    on test_e { message(LOW, "test_e");};

    flag : bool;
        keep not flag;
   
   
    tcm_1() @clk is {
        while (TRUE) {
            wait (@signal_r or @test_e);
           
            if (now @test_e) {
                message(LOW, "flag true");
            } else if (now @signal_r) {
                message(LOW, "signal 1");
            };
           
        };       
    };

    tcm_2() @clk is {
        wait [5];

        flag = TRUE;
               
        emit test_e;
    };
   
   
    tcm_3() @clk is {
        wait [50];
       
        stop_run();
    };   

    run() is also {
        start tcm_1();
        start tcm_2();
        start tcm_3();           
    };  
};

The signal_r event is emitted in the same cycle as the test_e. The problem is that, the printed message is "signal 1" instead of "flag true".

 

  • 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