Connected FPGA Scripts

Frozen Content

 

Altium Designer already offers a Custom instrument, with the ability to design and script a simple virtual instrument in an FPGA. The Summer 09 release improves and extends these abilities by allowing more powerful script applications to be built in a more intuitive and user friendly environment, using the new configurable NanoBoard Interface instrument.

 

The NanoBoard Interface instrument.

With the existing Custom instrument, you can essentially create your customized instrument panel and use scripting – internal to the instrument – to provide even greater control. The NanoBoard Interface instrument takes this control to a whole new level, by allowing you to write an external script as part of a separate script project, then link that project to the instrument. This concept is referred to as Connected Scripts.

Writing and Connecting the Script

The external script is written – using forms and/or units – as required and stored as part of a script project (*.PrjScr). Any of the scripting languages supported by Altium Designer can also be used to create your external scripts. For form-based scripts, multiple forms are supported, with no limit on how many you include with your script.

Once the script is written, it is linked to the NanoBoard Interface instrument as part of the instrument's configuration – performed in the NanoBoard Interface Configuration dialog. Simply use the available field in the Script Project region of the dialog to browse to and open the required project.
 

You can also create a new script project from within the NanoBoard Interface Configuration dialog, using the Create New Script Project button. The project will be created and appear in the Projects Panel, and the path to it will be entered for you in the dialog.



Link your external script project to the NanoBoard Interface instrument as part of the instrument's configuration.

As part configuration, you also have the option of making the instrument accessible using the Altium Instrument Dashboard. You can also specify whether or not the connected script is to be invoked as soon as the Dashboard launches.

As with a Custom instrument, the configuration for a NanoBoard Interface instrument is stored with the instrument itself. When the FPGA design is programmed into the target physical device, Altium Designer can retrieve this configuration information in one of two ways, when the instrument is detected on the Soft Devices chain of the Devices view (View»Devices View):

  • From Project – the configuration information is retrieved from the FPGA project. The project must be open in order to display the instrument in the Devices view.
  • From FPGA – the configuration information is downloaded with the design to the physical device, and stored in Block RAM. It is retrieved directly from here and the project need not be open.

 

If you intend to provide access to the NanoBoard Interface instrument and utilize the power of your external script using the Altium Instrument Dashboard, the From FPGA method of retrieval must be used.

Controlled Instruments

With the NanoBoard Interface instrument, you also have the ability to control the operation of other instruments – essentially running a form or procedure within the connected script when the 'controlled instrument' is accessed.
 

Currently, the configurable Digital I/O module (DIGITAL_IO) and the configurable Memory instrument (MEMORY_INSTRUMENT) can be controlled using a NanoBoard Interface instrument.

 
Configuration of controlled instruments is performed in the Controlled Instruments Settings region of the NanoBoard Interface Configuration dialog. All Digital I/O modules and Memory instruments detected in the same design will automatically be listed, by designator.


For instruments that can be controlled, determine how they should present when accessed and whether they are to be controlled using a form or procedure from within your connected script.

Use the Viewer Style setting to determine what happens when the instrument is accessed – from either the Devices view or from the Altium Instrument Dashboard:

  • Default – Open the standard rack panel for the instrument
  • None – nothing happens, the instrument is not displayed and, in the Devices view, will be hidden from the Soft Devices chain.
  • Script Form – launch script form defined in the connected script project and referenced in the field to the right.
  • Script Procedure – launch script procedure defined in the connected script project and referenced in the field to the right.

 

The NanoBoard Interface instrument does not have a standard rack panel for display. When accessed, it will always invoke its connected script.

Running a Connected Script

Once the FPGA design containing a NanoBoard Interface instrument is programmed into the target physical device, its connected script is run simply by double-clicking on the instrument's corresponding icon in the Devices view. If using the Altium Instrument Dashboard, you can either start the script by enabling the instrument or, if you have chosen to have the script run on startup, the script will be invoked as soon as the Dashboard launches.
 

Specify the startup procedure for the connected script in the Options for Script Project dialog (Project»Project Options).



The connected script of a NanoBoard Interface instrument in action!

Debugging

As the NanoBoard Interface instrument utilizes an external script – which is part of Altium Designer's supported scripting languages – you can take advantage of the full debugging environment available, when creating your connected scripts. This includes familiar debugging elements such as stepping into and through procedures, inserting breakpoints, and using the various debugging panels available.


Use the full arsenal of debugging tools available to debug your connected script.

You are reporting an issue with the following selected text and/or image within the active document: