/*
  Register definitions for slave core: WR Transmission control, status and debug

  * File           : ./doc/wr_transmission.h
  * Author         : auto-generated by wbgen2 from wr_transmission_wb.wb
  * Created        : Wed May  3 10:58:23 2017
  * Standard       : ANSI C

    THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE wr_transmission_wb.wb
    DO NOT HAND-EDIT UNLESS IT'S ABSOLUTELY NECESSARY!

*/

#ifndef __WBGEN2_REGDEFS_WR_TRANSMISSION_WB_WB
#define __WBGEN2_REGDEFS_WR_TRANSMISSION_WB_WB

#ifdef __KERNEL__
#include <linux/types.h>
#else
#include <inttypes.h>
#endif

#if defined( __GNUC__)
#define PACKED __attribute__ ((packed))
#else
#error "Unsupported compiler?"
#endif

#ifndef __WBGEN2_MACROS_DEFINED__
#define __WBGEN2_MACROS_DEFINED__
#define WBGEN2_GEN_MASK(offset, size) (((1<<(size))-1) << (offset))
#define WBGEN2_GEN_WRITE(value, offset, size) (((value) & ((1<<(size))-1)) << (offset))
#define WBGEN2_GEN_READ(reg, offset, size) (((reg) >> (offset)) & ((1<<(size))-1))
#define WBGEN2_SIGN_EXTEND(value, bits) (((value) & (1<<bits) ? ~((1<<(bits))-1): 0 ) | (value))
#endif


/* definitions for register: Statistics status and ctrl register */

/* definitions for field: Reset statistics in reg: Statistics status and ctrl register */
#define WR_TRANSMISSION_SSCR1_RST_STATS       WBGEN2_GEN_MASK(0, 1)

/* definitions for field: Reset tx seq id in reg: Statistics status and ctrl register */
#define WR_TRANSMISSION_SSCR1_RST_SEQ_ID      WBGEN2_GEN_MASK(1, 1)

/* definitions for field: Snapshot statistics in reg: Statistics status and ctrl register */
#define WR_TRANSMISSION_SSCR1_SNAPSHOT_STATS  WBGEN2_GEN_MASK(2, 1)

/* definitions for field: Latency accumulator overflow in reg: Statistics status and ctrl register */
#define WR_TRANSMISSION_SSCR1_RX_LATENCY_ACC_OVERFLOW WBGEN2_GEN_MASK(3, 1)

/* definitions for field: Reset timestamp cycles in reg: Statistics status and ctrl register */
#define WR_TRANSMISSION_SSCR1_RST_TS_CYC_MASK WBGEN2_GEN_MASK(4, 28)
#define WR_TRANSMISSION_SSCR1_RST_TS_CYC_SHIFT 4
#define WR_TRANSMISSION_SSCR1_RST_TS_CYC_W(value) WBGEN2_GEN_WRITE(value, 4, 28)
#define WR_TRANSMISSION_SSCR1_RST_TS_CYC_R(reg) WBGEN2_GEN_READ(reg, 4, 28)

/* definitions for register: Statistics status and ctrl register */

/* definitions for field: Reset timestamp 32 LSB of TAI in reg: Statistics status and ctrl register */
#define WR_TRANSMISSION_SSCR2_RST_TS_TAI_LSB_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_SSCR2_RST_TS_TAI_LSB_SHIFT 0
#define WR_TRANSMISSION_SSCR2_RST_TS_TAI_LSB_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_SSCR2_RST_TS_TAI_LSB_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Tx statistics */

/* definitions for field: WR Streamer frame sent count in reg: Tx statistics */
#define WR_TRANSMISSION_TX_STAT_TX_SENT_CNT_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_TX_STAT_TX_SENT_CNT_SHIFT 0
#define WR_TRANSMISSION_TX_STAT_TX_SENT_CNT_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_TX_STAT_TX_SENT_CNT_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Rx statistics */

/* definitions for field: WR Streamer frame received count in reg: Rx statistics */
#define WR_TRANSMISSION_RX_STAT1_RX_RCVD_CNT_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_RX_STAT1_RX_RCVD_CNT_SHIFT 0
#define WR_TRANSMISSION_RX_STAT1_RX_RCVD_CNT_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_RX_STAT1_RX_RCVD_CNT_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Rx statistics */

