| 1 | = GIET_VM / PIC Driver = |
| 2 | |
| 3 | [[PageOutline]] |
| 4 | |
| 5 | |
| 6 | 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. |
| 7 | |
| 8 | 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. This is therefore an external, non replicated, peripheral. |
| 9 | |
| 10 | The virtual base address of the segment associated to the component is: |
| 11 | vbase = SEG_PIC_BASE + cluster_io << 32 |
| 12 | |
| 13 | The SEG_PIC_BASE value must be defined in the hard_config.h file. |
| 14 | |
| 15 | The addressable registers map is defined [source:soft/giet_vm/giet_drivers/pic_driver.h here]. |
| 16 | |
| 17 | |
| 18 | |
| 19 | === void '''_pic_set_register'''( unsigned int channel, unsigned int index, unsigned int value ) === |
| 20 | This low level function set a new value in register (channel / index). |
| 21 | |
| 22 | === unsigned int '''_pic_get_register'''( unsigned int channel, unsigned int index ) === |
| 23 | This low level function returns the value of register (channel / index). |
| 24 | |
| 25 | === void '''_pic_init'''( unsigned int channel, unsigned int vaddr, unsigned int extend ) === |
| 26 | This function initializes the XICU target physical address (vaddr + extend) corresponding to a given HWI channel. |
| 27 | * channel : source PIC HWI channel |
| 28 | * vaddr : virtual address of the destination XCU register |
| 29 | * extend : cluster_xy for the destination XCU |
| 30 | |
| 31 | === unsigned int '''_pic_get_status'''( unsigned int channel ) === |
| 32 | This function returns the status of a given HWI channel. |