Register a Custom Board

To register a custom board, you must:

  1. Define a board.

  2. Create a board plugin.

  3. Define a board registration function, or add the new board plugin to an existing board registration function.

Define a Board

Before you begin, have the board documentation at hand so you can refer to the details of the board.

Requirements

A board definition must be:

  • A MATLAB® function that returns an hdlcoder.Board object.

    The board definition function can have any name.

  • In its board plugin folder.

How To Define A Board

  1. Create a new file that defines a MATLAB function with any name.

  2. In the MATLAB function, create an hdlcoder.Board object and specify its properties and interfaces according the characteristics of your custom board.

  3. Optionally, to check that the definition is complete, run the validateBoard method.

For example, the following code defines a board:

function hB = plugin_board()
% Board definition

% Construct board object
hB = hdlcoder.Board;

hB.BoardName    = 'Digilent Zynq ZyBo';

% FPGA device information
hB.FPGAVendor   = 'Xilinx';
hB.FPGAFamily   = 'Zynq';
hB.FPGADevice   = 'xc7z010';
hB.FPGAPackage  = 'clg400';
hB.FPGASpeed    = '-2';

% Tool information
hB.SupportedTool = {'Xilinx Vivado'};

% FPGA JTAG chain position
hB.JTAGChainPosition = 2;

%% Add interfaces
% Standard "External Port" interface
hB.addExternalPortInterface( ...
    'IOPadConstraint', {'IOSTANDARD = LVCMOS33'});

Create a Board Plugin

Requirements

A board plugin:

  • Must be a package folder that contains the board definition file.

    A package folder has a + prefix before the folder name. For example, the board plugin can be a folder named +ZedBoard.

  • Must be on the MATLAB path.

  • Can contain one or more reference design plugins.

How To Create a Board Plugin

  1. Create a folder that has a name with a + prefix.

  2. Save your board definition file to the folder.

  3. Add the folder to your MATLAB path.

Define a Board Registration Function

Requirements

A board registration function:

  • Must be named hdlcoder_board_customization.m.

  • Returns a list of board plugins, specified as a cell array of character vectors.

  • Must be on the MATLAB path.

How To Define a Board Registration Function

  1. Create a file named hdlcoder_board_customization.m and save it anywhere on the MATLAB path.

  2. In hdlcoder_board_customization.m, define a function that returns a list of board plugins as a cell array of character vectors.

    For example, the following code defines a board registration function.

    function r = hdlcoder_board_customization
    % Board plugin registration files
    % Format: % board_folder.board_definition_function
    
    r = {'ZyboRegistration.plugin_board'};
    
    end

See Also

|

Related Examples

More About