Last change
on this file since 122 was
113,
checked in by rosiere, 15 years ago
|
1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile
|
-
Property svn:keywords set to
Id
|
File size:
863 bytes
|
Rev | Line | |
---|
[113] | 1 | #ifndef Morpheo_systemc_h |
---|
| 2 | #define Morpheo_systemc_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Systemc.h 113 2009-04-14 18:39:12Z 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 |
---|
| 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 | # define simulation_run(x) do{ sc_start(x); } while(0) |
---|
| 41 | #endif |
---|
| 42 | |
---|
| 43 | #define simulation_cycle() sc_simulation_time()/TIME_PERIOD |
---|
| 44 | |
---|
| 45 | }; |
---|
| 46 | #endif |
---|
| 47 | #endif |
---|
| 48 | |
---|
Note: See
TracBrowser
for help on using the repository browser.