Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMIO keybord interrtupt not triggering. #208

Open
Harish765 opened this issue Dec 3, 2023 · 5 comments
Open

MMIO keybord interrtupt not triggering. #208

Harish765 opened this issue Dec 3, 2023 · 5 comments

Comments

@Harish765
Copy link

Harish765 commented Dec 3, 2023

I have Assembeled the below code. then connected the MMIO keyboard and display simulator using "Connect to Program".

The value is updated properly in 0xffff0004 on button press but the interrupt is not triggered.

.text 

main:
	la t0, isrHandle
	li t1, 8
	li t3, 1

	la	t0, isrHandle
	li t1, 0x100

	csrrs	zero, 5, t0
	csrrs	zero, 4, t1
	csrrsi zero, 0, 0x1
	
	
loop_main:
	li t1, 10
	addi t1, t1, 1
	j loop_main
	
	
	
isrHandle:
	nop
	nop
	uret

When I ran a different program for timer interrupt that is working. what is the issue with the MMIO interrupt ?

@Harish765
Copy link
Author

rar_screenshot

@Harish765
Copy link
Author

csr_screenshot

@Harish765
Copy link
Author

attached the screen shot of the CSRs and MMIO address in the comments.

Please help with this issue have tried all the configuration and this issues seems to persist.

@Harish765
Copy link
Author

          if (updatedReceiverControl != 1) {

               System.out.println("EXTERNAL_INTERRUPT_KEYBOARD");
               InterruptController.registerExternalInterrupt(EXTERNAL_INTERRUPT_KEYBOARD);
           }

https://github.com/TheThirdOne/rars/blob/master/src/rars/tools/KeyboardAndDisplaySimulator.java#L774

The problem is this check fails and interrupt is not send ever.

when i created the rar with this check commented

          /*if (updatedReceiverControl != 1) */{

               System.out.println("EXTERNAL_INTERRUPT_KEYBOARD");
               InterruptController.registerExternalInterrupt(EXTERNAL_INTERRUPT_KEYBOARD);
           } 

The interrupt is properly triggered.

Why is this check here ?
my understanding is this updatedReceiverControl is set to one when key is pressed so this check will always fail right ?

@Harish765
Copy link
Author

@TheThirdOne The issue is blocking my project for more than a week. Please provide any help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant