- Timestamp:
- Dec 3, 2015, 4:38:59 PM (9 years ago)
- Location:
- soft/giet_vm/giet_libs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/mwmr_channel.c
r731 r735 11 11 #include "stdint.h" 12 12 #include "user_lock.h" 13 14 // macro to use a shared TTY 15 #define PRINTF(...) lock_acquire( &tty_lock ); \ 16 giet_tty_printf(__VA_ARGS__); \ 17 lock_release( &tty_lock ); 18 extern user_lock_t tty_lock; 13 19 14 20 ////////////////////////////////////// … … 251 257 #endif 252 258 253 uint32_t n;254 uint32_t spaces; // number of empty slots (in words)255 uint32_t nwords; // requested transfer length (in words)256 uint32_t depth; // channel depth (in words)257 uint32_t width; // channel width (in words)258 uint32_t sts; // channel sts259 uint32_t ptw; // channel ptw259 uint32_t n; 260 uint32_t spaces; // number of empty slots (in words) 261 uint32_t nwords; // requested transfer length (in words) 262 uint32_t depth; // channel depth (in words) 263 uint32_t width; // channel width (in words) 264 volatile uint32_t sts; // channel status 265 volatile uint32_t ptw; // channel ptw 260 266 261 267 if (items == 0) return; … … 292 298 293 299 lock_release( &mwmr->lock ); 300 294 301 return; 295 302 } … … 341 348 342 349 uint32_t n; 343 uint32_t nwords; // requested transfer length (in words)344 uint32_t depth; // channel depth (in words)345 uint32_t width; // channel width (in words)346 uint32_t sts; // channel sts347 uint32_t ptr; // channel ptr350 uint32_t nwords; // requested transfer length (in words) 351 uint32_t depth; // channel depth (in words) 352 uint32_t width; // channel width (in words) 353 volatile uint32_t sts; // channel status 354 volatile uint32_t ptr; // channel ptr 348 355 349 356 if (items == 0) return; … … 379 386 380 387 lock_release( &mwmr->lock ); 388 381 389 return; 382 390 } -
soft/giet_vm/giet_libs/stdio.c
r722 r735 178 178 179 179 /////////////////////////////////////////////////// 180 void giet_coproc_alloc( unsigned int coproc_type, 180 void giet_coproc_alloc( unsigned int cluster_xy, 181 unsigned int coproc_type, 181 182 unsigned int* coproc_info ) 182 183 { 183 184 if ( sys_call( SYSCALL_COPROC_ALLOC, 185 cluster_xy, 184 186 coproc_type, 185 187 (unsigned int)coproc_info, 186 0 , 0) )188 0 ) ) 187 189 giet_pthread_exit("error in giet_coproc_alloc()"); 188 190 } 189 191 190 ///////////////////////////////////////////////////////// 191 void giet_coproc_release( unsigned int coproc_reg_index ) 192 ////////////////////////////////////////////////// 193 void giet_coproc_release( unsigned int cluster_xy, 194 unsigned int coproc_type ) 192 195 { 193 196 if ( sys_call( SYSCALL_COPROC_RELEASE, 194 coproc_reg_index, 195 0, 0, 0 ) ) 197 cluster_xy, 198 coproc_type, 199 0 , 0 ) ) 196 200 giet_pthread_exit("error in giet_coproc_release()"); 197 201 } 198 202 199 203 ////////////////////////////////////////////////////////////////// 200 void giet_coproc_channel_init( unsigned int channel, 204 void giet_coproc_channel_init( unsigned int cluster_xy, 205 unsigned int coproc_type, 206 unsigned int channel, 201 207 giet_coproc_channel_t* desc ) 202 208 { 203 209 if ( sys_call( SYSCALL_COPROC_CHANNEL_INIT, 210 cluster_xy, 211 coproc_type, 204 212 channel, 205 (unsigned int)desc, 206 0, 0 ) ) 213 (unsigned int)desc ) ) 207 214 giet_pthread_exit("error in giet_coproc_channel_init()"); 208 215 } 209 216 210 ///////////////////////////////////////////////////// 211 void giet_coproc_run( unsigned int coproc_reg_index ) 217 ////////////////////////////////////////////// 218 void giet_coproc_run( unsigned int cluster_xy, 219 unsigned int coproc_type ) 212 220 { 213 221 if ( sys_call( SYSCALL_COPROC_RUN, 214 coproc_reg_index, 215 0, 0, 0 ) ) 222 cluster_xy, 223 coproc_type, 224 0 , 0 ) ) 216 225 giet_pthread_exit("error in giet_coproc_run()"); 217 226 } 218 227 219 //////////////////////////// 220 void giet_coproc_completed() 228 //////////////////////////////////////////////////// 229 void giet_coproc_completed( unsigned int cluster_xy, 230 unsigned int coproc_type ) 221 231 { 222 232 if ( sys_call( SYSCALL_COPROC_COMPLETED, 223 0, 0, 0, 0 ) ) 233 cluster_xy, 234 coproc_type, 235 0 , 0 ) ) 224 236 giet_pthread_exit("error in giet_coproc_completed"); 225 237 } -
soft/giet_vm/giet_libs/stdio.h
r722 r735 244 244 unsigned int buffer_size; // memory buffer size 245 245 unsigned int buffer_vaddr; // memory buffer virtual address 246 unsigned int mwmr_vaddr; // MWMR descriptor virtual address247 unsigned int lock_vaddr; // lock for MWMR virtual address246 unsigned int status_vaddr; // MWMR status virtual address (12 bytes) 247 unsigned int lock_vaddr; // MWMR lock virtual address (64 bytes) 248 248 } giet_coproc_channel_t; 249 249 250 extern void giet_coproc_alloc( unsigned int coproc_type, 250 extern void giet_coproc_alloc( unsigned int cluster_xy, 251 unsigned int coproc_type, 251 252 unsigned int* coproc_info ); 252 253 253 extern void giet_coproc_release( unsigned int coproc_reg_index ); 254 255 extern void giet_coproc_channel_init( unsigned int channel, 254 extern void giet_coproc_release( unsigned int cluster_xy, 255 unsigned int coproc_type ); 256 257 extern void giet_coproc_channel_init( unsigned int cluster_xy, 258 unsigned int coproc_type, 259 unsigned int channel, 256 260 giet_coproc_channel_t* desc ); 257 261 258 extern void giet_coproc_run( unsigned int coproc_reg_index ); 259 260 extern void giet_coproc_completed(); 262 extern void giet_coproc_run( unsigned int cluster_xy, 263 unsigned int coproc_type ); 264 265 extern void giet_coproc_completed( unsigned int cluster_xy, 266 unsigned int coproc_type ); 261 267 262 268 //////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.