= GIET_VM / PIC Driver = [[PageOutline]] The [source:soft/giet_vm/giet_drivers/pic_driver.c pic_driver.c] and [source:soft/giet_vm/giet_drivers/pic_driver.h 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 SEG_PIC_BASE value must be defined in the hard_config.h file. The addressable registers map is defined [source:soft/giet_vm/giet_drivers/pic_driver.h here]. == __Low level access functions__ == === void '''_pic_set_register'''( unsigned int irq_id, unsigned int index, unsigned int value ) === This function set a new value in register identified by (irq_id / index). * '''irq_id''' : input IRQ index. * '''index''' : register offset. * '''value''' : value to be written. === unsigned int '''_pic_get_register'''( unsigned int irq_id, unsigned int index ) === This function returns the value of register identified by (channel / index). * '''irq_id''' : input IRQ index. * '''index''' : register offset. == __access functions__ == === void '''_pic_init'''( unsigned int irq_id, unsigned int vaddr, unsigned int extend ) === This function initializes and activates a given external IRQ in the PIC component. It writes an XCU mailbox physical address in the IOPIC_ADDRESS and IOPIC_EXTEND registers, and enables the channel. * '''irq_id''' : input IRQ index. * '''vaddr''' : address of the destination XCU register * '''extend''' : cluster_xy for the destination XCU === void '''_pic_enable'''( unsigned int irq_id ) === This function enables a given external IRQ. The associated WTI maibox address is not modified. * '''irq_id''' : source PIC HWI channel === void '''_pic_disable'''( unsigned int irq_id) === This function disables a given given external IRQ. The associated WTI maibox address is not modified. * '''irq_id''' : source PIC HWI channel === unsigned int '''_pic_get_status'''( unsigned int irq_id ) === This function returns the status of a given HWI. * '''irq_id''' : source PIC HWI channel