Last change
on this file since 139 was
132,
checked in by rosiere, 15 years ago
|
1) add constant method - compatibility with SystemC
2) add Script to test sensitive list
3) fix bug in sensitive list
|
-
Property svn:keywords set to
Id
|
File size:
1.1 KB
|
Rev | Line | |
---|
[113] | 1 | #ifndef Morpheo_systemc_h |
---|
| 2 | #define Morpheo_systemc_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Systemc.h 132 2009-07-11 16:39:35Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | * Macro / function to test |
---|
| 10 | */ |
---|
| 11 | |
---|
| 12 | #ifdef SYSTEMC |
---|
| 13 | #include <systemc.h> |
---|
| 14 | |
---|
| 15 | namespace 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 |
---|
[131] | 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) |
---|
[113] | 39 | #else |
---|
[131] | 40 | # ifdef SYSTEMCASS_SPECIFIC |
---|
[132] | 41 | # define simulation_run(x) do{ sc_start(x); } while(0) |
---|
[131] | 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 |
---|
[113] | 45 | #endif |
---|
| 46 | |
---|
| 47 | #define simulation_cycle() sc_simulation_time()/TIME_PERIOD |
---|
[131] | 48 | // #define simulation_cycle() sc_time_stamp()/TIME_PERIOD |
---|
[113] | 49 | }; |
---|
| 50 | #endif |
---|
| 51 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.