/* definitions for field: WR Streamer frame loss count in reg: Rx statistics */
#define WR_TRANSMISSION_RX_STAT2_RX_LOSS_CNT_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_RX_STAT2_RX_LOSS_CNT_SHIFT 0
#define WR_TRANSMISSION_RX_STAT2_RX_LOSS_CNT_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_RX_STAT2_RX_LOSS_CNT_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Rx statistics */

/* definitions for field: WR Streamer frame latency in reg: Rx statistics */
#define WR_TRANSMISSION_RX_STAT3_RX_LATENCY_MAX_MASK WBGEN2_GEN_MASK(0, 28)
#define WR_TRANSMISSION_RX_STAT3_RX_LATENCY_MAX_SHIFT 0
#define WR_TRANSMISSION_RX_STAT3_RX_LATENCY_MAX_W(value) WBGEN2_GEN_WRITE(value, 0, 28)
#define WR_TRANSMISSION_RX_STAT3_RX_LATENCY_MAX_R(reg) WBGEN2_GEN_READ(reg, 0, 28)

/* definitions for register: Rx statistics */

/* definitions for field: WR Streamer frame latency in reg: Rx statistics */
#define WR_TRANSMISSION_RX_STAT4_RX_LATENCY_MIN_MASK WBGEN2_GEN_MASK(0, 28)
#define WR_TRANSMISSION_RX_STAT4_RX_LATENCY_MIN_SHIFT 0
#define WR_TRANSMISSION_RX_STAT4_RX_LATENCY_MIN_W(value) WBGEN2_GEN_WRITE(value, 0, 28)
#define WR_TRANSMISSION_RX_STAT4_RX_LATENCY_MIN_R(reg) WBGEN2_GEN_READ(reg, 0, 28)

/* definitions for register: Rx statistics */

/* definitions for field: WR Streamer frame latency in reg: Rx statistics */
#define WR_TRANSMISSION_RX_STAT5_RX_LATENCY_ACC_LSB_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_RX_STAT5_RX_LATENCY_ACC_LSB_SHIFT 0
#define WR_TRANSMISSION_RX_STAT5_RX_LATENCY_ACC_LSB_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_RX_STAT5_RX_LATENCY_ACC_LSB_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Rx statistics */

/* definitions for field: WR Streamer frame latency in reg: Rx statistics */
#define WR_TRANSMISSION_RX_STAT6_RX_LATENCY_ACC_MSB_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_RX_STAT6_RX_LATENCY_ACC_MSB_SHIFT 0
#define WR_TRANSMISSION_RX_STAT6_RX_LATENCY_ACC_MSB_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_RX_STAT6_RX_LATENCY_ACC_MSB_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Rx statistics */

/* definitions for field: WR Streamer frame latency counter in reg: Rx statistics */
#define WR_TRANSMISSION_RX_STAT7_RX_LATENCY_ACC_CNT_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_RX_STAT7_RX_LATENCY_ACC_CNT_SHIFT 0
#define WR_TRANSMISSION_RX_STAT7_RX_LATENCY_ACC_CNT_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_RX_STAT7_RX_LATENCY_ACC_CNT_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Rx statistics */

/* definitions for field: WR Streamer block loss count in reg: Rx statistics */
#define WR_TRANSMISSION_RX_STAT8_RX_LOST_BLOCK_CNT_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_RX_STAT8_RX_LOST_BLOCK_CNT_SHIFT 0
#define WR_TRANSMISSION_RX_STAT8_RX_LOST_BLOCK_CNT_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_RX_STAT8_RX_LOST_BLOCK_CNT_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Tx Config Reg 0 */

/* definitions for field: Ethertype in reg: Tx Config Reg 0 */
#define WR_TRANSMISSION_TX_CFG0_ETHERTYPE_MASK WBGEN2_GEN_MASK(0, 16)
#define WR_TRANSMISSION_TX_CFG0_ETHERTYPE_SHIFT 0
#define WR_TRANSMISSION_TX_CFG0_ETHERTYPE_W(value) WBGEN2_GEN_WRITE(value, 0, 16)
#define WR_TRANSMISSION_TX_CFG0_ETHERTYPE_R(reg) WBGEN2_GEN_READ(reg, 0, 16)

