Giter Site home page Giter Site logo

Comments (6)

agrobman avatar agrobman commented on May 16, 2024

How do you initialize base field in meihap? how do you set up the interrupt vector table? what value do you get in t1 before jr t1? does it match with your interrupt handler start address?
can you single step your handler? can you get trace info from the CPU ( with logic analyzer)?
Can you simulate your code on RTL or ISS and get program trace ?

from cores-veer-eh1.

vit82 avatar vit82 commented on May 16, 2024

At the moment I simulate RTL only. Please, have a look at the waveform with the requested signals.Also attached are program code and its listing file.
image
issue50_listing.txt
issue50_program.txt

Register t3(x28) is used in the program insted t1. Before executing jr t3, t3 gets value 0x100016 - this is address of the desired interrupt handler (UART). So this looks correct.

MEIHAP gets value 2, this corresponds to uart_irq (level sensitive) connected to extintsrc_int[2]. The interrupt handler pointer (uart_handler) is stored in DCCM (offset 0x200000).

from cores-veer-eh1.

vit82 avatar vit82 commented on May 16, 2024

At the waveform PC_experssion jumps to 0x100016(uart_handler) after 0x100074. Next, CPU clears interrupt source UART_IRQ, but it takes quite many cycles. If I don't insert NOPs, MRET occurs early while UART_IRQ is still high. This is probably why MRET isn't executed.

from cores-veer-eh1.

agrobman avatar agrobman commented on May 16, 2024

from cores-veer-eh1.

agrobman avatar agrobman commented on May 16, 2024

you probably need to poll UART interrupt pending register and CPU MIP until no pending interrupts detected before exit the interrupt handler .. Remember, the UART may run on much slower clock than CPU so it can take quite a few CPU clocks to dis-assert interrupt request. Also there are a few CPU clocks for interrupt request signal to propagate to the core through PIC ...

from cores-veer-eh1.

aprnath avatar aprnath commented on May 16, 2024

At the waveform PC_experssion jumps to 0x100016(uart_handler) after 0x100074. Next, CPU clears interrupt source UART_IRQ, but it takes quite many cycles. If I don't insert NOPs, MRET occurs early while UART_IRQ is still high. This is probably why MRET isn't executed.

You must clear the IRQ source and validate that the IRQ has been cleared before executing MRET. Else the core will come right back into the handler if the input external interrupt pin is still high when the MRET executes.

Please open a new issue if you still have questions.

from cores-veer-eh1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.