Wednesday, July 3, 2019

Creating NIOS design

http://scale.engin.brown.edu/classes/EN2911XF12/nios2.pdf

Directly Editing the Makefile
https://www.intel.com/content/www/us/en/programmable/support/support-resources/knowledge-base/solutions/rd02212012_654.html

Nested Interrupts in NIOS

https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/nios2/n2sw_nii52006.pdf


For the IIC, irq is the IRQ number. Interrupt priority corresponds inversely to
the IRQ number. Therefore, IRQ0 represents the highest priority interrupt and
IRQ31 is the lowest.

Nested Hardware Interrupts with the Internal Interrupt Controller
To implement nested hardware interrupts with the IIC, use the
alt_irq_interruptible() and alt_irq_non_interruptible() functions to bracket
code in a processor-intensive ISR. The call to alt_irq_interruptible() adjusts the
interrupt mask so that higher-priority interrupts can take control from the running
ISR. When your ISR calls alt_irq_non_interruptible(), the interrupt mask is
returned to its previous state.

If you use a separate exception stack with the IIC, you cannot nest hardware
interrupts. For more information about separate exception stacks, refer to “Use a
Separate Exception Stack”.

--
Table 8–1. Enhanced HAL Interrupt API Functions
Function Name Implemented By
alt_ic_isr_register() Interrupt controller driver (1)
alt_ic_irq_enable() Interrupt controller driver (1)
alt_ic_irq_disable() Interrupt controller driver (1)
alt_ic_irq_enabled() Interrupt controller driver (1)
alt_irq_disable_all() HAL
alt_irq_enable_all() HAL
alt_irq_enabled() HAL

The Legacy HAL Interrupt API The legacy HAL interrupt API defines the following functions to manage hardware interrupt processing:
■ alt_irq_register()
■ alt_irq_disable()
■ alt_irq_enable()
■ alt_irq_disable_all()
■ alt_irq_enable_all()
■ alt_irq_interruptible()
■ alt_irq_non_interruptible()
■ alt_irq_enabled()
--

https://forums.intel.com/s/question/0D50P00003yyKIXSA2/enhanced-interrupt-api?language=en_US
https://forums.intel.com/s/question/0D50P00003yyMw5SAE/why-i-can-not-find-the-altirqenable-function-in-halsrceclipse-for-niosii?language=en_US



alt_putstr(char *) is function to print in the NIOS console.

If download failed without any reason, please refresh connections few times and make sure the Blaster II connection is available and Click APPLY and then Debug.

Calling Standard Library/BSP functions, Re-entrant and Stack Usage

If a task is specified as re-entrant, mkreent() function is called to allocate space for global and task specific data pointed by _impure pointer. Otherwise, just 4 bytes are allocated (IMPURE variable) just to store the _impure pointer alone.

https://www.segger.com/downloads/embos/UM01035_embOS_NIOS2.pdf
5.3 Reentrancy