Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

the question about the interrutor vertor table

the file of Nios II Software Developer's Handbook_v5 is not explicit.

can you help me?

1 all of the interruptor vertor table of nios is how to dispatch in the hardware address like the ARM from 0x0 to 0xff?

2 how to use the interrutor vertor API of the nios and how to register it and response it ?

3 have interrutor vertor functions the stable names by yourself ?

4 who has the whole of the interrutor vertor table of nios, and he has the example of using it completed in the program?

do you understand my means?

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by lucky@Dec 26 2005, 06:46 AM

    1 all of the interruptor vertor table of nios is how to dispatch in the hardware address like the arm from 0x0 to 0xff?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11781)

    --- quote end ---

    --- Quote End ---

    Yes, similar but a little bit simpler than ARM... you only have the IRQ pin to which all the software and hardware interrupts are redirected!

    --- Quote Start ---

    originally posted by lucky@Dec 26 2005, 06:46 AM

    2 how to use the interrutor vertor api of the nios and how to register it and response it ?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11781)

    --- quote end ---

    --- Quote End ---

    ??? There is an example at page 6-10 of the Nios II Software Developer&#39;s handbook...

    some other examples should be in the examples directory of altera...

    (just grepping gives some results

    pj@TOM /cygdrive/c/altera/kits/nios2_51/examples/software
    $ grep -rl alt_irq_register *
    board_diag/board_diag.c
    count_binary/count_binary.c
    tcm/timer_interrupt_latency.c

    ); other examples (very similar to those available in the Altera Directory) are also available in the demo we distribute with ERIKA Enterprise, in particular the 2 CPU and the FIFO demo available here (http://www.evidence.eu.com/nios2/literature.asp)

    --- Quote Start ---

    originally posted by lucky@Dec 26 2005, 06:46 AM

    3 have interrutor vertor functions the stable names by yourself ?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11781)

    --- quote end ---

    --- Quote End ---

    What you mean with "stable names"? you can link a function you wrote to the interrupt using alt_irq_register...

    --- Quote Start ---

    originally posted by lucky@Dec 26 2005, 06:46 AM

    4 who has the whole of the interrutor vertor table of nios, and he has the example of using it completed in the program?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11781)

    --- quote end ---

    --- Quote End ---

    There is only one exception vector, whose address is specified inside SOPCBuilder. Then, there is the ipending register, and all the rest is done in software...

    bye

    Paolo
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    thanks paolo.gai:

    i mean the interruptor vertor function names whether or not are fixed.

    for example: handle_button_interrupts ,handle_Timer0_interrupts. i want to know the rule of the interruptor vertor function names called.

    what are the 32 interruptor vertor function names ?

    lucky

    bye
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    ok... now maybe I understand...

    There is only one interrupt vector in nios, that is directly handled by the Altera HAL.

    Then, the asm handler written by Altera reads the pending register and calls a function out of a vector of function pointers with 32 locations.

    The 32 locations are filled with alt_irq_register, with the addresses you provide when you call the function.

    That is, it is up to you to specify your interrupt handler.

    It&#39;s like you attached an asm routine to the IRQ pin of your ARM7, and then inside the handler you decide which function have to be called...

    bye

    Paolo
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    ...Right, and you can see samples of IRQ registration by looking at one of the drivers that implements one.

    Take the UART, for example. It has an initialization routine, alt_avalon_uart_init, which registers an interrupt with the system. The IDE build process creates a file (alt_sys_init.c) which initializes all of your devices and registers all of their interrupts.

    Don&#39;t trouble yourself looking for an interrupt vector table. There isn&#39;t one. If, however, you are using the HAL, all IRQ numbers are defined in system.h.

    Best Regards,

    - slacker