delay instead of sync
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							@@ -95,12 +95,8 @@ int main() {
 | 
				
			|||||||
    int * local_mem_base           = (int *) end;
 | 
					    int * local_mem_base           = (int *) end;
 | 
				
			||||||
    int * plic_b_pending           = (int *)(0xA0000000+PLIC_PENDING_OFFSET);
 | 
					    int * plic_b_pending           = (int *)(0xA0000000+PLIC_PENDING_OFFSET);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int * local_sync_bit           = (int *)(local_mem_base + 10);
 | 
					 | 
				
			||||||
    volatile int * target_sync_bit = (int *)(target_mem_base + 10);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int hartid = read_csr(mhartid);
 | 
					    int hartid = read_csr(mhartid);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *local_sync_bit = 0;
 | 
					 | 
				
			||||||
    platform_init();
 | 
					    platform_init();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (hartid == 0) {
 | 
					    if (hartid == 0) {
 | 
				
			||||||
@@ -112,10 +108,7 @@ int main() {
 | 
				
			|||||||
    	printf("HW thread ID %d: write value A=0x%x and value B=0x%x to thread 1\n", hartid, val_a, val_b);
 | 
					    	printf("HW thread ID %d: write value A=0x%x and value B=0x%x to thread 1\n", hartid, val_a, val_b);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *local_sync_bit++;
 | 
					    delayUS(100);
 | 
				
			||||||
    while (*target_sync_bit < *local_sync_bit) {
 | 
					 | 
				
			||||||
        asm("nop");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    printf("End of execution");
 | 
					    printf("End of execution");
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user