BrettG

[Tutorial] Using Hierarchy Boards to create re-usable code

Discussion created by BrettG on Jun 8, 2012

Often in signal processing there is a need to have the same processing function applied to several channels, or to re-use the same functionality in several products. A good way to do this in SigmaStudio is with hierarchy boards. This is a tutorial for using hierarchy boards.

 

First, add a hierarchy board to the project by dragging it from the system folder in the toolbox.

ScreenHunter_02 Jun. 08 11.16.jpg

 

The hierarchy board will appear as a blank rectangle labeled "Board1". You can rename the board by clicking on its name, if you want.

ScreenHunter_03 Jun. 08 11.16.jpg

 

At the bottom of the project view, a new Board1 tab has now appeared. Click it to enter the board. At first, the board is simply empty.

ScreenHunter_04 Jun. 08 11.16.jpg

 

Add a hierarchy input and hierarchy output to get an input channel and output channel to/from the board.

ScreenHunter_05 Jun. 08 11.16.jpg

 

These appear as floating green rectangles in the project.

ScreenHunter_06 Jun. 08 11.16.jpg

 

Place the desired signal processing between the input and output, and wire the cells together.

ScreenHunter_07 Jun. 08 11.17.jpg

 

You can now return to the main project tab, where you'll see new input and output pins on the hierarchy board (corresponding to the inputs and outputs you created within the board). You can now wire the board into the rest of your project.

 

To re-use the board, right click it and select File...Save Board As...

ScreenHunter_08 Jun. 08 11.17.jpg

 

You can now assign a filename to the board.

 

You can copy/paste the board as desired, or simply add a new blank board to a new project and select File...Load Board... in order to use the board in other projects.

ScreenHunter_09 Jun. 08 11.18.jpg

 

Using this function, you can easily create modular code that can be reused within projects and across projects.

Outcomes