/* definitions for register: Tx Config Reg 1 */

/* definitions for field: MAC Local LSB in reg: Tx Config Reg 1 */
#define WR_TRANSMISSION_TX_CFG1_MAC_LOCAL_LSB_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_TX_CFG1_MAC_LOCAL_LSB_SHIFT 0
#define WR_TRANSMISSION_TX_CFG1_MAC_LOCAL_LSB_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_TX_CFG1_MAC_LOCAL_LSB_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Tx Config Reg 2 */

/* definitions for field: MAC Local MSB in reg: Tx Config Reg 2 */
#define WR_TRANSMISSION_TX_CFG2_MAC_LOCAL_MSB_MASK WBGEN2_GEN_MASK(0, 16)
#define WR_TRANSMISSION_TX_CFG2_MAC_LOCAL_MSB_SHIFT 0
#define WR_TRANSMISSION_TX_CFG2_MAC_LOCAL_MSB_W(value) WBGEN2_GEN_WRITE(value, 0, 16)
#define WR_TRANSMISSION_TX_CFG2_MAC_LOCAL_MSB_R(reg) WBGEN2_GEN_READ(reg, 0, 16)

/* definitions for register: Tx Config Reg 3 */

/* definitions for field: MAC Target LSB in reg: Tx Config Reg 3 */
#define WR_TRANSMISSION_TX_CFG3_MAC_TARGET_LSB_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_TX_CFG3_MAC_TARGET_LSB_SHIFT 0
#define WR_TRANSMISSION_TX_CFG3_MAC_TARGET_LSB_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_TX_CFG3_MAC_TARGET_LSB_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Tx Config Reg 4 */

/* definitions for field: MAC Target MSB in reg: Tx Config Reg 4 */
#define WR_TRANSMISSION_TX_CFG4_MAC_TARGET_MSB_MASK WBGEN2_GEN_MASK(0, 16)
#define WR_TRANSMISSION_TX_CFG4_MAC_TARGET_MSB_SHIFT 0
#define WR_TRANSMISSION_TX_CFG4_MAC_TARGET_MSB_W(value) WBGEN2_GEN_WRITE(value, 0, 16)
#define WR_TRANSMISSION_TX_CFG4_MAC_TARGET_MSB_R(reg) WBGEN2_GEN_READ(reg, 0, 16)

/* definitions for register: Rx Config Reg 0 */

/* definitions for field: Ethertype in reg: Rx Config Reg 0 */
#define WR_TRANSMISSION_RX_CFG0_ETHERTYPE_MASK WBGEN2_GEN_MASK(0, 16)
#define WR_TRANSMISSION_RX_CFG0_ETHERTYPE_SHIFT 0
#define WR_TRANSMISSION_RX_CFG0_ETHERTYPE_W(value) WBGEN2_GEN_WRITE(value, 0, 16)
#define WR_TRANSMISSION_RX_CFG0_ETHERTYPE_R(reg) WBGEN2_GEN_READ(reg, 0, 16)

/* definitions for field: Accept Broadcast in reg: Rx Config Reg 0 */
#define WR_TRANSMISSION_RX_CFG0_ACCEPT_BROADCAST WBGEN2_GEN_MASK(16, 1)

/* definitions for field: Filter Remote in reg: Rx Config Reg 0 */
#define WR_TRANSMISSION_RX_CFG0_FILTER_REMOTE WBGEN2_GEN_MASK(17, 1)

/* definitions for register: Rx Config Reg 1 */

/* definitions for field: MAC Local LSB in reg: Rx Config Reg 1 */
#define WR_TRANSMISSION_RX_CFG1_MAC_LOCAL_LSB_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_RX_CFG1_MAC_LOCAL_LSB_SHIFT 0
#define WR_TRANSMISSION_RX_CFG1_MAC_LOCAL_LSB_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_RX_CFG1_MAC_LOCAL_LSB_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Rx Config Reg 2 */

