Changeset 271 for soft/giet_vm/giet_drivers
- Timestamp:
- Jan 17, 2014, 11:49:27 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/xcu_driver.c
r263 r271 170 170 //////////////////////////////////////////////////////////////////////////////// 171 171 unsigned int _xcu_timer_start( unsigned int cluster_xy, 172 unsigned int p roc_id,172 unsigned int pti_index, 173 173 unsigned int period ) 174 174 { … … 178 178 if (x >= X_SIZE) return 1; 179 179 if (y >= Y_SIZE) return 1; 180 if (proc_id >= NB_PROCS_MAX) return 1;181 180 182 181 #if USE_XICU 183 182 unsigned int* xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base + 184 183 (cluster_xy * (unsigned int)&vseg_cluster_increment)); 185 xcu_address[XICU_REG(XICU_PTI_PER, p roc_id)] = period;184 xcu_address[XICU_REG(XICU_PTI_PER, pti_index)] = period; 186 185 return 0; 187 186 #else … … 200 199 ////////////////////////////////////////////////////////////////////////////// 201 200 unsigned int _xcu_timer_stop( unsigned int cluster_xy, 202 unsigned int proc_id) 203 { 204 // parameters checking 205 unsigned int x = cluster_xy >> Y_WIDTH; 206 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 207 if (x >= X_SIZE) return 1; 208 if (y >= Y_SIZE) return 1; 209 if (proc_id >= NB_PROCS_MAX) return 1; 201 unsigned int pti_index) 202 { 203 // parameters checking 204 unsigned int x = cluster_xy >> Y_WIDTH; 205 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 206 if (x >= X_SIZE) return 1; 207 if (y >= Y_SIZE) return 1; 210 208 211 209 #if USE_XICU 212 210 unsigned int * xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base + 213 211 (cluster_xy * (unsigned int)&vseg_cluster_increment)); 214 xcu_address[XICU_REG(XICU_PTI_PER, p roc_id)] = 0;212 xcu_address[XICU_REG(XICU_PTI_PER, pti_index)] = 0; 215 213 return 0; 216 214 #else … … 231 229 ////////////////////////////////////////////////////////////////////////////// 232 230 unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy, 233 unsigned int proc_id ) 234 { 235 // parameters checking 236 unsigned int x = cluster_xy >> Y_WIDTH; 237 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 238 if (x >= X_SIZE) return 1; 239 if (y >= Y_SIZE) return 1; 240 if (proc_id >= NB_PROCS_MAX) return 1; 241 242 #if USE_XICU 243 unsigned int * xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base + 244 (cluster_xy * (unsigned int)&vseg_cluster_increment)); 245 246 unsigned int bloup = xcu_address[XICU_REG(XICU_PTI_ACK, proc_id)]; 247 bloup++; // to avoid a warning 231 unsigned int pti_index ) 232 { 233 // parameters checking 234 unsigned int x = cluster_xy >> Y_WIDTH; 235 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 236 if (x >= X_SIZE) return 1; 237 if (y >= Y_SIZE) return 1; 238 239 #if USE_XICU 240 volatile unsigned int * xcu_address = 241 (unsigned int *) ((unsigned int)&seg_xcu_base + 242 (cluster_xy * (unsigned int)&vseg_cluster_increment)); 243 244 xcu_address[XICU_REG(XICU_PTI_ACK, pti_index)]; 248 245 return 0; 249 246 #else … … 265 262 ///////////////////////////////////////////////////////////////////////////// 266 263 unsigned int _xcu_timer_reset_cpt( unsigned int cluster_xy, 267 unsigned int proc_id ) 268 { 269 // parameters checking 270 unsigned int x = cluster_xy >> Y_WIDTH; 271 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 272 if (x >= X_SIZE) return 1; 273 if (y >= Y_SIZE) return 1; 274 if (proc_id >= NB_PROCS_MAX) return 1; 264 unsigned int pti_index ) 265 { 266 // parameters checking 267 unsigned int x = cluster_xy >> Y_WIDTH; 268 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 269 if (x >= X_SIZE) return 1; 270 if (y >= Y_SIZE) return 1; 275 271 276 272 #if USE_XICU … … 278 274 (cluster_xy * (unsigned int)&vseg_cluster_increment)); 279 275 280 unsigned int period = xcu_address[XICU_REG(XICU_PTI_PER, p roc_id)];276 unsigned int period = xcu_address[XICU_REG(XICU_PTI_PER, pti_index)]; 281 277 282 278 // we write 0 first because if the timer is currently running, 283 279 // the corresponding timer counter is not reset 284 xcu_address[XICU_REG(XICU_PTI_PER, p roc_id)] = 0;285 xcu_address[XICU_REG(XICU_PTI_PER, p roc_id)] = period;280 xcu_address[XICU_REG(XICU_PTI_PER, pti_index)] = 0; 281 xcu_address[XICU_REG(XICU_PTI_PER, pti_index)] = period; 286 282 return 0; 287 283 #else
Note: See TracChangeset
for help on using the changeset viewer.