Sci-SDK Library
SDK for Sci-Compiler projects
Loading...
Searching...
No Matches
SCISDK_LOGICANALYSER_DECODED_BUFFER Struct Reference

Logic Analyser decoded data type. More...

#include <scisdk_defines.h>

Public Attributes

uint32_t magic
 
uint32_t * data
 
uint64_t timecode
 
struct { 
 
   uint32_t   samples 
 
   uint32_t   ntraces 
 
   uint32_t   words_per_sample 
 
info 
 

Detailed Description

Logic Analyser decoded data type.

This type is used to store decoded data from logic analyser. The data in this structure contains raw samples from the logic analyser. Each logical sample can occupy multiple 32-bit words if ntraces > 32. The user can extract individual signals using bitstart and bitwidth information from ChannelsList in JSON.

Note: nsamples in JSON is the total number of 32-bit words from FIFO. The actual number of logical samples = nsamples_json / words_per_sample.

Example with JSON nsamples=2048, 44 digital traces:

  • words_per_sample = 2 (44 traces need 2 words)
  • info.samples = 1024 (logical samples = 2048 / 2)
  • Total array size = 2048 words

data[0] = sample 0, bits 0-31 data[1] = sample 0, bits 32-43 (remaining 12 bits) data[2] = sample 1, bits 0-31 data[3] = sample 1, bits 32-43 ... data[2046] = sample 1023, bits 0-31 data[2047] = sample 1023, bits 32-43

To extract signal i from logical sample j:

  1. Find the word index: word_idx = j * words_per_sample + (bitstart_i / 32)
  2. Find bit position in word: bit_pos = bitstart_i % 32
  3. Extract value: value = (data[word_idx] >> bit_pos) & ((1 << bitwidth_i) - 1)

Member Data Documentation

◆ data

uint32_t* SCISDK_LOGICANALYSER_DECODED_BUFFER::data

Pointer to data allocated by the AllocateBuffer function

◆ [struct]

struct { ... } SCISDK_LOGICANALYSER_DECODED_BUFFER::info

◆ magic

uint32_t SCISDK_LOGICANALYSER_DECODED_BUFFER::magic

Magic number to identify the data type

◆ ntraces

uint32_t SCISDK_LOGICANALYSER_DECODED_BUFFER::ntraces

Number of digital traces (signals) defined in ChannelsList

◆ samples

uint32_t SCISDK_LOGICANALYSER_DECODED_BUFFER::samples

Number of samples in buffer

◆ timecode

uint64_t SCISDK_LOGICANALYSER_DECODED_BUFFER::timecode

Timecode of the first sample

◆ words_per_sample

uint32_t SCISDK_LOGICANALYSER_DECODED_BUFFER::words_per_sample

Number of 32-bit words per sample (calculated as (ntraces + 31) / 32)


The documentation for this struct was generated from the following file: