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

ID 683337
Date 4/01/2024
Public
Document Table of Contents

14.6.6.7. Upgrading Finite State Machine Blocks from v23.2 and Earlier

The DSP Builder Finite State Machine block v23.2 and earlier is different than v23.3 and later.

Procedure

  1. Ensure the v23.3 and later .fsm configuration file contains the line: "require version 23.3"
  2. Check that the wires are connected to the correct output ports. In v23.2 and earlier, DSP Builder applies the state transition output port names to the wrong output signals. The names are in the reverse order.
  3. Be aware v23.2 and earlier do not support for Moore Machines. Only v23.3 and later support the moore keyword and defines output signal values for each state.
  4. Be aware for v23.2 and earlier, the .fsm configuration file mask parameter must be an absolute filepath or specified as a path relative to the current directory, which requires a workaround when packaging a Finite State Machine block in a subsystem library installed in a non-local directory. You must create a subsystem initialization script to update the absolute filepath for each .fsm file on every Finite State Machine block in the library:
    if ~bdIsLibrary(bdroot)
        [dirpath, ~,~] = fileparts(mfilename('fullpath'));
        blocks = find_system(gcb,'LookUnderMasks', 'on', 'FollowLinks', 'on', 'finiteStateMachine','on');
        for i0=1:length(blocks)
            fsm_config = get_param(blocks{i0}, 'desc_file');
            slashs = strfind(fsm_config, '/');
            if ~isempty(slashs)
                fsm_config = fsm_config(slashs(end)+1:end);
            end
            set_param(blocks{i0}, 'desc_file', [dirpath '/' fsm_config]);
        end
    end
    
    For v23.3 and later DSP Builder searches the MATLAB path for the specified .fsm filename so the subsystem initialization script is unnecessary.