source: trunk/IPs/systemC/processor/Morpheo/Common/include/Systemc.h @ 131

Last change on this file since 131 was 131, checked in by rosiere, 15 years ago

1) add constant method
2) test with systemc 2.2.0

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1#ifndef Morpheo_systemc_h
2#define Morpheo_systemc_h
3
4/*
5 * $Id: Systemc.h 131 2009-07-08 18:40:08Z rosiere $
6 *
7 * [ Description ]
8 *
9 * Macro / function to test
10 */
11
12#ifdef SYSTEMC
13#include <systemc.h>
14
15namespace morpheo {
16
17  // Modelsim to sc_start
18#ifdef MTI_SYSTEMC
19# define TIME_PERIOD 10.
20#else
21# define TIME_PERIOD 1.
22#endif
23
24# ifndef TIME_UNIT_PREFIX
25#  ifdef MTI_SYSTEMC
26#   define TIME_UNIT_PREFIX
27#  else
28#   define TIME_UNIT_PREFIX sc_core::
29#  endif
30# endif
31# define TIME_UNIT TIME_UNIT_PREFIX SC_NS
32
33# define VHDL_TIME_PERIOD TIME_PERIOD
34# define VHDL_TIME_UNIT               "ns"
35// #endif
36
37#ifdef MTI_SYSTEMC
38#  define simulation_run(x) do{ if (x>0) wait(TIME_PERIOD*x,TIME_UNIT); else for (int i=0; i<1000; ++i) wait(SC_ZERO_TIME); } while(0)
39#else
40# ifdef SYSTEMCASS_SPECIFIC
41#  define simulation_run(x) do{ sc_time t (x,TIME_UNIT); sc_start(t); } while(0)
42# else // systemc
43#  define simulation_run(x) do{ if(x==0) {sc_start(SC_ZERO_TIME);} else {sc_time t (x,TIME_UNIT); sc_start(t);}} while(0)
44# endif
45#endif
46
47#define simulation_cycle() sc_simulation_time()/TIME_PERIOD
48// #define simulation_cycle() sc_time_stamp()/TIME_PERIOD
49};
50#endif
51#endif
52
Note: See TracBrowser for help on using the repository browser.