wiki:mwr_driver

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

--

GIET_VM / MWR Driver

The mwr_driver.c and mwr_driver.h files define the MWR driver for the vci_mwmr_dma peripheral.

The vci_mwmr_dma component is a multi-channels DMA controller that can be used to connect an hardware coprocesseur to a VCI interconnect. This component provides the coprocessor one or several TO_COPROC or FROM_COPROC FIFO type communication channels, without address. Each T0_COPROC/FROM_COPROC port contains an hardware FIFO interface (DATA, R_WOK, W_ROK signals), plus three signals (REQ, ACK, BURSTS) allowing the coprocessor to request an integer number of data burst. Each burst contains a fixed number of 32 bits words. The burst length is an hardware parameter.

Each channel implements two running modes:

  • in MWMR mode the channel FSM transfer an infinite" stream of data to or from a MWMR software FIFO, implementing the 7 steps MWMR protocol.
  • in DMA mode the channel FSM transfer a fixed size chunk of data to or from a memory buffer, with an optional completion signaling interrupt.

It is an internal peripheral, that can be replicated in all clusters. Each cluster can contain at most one coprocessor.

The addressable registers map and command codes are defined here.

Coprocessor registers access functions

These functions can be used to access the specific coprocessor registers.

void _mwr_set_coproc_register( unsigned int cluster_xy , unsigned int index , unsigned int value )

This function set a a new value in a coprocessor register.

  • cluster_xy : cluster coordinates.
  • index : register index.
  • value : value to be written.

unsigned int _mwr_get coproc_register( unsigned int cluster_xy , unsigned int index)

  • cluster_xy : cluster coordinates.
  • index : register index.

Channel registers access functions

These functions access the communication channels registers contained in the vci_mwmr_dma controller.

void _mwr_set_channel_register( unsigned int cluster_xy , unsigned int channel , unsigned int index , unsigned int value )

This function set a a new value in a coprocessor register.

  • cluster_xy : cluster coordinates.
  • channel: channel index.
  • index : register index.
  • value : value to be written.

unsigned int _mwr_get channel_register( unsigned int cluster_xy , unsigned int channel, unsigned int index)

  • cluster_xy : cluster coordinates.
  • channel: channel index.
  • index : register index.

Interrupt Service Routine

void _mwr_isr( unsigned int irq_type, unsigned int irq_id, unsigned int channel )

This Interrupt Service Routine handles the IRQ signaling the completion of a data transfer for a channel running in DMA_IRQ mode). It set the _dma_done[x][y] synchronisation variable.