wiki:pic_driver

Version 4 (modified by alain, 9 years ago) (diff)

--

GIET_VM / PIC Driver

The pic_driver.c and pic_driver.h files define the PIC driver.

The vci_pic component is a multi-channels interrupt controller, available in the SoCLib components library. This component translate an hardware interrupt generated by an external peripheral (HWI) to a write-triggered interrupt (WTI) that will be sent to an internal vci_xcu in a given cluster. The PIC component is therefore an external, non replicated peripheral.

The virtual base address of the segment associated to the component is:

vbase = SEG_PIC_BASE + cluster_io << 32

The SEG_PIC_BASE value must be defined in the hard_config.h file.

The addressable registers map is defined here.

void _pic_set_register( unsigned int channel, unsigned int index, unsigned int value )

This low level function set a new value in register (channel / index).

unsigned int _pic_get_register( unsigned int channel, unsigned int index )

This low level function returns the value of register (channel / index).

void _pic_init( unsigned int channel, unsigned int vaddr, unsigned int extend )

This function initializes and activates a given channel (i.e. a given external IRQ) in the PIC component. It writes an XCU mailbox physical address in the IOPIC_ADDR and IOPIC_EST registers, and writes a non-zero value in IOPIC_MASK register.

  • channel : source PIC HWI channel
  • vaddr : address of the destination XCU register
  • extend : cluster_xy for the destination XCU

unsigned int _pic_get_status( unsigned int channel )

This function returns the status of a given HWI channel.