AN 814: Intel Arria 10 Two x8-Lane JESD204B (Duplex) IP Cores Multi-Device Synchronization Reference Design

ID 683731
Date 1/30/2018
Public
Document Table of Contents

1.2.4.2. Custom Peripheral Access Macros in macros.c Source File

You can use the peripheral access macros to access specific information in CSR of the following peripherals:
  • Reset sequencer
  • JESD204B TX
  • JESD204B RX
  • PIO control
  • PIO status
  • Transceiver PHY Reset Controller
  • fPLL
  • Core PLL Reconfiguration
Table 5.  Custom Peripheral Access Macros in macros.cMost of the function prototypes below can be found in the macros.h header file located in the software folder.
Function Prototype Description
int CALC_BASE_ADDRESS_LINK (int base, int link) Calculates and returns the base address based on the link provided. Note the link needs to be 0 because there is only one reset sequencer in the JESD204B subsystem. Hence, set the MAX_LINKS parameter in the main.h header file to 1. You are responsible to set the parameter correctly to reflect the system configuration.
int CALC_BASE_ADDRESS_XCVR_NATIVE (int base, int instance) Calculate and returns the base address of transceiver reconfiguration based on the instance number of JESD204B IP core. The number of transceiver per JESD204B subsystem in the design is defined by MAX_INSTANCES parameter in the main.h header file. This function is not used due to the design doesn’t perform data rate reconfiguration.
int IORD_RESET_SEQUENCER_STATUS_REG (int link) Read reset sequencer status register at link and return the value.
int IORD_RESET_SEQUENCER_RESET_ACTIVE (int link) Read reset sequencer status register at link and return 1 if the reset active signal is asserted, else return 0.
void IOWR_RESET_SEQUENCER_INIT_RESET_SEQ (int link) Write reset sequencer at link to trigger full hardware reset sequence.
void IOWR_RESET_SEQUENCER_FORCE_RESET (int link, int val) Write reset sequencer at link to force assert or deassert resets based on the val value.
int IORD_JESD204_TX_STATUS0_REG (int link, int instance) Read the JESD204B TX CSR tx_status0 register at link and instance and return the value.
int IORD_JESD204_TX_SYNCN_SYSREF_CTRL_REG (int link, int instance) Read the JESD204B TX CSR syncn_sysref_ctrl register at link and instance and return the value.
void IOWR_JESD204_TX_SYNCN_SYSREF_CTRL_REG (int link, int instance, int val) Write val value into the JESD204B TX CSR syncn_sysref_ctrl register at link and instance.
int IORD_JESD204_RX_STATUS0_REG (int link, int instance) Read JESD204B CSR rx_status0 register at link and instance and return value.
int IORD_JESD204_RX_SYNCN_SYSREF_CTRL_REG (int link, int instance) Read JESD204B RX CSR syncn_sysref_ctrl register at link and instance and return value.
void IOWR_JESD204_RX_SYNCN_SYSREF_CTRL_REG (int link, int instance, int val) Write val value into JESD204B RX CSR syncn_sysref_ctrl register at link and instance.
int IORD_PIO_CONTROL_REG (void) Read the PIO control register and return the value.
void IOWR_PIO_CONTROL_REG (int val) Write val value into the PIO control register.
int IORD_PIO_STATUS_REG (void) Read the PIO status register and return the value.
int IORD_JESD204_TX_TEST_MODE_REG (int link, int instance) Read the JESD204B TX CSR tx_test register at link and instance and return the value.
int IORD_JESD204_RX_TEST_MODE_REG (int link, int instance) Read the JESD204B RX CSR rx_test register at link and instance and return the value.
void IOWR_JESD204_TX_TEST_MODE_REG (int link, int instance, int val) Write val value into the JESD204B TX CSR tx_test register at link and instance.
void IOWR_JESD204_RX_TEST_MODE_REG (int link, int instance, int val) Write val value into the JESD204B RX CSR rx_test register at link and instance.
int IORD_JESD204_RX_ERR0_REG (int link, int instance) Read the JESD204B RX CSR rx_err0 register at link and instance and return the value.
void IOWR_JESD204_RX_ERR0_REG (int link, int instance, int val) Write val value the JESD204B rx_err0 register at link and instance.
int IORD_JESD204_RX_ERR1_REG (int link, int instance) Read the JESD204B RX CSR rx_err1 register at link and instance and return the value.
void IOWR_JESD204_RX_ERR1_REG (int link, int instance, int val) Write val value the JESD204B rx_err1 register at link and instance.
int IORD_JESD204_TX_ERR_REG (int link, int instance) Read the JESD204B TX CSR tx_err register at link and instance and return the value.
void IOWR_JESD204_TX_ERR_REG (int link, int instance, int val) Write val value into the JESD204B TX CSR tx_err register at link an instance.
int IORD_JESD204_TX_ERR_EN_REG (int link, int instance) Read the JESD204B TX CSR tx_err_enable register at link and instance and return the value.
void IOWR_JESD204_TX_ERR_EN_REG (int link, int instance, int val) Write val value into the JESD204B TX CSR tx_err_enable register at link and instance.
int IORD_JESD204_RX_ERR_EN_REG (int link, int instance) Read the JESD204B RX CSR rx_err_enable register at link and instance and return the value.
void IOWR_JESD204_RX_ERR_EN_REG (int link, int instance, int val) Write the JESD204B RX CSR rx_err_enable register at link and instance.