change(soc): vectorize bitscrambler regsiter layout

This commit is contained in:
morris
2024-11-13 14:33:07 +08:00
parent ab75a94877
commit 83c9cffd2b
7 changed files with 259 additions and 154 deletions
@@ -6,35 +6,10 @@
#pragma once
#include "sdkconfig.h"
#if CONFIG_SOC_BITSCRAMBLER_SUPPORTED
#include "soc/bitscrambler_struct.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* @brief The TX and RX BitScramblers have registers that work in the same way, but that are
* in different locations. This struct defines those registers; if we address the TX and
* RX bitscramblers through this we can mostly use the same code for both.
*/
typedef struct {
volatile bitscrambler_tx_inst_cfg0_reg_t *inst_cfg0;
volatile bitscrambler_tx_inst_cfg1_reg_t *inst_cfg1;
volatile bitscrambler_tx_lut_cfg0_reg_t *lut_cfg0;
volatile bitscrambler_tx_lut_cfg1_reg_t *lut_cfg1;
volatile bitscrambler_tx_tailing_bits_reg_t *trailing_bits;
volatile bitscrambler_tx_ctrl_reg_t *ctrl;
volatile bitscrambler_tx_state_reg_t *state;
} bitscrambler_regs_t;
extern const bitscrambler_regs_t bitscramblers_reg[2];
#ifdef __cplusplus
}
#endif
#endif
+26 -36
View File
@@ -19,85 +19,75 @@ typedef enum {
} bitscrambler_direction_t;
/**
* @brief BitScrambler LUT width
* @brief BitScrambler LUT (look up table) width
*/
typedef enum {
BITSCRAMBLER_LUT_WIDTH_8BIT = 0,
BITSCRAMBLER_LUT_WIDTH_16BIT = 1,
BITSCRAMBLER_LUT_WIDTH_32BIT = 2
BITSCRAMBLER_LUT_WIDTH_8BIT = 0, /*!< 8-bit LUT */
BITSCRAMBLER_LUT_WIDTH_16BIT = 1, /*!< 16-bit LUT */
BITSCRAMBLER_LUT_WIDTH_32BIT = 2, /*!< 32-bit LUT */
} bitscrambler_lut_width_t;
/**
* @brief BitScrambler loopback select
* @brief EOF signal generating mode of bitscrambler
*/
typedef enum {
BITSCRAMBLER_LOOP_DISABLE = 0,
BITSCRAMBLER_LOOP_ENABLE = 1
} bitscrambler_loop_mode_t;
/**
* @brief EOF mode of bitscrambler
*/
typedef enum {
BITSCRAMBLER_EOF_MODE_READ = 0,
BITSCRAMBLER_EOF_MODE_WRITE = 1
BITSCRAMBLER_EOF_MODE_READ = 0, /*!< EOF is counted by reading the source FIFO */
BITSCRAMBLER_EOF_MODE_WRITE = 1, /*!< EOF is counted by writing the destination FIFO */
} bitscrambler_eof_mode_t;
/**
* @brief Condition mode of bitscrambler
*/
typedef enum {
BITSCRAMBLER_COND_MODE_LESSTHAN = 0,
BITSCRAMBLER_COND_MODE_NOTEQUAL = 1
BITSCRAMBLER_COND_MODE_LESSTHAN = 0, /*!< Use "<=" to generate the condition */
BITSCRAMBLER_COND_MODE_NOTEQUAL = 1, /*!< Use "!=" to generate the condition */
} bitscrambler_cond_mode_t;
/**
* @brief Condition mode of bitscrambler
* @brief Prefetch mode of bitscrambler
*/
typedef enum {
BITSCRAMBLER_PREFETCH_ENABLED = 0,
BITSCRAMBLER_PREFETCH_DISABLED = 1
BITSCRAMBLER_PREFETCH_ENABLED = 0, /*!< Hardware prefetch is enabled */
BITSCRAMBLER_PREFETCH_DISABLED = 1, /*!< Hardware prefetch is disabled, but the bitscrambler instructions can still do the prefetch */
} bitscrambler_prefetch_mode_t;
/**
* @brief Condition mode of bitscrambler
* @brief Halt mode of bitscrambler
*/
typedef enum {
BITSCRAMBLER_HALT_WAIT_WRITES = 0,
BITSCRAMBLER_HALT_IGNORE_WRITES = 1
BITSCRAMBLER_HALT_WAIT_WRITES = 0, /*!< Wait data write back */
BITSCRAMBLER_HALT_IGNORE_WRITES = 1, /*!< Ignore write data back */
} bitscrambler_halt_mode_t;
/**
* @brief Condition mode of bitscrambler
* @brief Dummy mode of bitscrambler
*/
typedef enum {
BITSCRAMBLER_DUMMY_MODE_HALT = 0,
BITSCRAMBLER_DUMMY_MODE_DUMMY = 1
BITSCRAMBLER_DUMMY_MODE_HALT = 0, /*!< Halt and wait the read data */
BITSCRAMBLER_DUMMY_MODE_DUMMY = 1, /*!< Ignore the read data */
} bitscrambler_dummy_mode_t;
/**
* @brief Condition mode of bitscrambler
* @brief Commands to set the state of bitscrambler
*/
typedef enum {
BITSCRAMBLER_SET_STATE_RUN,
BITSCRAMBLER_SET_STATE_HALT,
BITSCRAMBLER_SET_STATE_PAUSE
BITSCRAMBLER_SET_STATE_RUN, /*!< Run */
BITSCRAMBLER_SET_STATE_HALT, /*!< Halt */
BITSCRAMBLER_SET_STATE_PAUSE, /*!< Pause */
} bitscrambler_set_state_t;
/**
* @brief Status of bitscrambler
*/
typedef enum {
BITSCRAMBLER_STATE_IDLE,
BITSCRAMBLER_STATE_RUN,
BITSCRAMBLER_STATE_WAIT,
BITSCRAMBLER_STATE_PAUSED,
BITSCRAMBLER_STATE_IDLE, /*!< Idle (halt) */
BITSCRAMBLER_STATE_RUN, /*!< Running */
BITSCRAMBLER_STATE_WAIT, /*!< Waiting data write back */
BITSCRAMBLER_STATE_PAUSED, /*!< Paused */
BITSCRAMBLER_STATE_UNKNOWN /*!< Invalid, should never be returned */
} bitscrambler_state_t;
#ifdef __cplusplus
}
#endif