mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	added in the CSR name for stimecmp(h)
This commit is contained in:
		
							parent
							
								
									4fa78a02b7
								
							
						
					
					
						commit
						5c3f5fe8c6
					
				@ -145,8 +145,8 @@ cause_s_time_interrupt:
 | 
			
		||||
    bgtu t3, t2, nowrap_s  // check new time exceeds current time (no wraparound)
 | 
			
		||||
    addi t6, t6, 1       // if wrap, increment most significant word
 | 
			
		||||
nowrap_s:
 | 
			
		||||
    csrw 0x14D, t3         // store into STIMECMP
 | 
			
		||||
    csrw 0x15D, t6     // store into STIMECMPH
 | 
			
		||||
    csrw stimecmp, t3         // store into STIMECMP
 | 
			
		||||
    csrw stimecmph, t6     // store into STIMECMPH
 | 
			
		||||
time_loop_s:
 | 
			
		||||
    addi a3, a3, -1
 | 
			
		||||
    bnez a3, time_loop_s // go through this loop for [a3 value] iterations before returning without performing interrupt
 | 
			
		||||
@ -558,8 +558,8 @@ time_interrupt_\MODE\():
 | 
			
		||||
    li t2, 0xFFFFFFFF
 | 
			
		||||
    sw t2, 0(t0) // reset interrupt by setting mtimecmp to max
 | 
			
		||||
    //sw t2, 4(t0) // reset interrupt by setting mtimecmpH to max
 | 
			
		||||
    csrw 0x14D, t2 // reset stime interrupts by doing the same to stimecmp and stimecmpH.
 | 
			
		||||
    csrw 0x15D, t2
 | 
			
		||||
    csrw stimecmp, t2 // reset stime interrupts by doing the same to stimecmp and stimecmpH.
 | 
			
		||||
    csrw stimecmph, t2
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    li t0, 0x20
 | 
			
		||||
 | 
			
		||||
@ -145,7 +145,7 @@ cause_s_time_interrupt:
 | 
			
		||||
    lw t2, 0(t5)         // low word of MTIME
 | 
			
		||||
    lw t6, 4(t5)         // high word of MTIME
 | 
			
		||||
    add t3, t2, t3       // add desired offset to the current time
 | 
			
		||||
    csrw 0x14D, t3     // store into most significant word of STIMECMP
 | 
			
		||||
    csrw stimecmp, t3     // store into most significant word of STIMECMP
 | 
			
		||||
time_loop_s:
 | 
			
		||||
    addi a3, a3, -1
 | 
			
		||||
    bnez a3, time_loop_s // go through this loop for [a3 value] iterations before returning without performing interrupt
 | 
			
		||||
@ -548,7 +548,7 @@ time_interrupt_\MODE\():
 | 
			
		||||
    la t0, 0x02004000    // MTIMECMP register in CLINT
 | 
			
		||||
    li t2, 0xFFFFFFFF
 | 
			
		||||
    sd t2, 0(t0) // reset interrupt by setting mtimecmp to max
 | 
			
		||||
    csrw 0x14D, t2 // reset stime interrupts by doing the same.
 | 
			
		||||
    csrw stimecmp, t2 // reset stime interrupts by doing the same.
 | 
			
		||||
    
 | 
			
		||||
    li t0, 0x20
 | 
			
		||||
    csrc \MODE\()ip, t0
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user