collectData
Description
returns the captured data from an FPGA to the host machine in nonblocking capture mode.
capturedData
= collectData(DC
)DC
is a customized data capture object.
Note
The collectData
function is not supported in blocking capture
mode.
Examples
Collect Captured Data from FPGA
Before you use this example, you must have previously generated the customized data capture object, using the FPGA Data Capture Component Generator tool. You must also have integrated the generated IP code into your project and deployed it to the FPGA. The data capture object communicates with the FPGA over a JTAG cable. Make sure that the required cable is connected between the board and the host computer.
This example uses a generated object, datacapture
, that defines two
signals for data capture. Signal A
is 16 bits and signal
B
is 8 bits. Both signals are also available for use in trigger
conditions. The sample depth is 1024 samples.
Change the capture mode to nonblocking mode.
DC.CaptureMode = 'nonblocking';
Check the current status of the data capture object.
status = checkStatus(DC)
status = struct with fields: CapturedWindows: 0 RunStatus: 'Not started' TriggerStage: 0
Define a trigger condition to capture data when the signal B
is
equal to 10.
setTriggerCondition(DC,'B',true,10);
Use the step
function to capture data on the specified trigger
event.
dataOut = step(DC);
Check the current status of the data capture object.
status = checkStatus(DC)
status = struct with fields: CapturedWindows: 1 RunStatus: 'Successfully captured data from FPGA' TriggerStage: 0
Collect captured data.
capturedData = collectData(DC)
Captured 1 windows of data from FPGA. capturedData = struct with fields: Capture_Window: [1024×1 uint32] Trigger_Position: [1024×1 logical] A: [1024×1 uint16] B: [1024×1 uint8]
Input Arguments
DC
— Customized data capture object
hdlverifier.FPGADataReader
System object™
Customized data capture
object, specified as an hdlverifier.FPGADataReader
System object.
Output Arguments
capturedData
— Captured data
structure
Captured data, returned as a structure containing a field for the
Capture_Window
signal, a field for the
Trigger_Position
signal, and a field for each signal obtained by
FPGA data capture. The captured signal field is a vector of Sample
depth values for each signal requested for data capture at generation time.
The fields of the structure have these signal names.
Capture_Window
— This signal indicates the current capture window.Trigger_Position
— This signal indicates the position of the trigger detection clock cycle within a capture buffer.All remaining fields — The signal names you specified at generation time.
Version History
Introduced in R2022a
See Also
Objects
Tools
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)