OpenOCD
batch.c File Reference
Include dependency graph for batch.c:

Go to the source code of this file.

Macros

#define BATCH_RESERVED_SCANS   1
 
#define DMI_SCAN_BUF_SIZE   (DIV_ROUND_UP(DMI_SCAN_MAX_BIT_LENGTH, 8))
 
#define DMI_SCAN_MAX_BIT_LENGTH   (DTM_DMI_MAX_ADDRESS_LENGTH + DTM_DMI_DATA_LENGTH + DTM_DMI_OP_LENGTH)
 
#define DTM_DMI_MAX_ADDRESS_LENGTH   ((1<<DTM_DTMCS_ABITS_LENGTH)-1)
 

Functions

static void add_idle_before_batch (const struct riscv_batch *batch, size_t start_idx, const struct riscv_scan_delays *delays)
 
static unsigned int decode_dmi (const struct riscv_batch *batch, char *text, uint32_t address, uint32_t data)
 
static unsigned int get_delay (const struct riscv_batch *batch, size_t scan_idx, const struct riscv_scan_delays *delays, bool resets_delays, size_t reset_delays_after)
 
static unsigned int get_dmi_scan_length (const struct target *target)
 
static void log_batch (const struct riscv_batch *batch, size_t start_idx, const struct riscv_scan_delays *delays, bool resets_delays, size_t reset_delays_after)
 
static void log_dmi_decoded (const struct riscv_batch *batch, bool write, uint32_t address, uint32_t data)
 
size_t riscv_batch_add_dmi_read (struct riscv_batch *batch, uint32_t address, enum riscv_scan_delay_class delay_class)
 
void riscv_batch_add_dmi_write (struct riscv_batch *batch, uint32_t address, uint32_t data, bool read_back, enum riscv_scan_delay_class delay_class)
 
void riscv_batch_add_nop (struct riscv_batch *batch)
 
struct riscv_batchriscv_batch_alloc (struct target *target, size_t scans)
 
size_t riscv_batch_available_scans (struct riscv_batch *batch)
 
size_t riscv_batch_finished_scans (const struct riscv_batch *batch)
 
void riscv_batch_free (struct riscv_batch *batch)
 
bool riscv_batch_full (struct riscv_batch *batch)
 
uint32_t riscv_batch_get_dmi_read_data (const struct riscv_batch *batch, size_t key)
 
uint32_t riscv_batch_get_dmi_read_op (const struct riscv_batch *batch, size_t key)
 
int riscv_batch_run_from (struct riscv_batch *batch, size_t start_idx, const struct riscv_scan_delays *delays, bool resets_delays, size_t reset_delays_after)
 
bool riscv_batch_was_batch_busy (const struct riscv_batch *batch)
 
static bool riscv_batch_was_scan_busy (const struct riscv_batch *batch, size_t scan_idx)
 

Macro Definition Documentation

◆ BATCH_RESERVED_SCANS

#define BATCH_RESERVED_SCANS   1

Definition at line 20 of file batch.c.

◆ DMI_SCAN_BUF_SIZE

#define DMI_SCAN_BUF_SIZE   (DIV_ROUND_UP(DMI_SCAN_MAX_BIT_LENGTH, 8))

Definition at line 17 of file batch.c.

◆ DMI_SCAN_MAX_BIT_LENGTH

#define DMI_SCAN_MAX_BIT_LENGTH   (DTM_DMI_MAX_ADDRESS_LENGTH + DTM_DMI_DATA_LENGTH + DTM_DMI_OP_LENGTH)

Definition at line 15 of file batch.c.

◆ DTM_DMI_MAX_ADDRESS_LENGTH

#define DTM_DMI_MAX_ADDRESS_LENGTH   ((1<<DTM_DTMCS_ABITS_LENGTH)-1)

Definition at line 14 of file batch.c.

Function Documentation

◆ add_idle_before_batch()

static void add_idle_before_batch ( const struct riscv_batch batch,
size_t  start_idx,
const struct riscv_scan_delays delays 
)
static

◆ decode_dmi()

◆ get_delay()

static unsigned int get_delay ( const struct riscv_batch batch,
size_t  scan_idx,
const struct riscv_scan_delays delays,
bool  resets_delays,
size_t  reset_delays_after 
)
static

Definition at line 144 of file batch.c.

References riscv_batch::delay_classes, and riscv_scan_get_delay().

Referenced by log_batch(), and riscv_batch_run_from().

◆ get_dmi_scan_length()

static unsigned int get_dmi_scan_length ( const struct target target)
static

◆ log_batch()

◆ log_dmi_decoded()

static void log_dmi_decoded ( const struct riscv_batch batch,
bool  write,
uint32_t  address,
uint32_t  data 
)
static

Definition at line 189 of file batch.c.

References address, decode_dmi(), LOG_DEBUG, LOG_ERROR, NULL, and size.

Referenced by log_batch().

◆ riscv_batch_add_dmi_read()

◆ riscv_batch_add_dmi_write()

◆ riscv_batch_add_nop()

◆ riscv_batch_alloc()

◆ riscv_batch_available_scans()

◆ riscv_batch_finished_scans()

size_t riscv_batch_finished_scans ( const struct riscv_batch batch)

◆ riscv_batch_free()

◆ riscv_batch_full()

bool riscv_batch_full ( struct riscv_batch batch)

Definition at line 107 of file batch.c.

References riscv_batch_available_scans().

◆ riscv_batch_get_dmi_read_data()

◆ riscv_batch_get_dmi_read_op()

uint32_t riscv_batch_get_dmi_read_op ( const struct riscv_batch batch,
size_t  key 
)

◆ riscv_batch_run_from()

◆ riscv_batch_was_batch_busy()

◆ riscv_batch_was_scan_busy()

static bool riscv_batch_was_scan_busy ( const struct riscv_batch batch,
size_t  scan_idx 
)
static