|  | 
|  |  | 
 |  
|  |  |  |  
|  |  | 
 |  
|  |  | sc_time_stamp () |  
|  |  | The function sc_time_stamp return's the current simulation time. During elaboration and initialization the function will return a value of zero. |  
|  |  | 
 |  
|  |  |  |  
|  |  | 
 |  
|  |  | Example : sc_time_stamp() |  
|  |  | 
 |  
|  |  | 
  1 #include <systemc.h>
  2 
  3 int sc_main (int argc, char* argv[]) {
  4   cout<<"Current time is "<< sc_time_stamp() << endl;
  5   sc_start(1);
  6   cout<<"Current time is "<< sc_time_stamp() << endl;
  7   sc_start(100);
  8   cout<<"Current time is "<< sc_time_stamp() << endl;
  9   sc_stop();
 10   cout<<"Current time is "<< sc_time_stamp() << endl;
 11   return 0;// Terminate simulation
 12 }
You could download file sc_time_stamp.cpp here |  
|  |  | 
 |  
|  |  | Simulation Output : sc_time_stamp() |  
|  |  | 
 |  
|  |  |  Current time is 0 s
 Current time is 1 ns
 Current time is 101 ns
 SystemC: simulation stopped by user.
 Current time is 101 ns
 |  
|  |  | 
 |  
|  |  | 
 |  
|  |  | 
 |  
|  |  |  |  
|  |  | 
 |  |  | 
|  
 |  
 |  
 | 
| 
 | 
|    |  
| Copyright © 1998-2025 |  
| Deepak Kumar Tala - All rights reserved |  
| Do you have any Comment? mail me at:deepak@asic-world.com
 |  |