/* definitions for field: MAC Local MSB in reg: Rx Config Reg 2 */
#define WR_TRANSMISSION_RX_CFG2_MAC_LOCAL_MSB_MASK WBGEN2_GEN_MASK(0, 16)
#define WR_TRANSMISSION_RX_CFG2_MAC_LOCAL_MSB_SHIFT 0
#define WR_TRANSMISSION_RX_CFG2_MAC_LOCAL_MSB_W(value) WBGEN2_GEN_WRITE(value, 0, 16)
#define WR_TRANSMISSION_RX_CFG2_MAC_LOCAL_MSB_R(reg) WBGEN2_GEN_READ(reg, 0, 16)

/* definitions for register: Rx Config Reg 3 */

/* definitions for field: MAC Remote LSB in reg: Rx Config Reg 3 */
#define WR_TRANSMISSION_RX_CFG3_MAC_REMOTE_LSB_MASK WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_RX_CFG3_MAC_REMOTE_LSB_SHIFT 0
#define WR_TRANSMISSION_RX_CFG3_MAC_REMOTE_LSB_W(value) WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_RX_CFG3_MAC_REMOTE_LSB_R(reg) WBGEN2_GEN_READ(reg, 0, 32)

/* definitions for register: Rx Config Reg 4 */

/* definitions for field: MAC Remote MSB in reg: Rx Config Reg 4 */
#define WR_TRANSMISSION_RX_CFG4_MAC_REMOTE_MSB_MASK WBGEN2_GEN_MASK(0, 16)
#define WR_TRANSMISSION_RX_CFG4_MAC_REMOTE_MSB_SHIFT 0
#define WR_TRANSMISSION_RX_CFG4_MAC_REMOTE_MSB_W(value) WBGEN2_GEN_WRITE(value, 0, 16)
#define WR_TRANSMISSION_RX_CFG4_MAC_REMOTE_MSB_R(reg) WBGEN2_GEN_READ(reg, 0, 16)

/* definitions for register: Rx Config Reg 5 */

/* definitions for field: Fixed Latency in reg: Rx Config Reg 5 */
#define WR_TRANSMISSION_RX_CFG5_FIXED_LATENCY_MASK WBGEN2_GEN_MASK(0, 28)
#define WR_TRANSMISSION_RX_CFG5_FIXED_LATENCY_SHIFT 0
#define WR_TRANSMISSION_RX_CFG5_FIXED_LATENCY_W(value) WBGEN2_GEN_WRITE(value, 0, 28)
#define WR_TRANSMISSION_RX_CFG5_FIXED_LATENCY_R(reg) WBGEN2_GEN_READ(reg, 0, 28)

/* definitions for register: TxRx Config Override */

/* definitions for field: Tx Ethertype in reg: TxRx Config Override */
#define WR_TRANSMISSION_CFG_OR_TX_ETHTYPE     WBGEN2_GEN_MASK(0, 1)

/* definitions for field: Tx MAC Local in reg: TxRx Config Override */
#define WR_TRANSMISSION_CFG_OR_TX_MAC_LOC     WBGEN2_GEN_MASK(1, 1)

/* definitions for field: Tx MAC Target in reg: TxRx Config Override */
#define WR_TRANSMISSION_CFG_OR_TX_MAC_TAR     WBGEN2_GEN_MASK(2, 1)

/* definitions for field: Rx Ethertype in reg: TxRx Config Override */
#define WR_TRANSMISSION_CFG_OR_RX_ETHERTYPE   WBGEN2_GEN_MASK(16, 1)

/* definitions for field: Rx MAC Local in reg: TxRx Config Override */
#define WR_TRANSMISSION_CFG_OR_RX_MAC_LOC     WBGEN2_GEN_MASK(17, 1)

/* definitions for field: Rx MAC Remote in reg: TxRx Config Override */
#define WR_TRANSMISSION_CFG_OR_RX_MAC_REM     WBGEN2_GEN_MASK(18, 1)

/* definitions for field: Rx Accept Broadcast in reg: TxRx Config Override */
#define WR_TRANSMISSION_CFG_OR_RX_ACC_BROADCAST WBGEN2_GEN_MASK(19, 1)

/* definitions for field: Rx Filter Remote in reg: TxRx Config Override */
#define WR_TRANSMISSION_CFG_OR_RX_FTR_REMOTE  WBGEN2_GEN_MASK(20, 1)

/* definitions for field: Rx Fixed Latency  in reg: TxRx Config Override */
#define WR_TRANSMISSION_CFG_OR_RX_FIX_LAT     WBGEN2_GEN_MASK(21, 1)

