DSP Builder for Intel® FPGAs (Advanced Blockset): Handbook

ID 683337
Date 5/27/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

4.6.1. Hardware Verification

DSP Builder provides an interface for accessing the FPGA directly from MATLAB. This interface allows you to use MATLAB data structures to provide stimuli for the FPGA and read the results from the FPGA.

This interface provides memory-mapped read and write accesses to your design running on an FPGA using the System Console system debugging tool.

Table 7.  Methods for SystemConsole ClassCall these methods as SystemConsole.<method_name>[arguments]. Use these methods to scan and establish the master connection to the FPGA.
Method Description
executeTcl(script) Executes a Tcl script specified through <script> string in SystemConsole.
designLoad(path) Loads the design (.sof) file specified through <path> parameter to FPGA.
refreshMasters Detects and lists all available master connections.
openMaster(index)

Creates and returns a master connection to a specified master link. The <index> specifies the index (starting 1) of the connection from the list returned by refreshMasters function.

For example, M=SystemConsole.openMaster(1);

Table 8.  Methods for Master ClassRead and write through a master connection. Call these methods on a master object returned by SystemConsole.openMaster(index) method.
Method Description
close()

Closes the connection associated with the master object.

Note: Always call this method when you finish working with current master connection.
setTimeOutValue(timeout) Use this method to override the default timeout value of 60 seconds for the master connection object. The specified <timeout> value in seconds.
read(type, address, size [, timeout]) Returns a list of <size> number of values of type <type> read from memory on FPGA starting at address <address>.

For example,

data = masterObj.read(‘single’, 1024, 10)

Reads consequent 10 4-byte values (40 bytes overall) with a starting address of 1,024 and returns the results as list of 10 ‘single’ typed values.

write(type, address, data [, timeout])

Writes <data> (a list of values of type <type>) to memory starting at address <address>.

For example:

masterObj.write(‘uint16’, 1024, 1:10);

Writes values 1 to 10 to memory starting address 1,024, where each value occupies 2 bytes in memory (overall 20 bytes are written).

Table 9.  Parameters for read(type, address, size [, timeout])
Parameter Description
<type>

The type of each element in returned array.

  • 1 byte : ‘char’, ‘uint8’, ‘int8’
  • 2 bytes: ‘uint16’, ‘int16’
  • 4 bytes: ‘uint32’, ‘int32’, ‘single’
  • 8 bytes: ‘uint64’, ‘int64’, ‘double’
<address>

The start address for the read operation. You can specify as a hexadecimal string.

Note: The address should specify a byte address
<size> The number of <type> (type specifies 1/2/4/8 bytes based on value) values to read.

<timeout>

An optional parameter to override the default timeout value for this operation only.
Table 10.  Parameters for write(type, address, data [, timeout])
Parameter Description
<type>

The type each element in specified <data>. Each type specifies 1/2/4/8 bytes:

  • 1 byte : ‘char’, ‘uint8’, ‘int8’
  • 2 bytes: ‘uint16’, ‘int16'
  • 4 bytes: ‘uint32’, ‘int32’, ‘single’
  • 8 bytes: ‘uint64’, ‘int64’, ‘double’
<address>

The start address for the write operation. You can specify as a hexadecimal string.

Note:

The address should be specified as a byte address

<data> An array or single element data to be written to memory.
<timeout> An optional parameter to override the default timeout value for this operation only.