Version 6 (modified by 8 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.
Low level access functions
void _pic_set_register( unsigned int channel, unsigned int index, unsigned int value )
This function set a new value in register identified by (channel / index).
unsigned int _pic_get_register( unsigned int channel, unsigned int index )
This function returns the value of register identified by (channel / index).
access functions
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_ADDRESS and IOPIC_EXTEND registers, and enables the channel.
- channel : source PIC HWI channel
- vaddr : address of the destination XCU register
- extend : cluster_xy for the destination XCU
void _pic_enable( unsigned int channel)
This function enables a given channel (i.e a given external IRQ). The associated WTI maibox address is not modified.
- channel : source PIC HWI channel
void _pic_disable( unsigned int channel)
This function disables a given channel (i.e a given external IRQ). The associated WTI maibox address is not modified.
- channel : source PIC HWI channel
unsigned int _pic_get_status( unsigned int channel )
This function returns the status of a given HWI channel.