/* definitions for register: DBG Control register */

/* definitions for field: Debug Tx (0) or Rx (1) in reg: DBG Control register */
#define WR_TRANSMISSION_DBG_CTRL_MUX          WBGEN2_GEN_MASK(0, 1)

/* definitions for field: Debug Start byte in reg: DBG Control register */
#define WR_TRANSMISSION_DBG_CTRL_START_BYTE_MASK WBGEN2_GEN_MASK(8, 8)
#define WR_TRANSMISSION_DBG_CTRL_START_BYTE_SHIFT 8
#define WR_TRANSMISSION_DBG_CTRL_START_BYTE_W(value) WBGEN2_GEN_WRITE(value, 8, 8)
#define WR_TRANSMISSION_DBG_CTRL_START_BYTE_R(reg) WBGEN2_GEN_READ(reg, 8, 8)

/* definitions for register: DBG Data */

/* definitions for register: DBG RX_BVALUE */

/* definitions for register: DBG tx bvalue */

/* definitions for register: Test value */

/* definitions for field: DUMMY value to read in reg: Test value */
#define WR_TRANSMISSION_DUMMY_DUMMY_MASK      WBGEN2_GEN_MASK(0, 32)
#define WR_TRANSMISSION_DUMMY_DUMMY_SHIFT     0
#define WR_TRANSMISSION_DUMMY_DUMMY_W(value)  WBGEN2_GEN_WRITE(value, 0, 32)
#define WR_TRANSMISSION_DUMMY_DUMMY_R(reg)    WBGEN2_GEN_READ(reg, 0, 32)

PACKED struct WR_TRANSMISSION_WB {
  /* [0x0]: REG Statistics status and ctrl register */
  uint32_t SSCR1;
  /* [0x4]: REG Statistics status and ctrl register */
  uint32_t SSCR2;
  /* [0x8]: REG Tx statistics */
  uint32_t TX_STAT;
  /* [0xc]: REG Rx statistics */
  uint32_t RX_STAT1;
  /* [0x10]: REG Rx statistics */
  uint32_t RX_STAT2;
  /* [0x14]: REG Rx statistics */
  uint32_t RX_STAT3;
  /* [0x18]: REG Rx statistics */
  uint32_t RX_STAT4;
  /* [0x1c]: REG Rx statistics */
  uint32_t RX_STAT5;
  /* [0x20]: REG Rx statistics */
  uint32_t RX_STAT6;
  /* [0x24]: REG Rx statistics */
  uint32_t RX_STAT7;
  /* [0x28]: REG Rx statistics */
  uint32_t RX_STAT8;
  /* [0x2c]: REG Tx Config Reg 0 */
  uint32_t TX_CFG0;
  /* [0x30]: REG Tx Config Reg 1 */
  uint32_t TX_CFG1;
  /* [0x34]: REG Tx Config Reg 2 */
  uint32_t TX_CFG2;
  /* [0x38]: REG Tx Config Reg 3 */
  uint32_t TX_CFG3;
  /* [0x3c]: REG Tx Config Reg 4 */
  uint32_t TX_CFG4;
  /* [0x40]: REG Rx Config Reg 0 */
  uint32_t RX_CFG0;
  /* [0x44]: REG Rx Config Reg 1 */
  uint32_t RX_CFG1;
  /* [0x48]: REG Rx Config Reg 2 */
  uint32_t RX_CFG2;
  /* [0x4c]: REG Rx Config Reg 3 */
  uint32_t RX_CFG3;
  /* [0x50]: REG Rx Config Reg 4 */
  uint32_t RX_CFG4;
  /* [0x54]: REG Rx Config Reg 5 */
  uint32_t RX_CFG5;
  /* [0x58]: REG TxRx Config Override */
  uint32_t CFG;
  /* [0x5c]: REG DBG Control register */
  uint32_t DBG_CTRL;
  /* [0x60]: REG DBG Data */
  uint32_t DBG_DATA;
  /* [0x64]: REG DBG RX_BVALUE */
  uint32_t DBG_RX_BVALUE;
  /* [0x68]: REG DBG tx bvalue */
  uint32_t DBG_TX_BVALUE;
  /* [0x6c]: REG Test value */
  uint32_t DUMMY;
};

#endif
