Changeset 62 for sources/src/gen_code.h
- Timestamp:
- Feb 16, 2017, 3:46:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/gen_code.h
r61 r62 106 106 extern unsigned long long last_wait_f0, last_wait_f1, last_wait_up, last_wait_ml; 107 107 extern unsigned int nb_func[2]; 108 extern unsigned int expected_globaltime; 109 extern volatile unsigned int globaltime; 110 #ifdef USE_OPENMP 108 111 #pragma omp threadprivate (busy_wait_f0, busy_wait_f1, busy_wait_up, busy_wait_ml, nb_func) 109 112 #pragma omp threadprivate (last_wait_f0, last_wait_f1, last_wait_up, last_wait_ml) 110 extern unsigned int expected_globaltime; 111 extern volatile unsigned int globaltime; 113 #pragma omp threadprivate (expected_globaltime) 112 114 #pragma omp shared (globaltime) 113 #pragma omp threadprivate (expected_globaltime) 114 115 #endif 115 116 extern unsigned int num_omp_threads; 116 117 117 118 119 #ifdef USE_OPENMP 118 120 #pragma omp parallel 121 #endif 119 122 { 120 //int cyclecount = number_of_cycles;123 int cyclecount = number_of_cycles; 121 124 busy_wait_f0 = busy_wait_f1 = busy_wait_up = busy_wait_ml = total_assig = 0; 122 125 last_wait_f0 = last_wait_f1 = last_wait_up = last_wait_ml = 0; 123 126 124 127 expected_globaltime = 0; 125 #pragma omp master 128 #ifdef USE_OPENMP 129 #pragma omp master 130 #endif 126 131 { 127 132 globaltime = 0; 128 #ifdef _OPENMP133 #ifdef USE_OPENMP 129 134 num_omp_threads = omp_get_num_threads(); 130 135 #else … … 133 138 } 134 139 140 #ifdef USE_OPENMP 135 141 #pragma omp barrier 136 // while (!((have_to_stop) | (cyclecount == 0))) { 137 while (!((have_to_stop) || (number_of_cycles == 0))) { 138 #pragma omp master 142 #endif 143 while (!(have_to_stop || cyclecount == 0)) { 144 //while (!(have_to_stop || number_of_cycles == 0)) { 145 #ifdef USE_OPENMP 146 #pragma omp master 147 #endif 139 148 { 140 149 trace_all(false); 141 150 } 142 151 internal_sc_cycle2(); 143 #pragma omp master 152 #ifdef USE_OPENMP 153 #pragma omp master 154 #endif 144 155 { 145 156 trace_all(true); 146 157 } 147 // cyclecount = (number_of_cycles < 0) ? number_of_cycles : cyclecount - 1; 148 number_of_cycles = (number_of_cycles < 0) ? number_of_cycles : number_of_cycles - 1; 149 } 158 cyclecount = (number_of_cycles < 0) ? number_of_cycles : cyclecount - 1; 159 // number_of_cycles = (number_of_cycles < 0) ? number_of_cycles : number_of_cycles - 1; 160 } 161 #ifdef USE_OPENMP 150 162 #pragma omp barrier 163 #endif 151 164 #if 0 152 #ifdef _OPENMP165 #ifdef USE_OPENMP 153 166 #pragma omp critical 154 167 { … … 191 204 if (is_posted_write()) { 192 205 // update posted value to external signals 206 #ifdef USE_OPENMP 193 207 #pragma omp parallel 208 #endif 194 209 update(); 195 210 func_combinationals(); … … 200 215 // don't need to do func_combinationals since 'unstable' flag is now false 201 216 if (is_posted_write()) { 217 #ifdef USE_OPENMP 202 218 #pragma omp parallel 219 #endif 203 220 update(); 204 221 func_combinationals();
Note: See TracChangeset
for help on using the changeset viewer.