Tutorial - Designing Custom FPGA Logic using C

Frozen Content

Altium Designer provides the ability to add custom logic to an FPGA design, where that logic is 'captured' in an underlying C source file. Simply write the functionality required in the comfort of Altium's code-aware C Editor and then sit back as Altium Designer's C-to-Hardware Compilation technology converts your code into VHDL or Verilog (depending on your defined netlisting preference). Armed with even a basic software background, there is now no reason why you can't design custom FPGA logic!

From the schematic sheet, the underlying C source file is referenced in much the same way as a schematic or HDL file. Instead of a Sheet Symbol however, a C Code Symbol primitive is used. Each C Code Symbol represents one top-level exported function, resident in the referenced C source file. Access to the parameters of the function is made using C Code Entries – placed on the symbol and functionally similar to Sheet Entries on a Sheet Symbol. These entries can be wired to other components on the schematic, allowing for transfer of data.

In this tutorial, we will look at a simple design that incorporates C-based custom logic, which will be programmed into an FPGA resident on a daughter board plugged into the Desktop NanoBoard NB2DSK01.

The example design featured in this tutorial (Figure 1) is a simple accumulator. The design contains two C Code Symbols, each used to export a single function written in an associated C source file – one function to provide a clock pulse circuit and the other to provide an accumulation circuit.

Figure 1. Our simple Accumulator design, which we will use to highlight the addition of custom logic written in C.

Interaction with the design is handled through the GUI panel of a Custom Instrument component. Basically, the user enters a new value on the Custom Instrument's panel and clicks a button (also on the panel) to request that this value be added to the accumulated total. Once clicked, the output of the custom clock pulse circuit will go High, in turn invoking the custom accumulatIon circuit. The new value is added to the (internally-stored) accumulated value and the new total latched and subsequently displayed back in the instrument panel.

The design can be found in the \Examples\Tutorials\CHC Accumulator folder of your Altium Designer installation. Refer to this example at any time to get further insight or to skip some of the steps.

Follow each of the linked pages below, in sequence, to complete the tutorial and implement the design:

This tutorial assumes a working knowledge of the basics of FPGA design within Altium Designer. Although not a pre-requisite for this tutorial, should you wish to familialize yourself with the basics, including project creation, component placement, wiring, configuration and design processing, see Tutorial - Getting Started with FPGA Design.

 

See Also

You are reporting an issue with the following selected text and/or image within the active document:
ALTIUM DESIGNER FREE TRIAL
Altium Designer Free Trial
Let’s get started. First off, are you or your organization already using Altium Designer?

If would like to speak with a representative, please contact your local Altium office.
Copyright © Altium Limited

In that case, why do you need an evaluation license?

If would like to speak with a representative, please contact your local Altium office.
Copyright © Altium Limited

Got it. You actually don’t need an evaluation license for that.

Click the button below to download the latest Altium Designer installer.


Download Altium Designer Installer

If would like to speak with a representative, please contact your local Altium office.
Copyright © Altium Limited

Please fill out the form below to get a quote for a new seat of Altium Designer.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.

If you are on Altium Subscription, you don’t need an evaluation license.

If you are not an active Altium Subscription member, please fill out the form below to get your free trial.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.

Why are you looking to evaluate Altium Designer?

If would like to speak with a representative, please contact your local Altium office.
Copyright © Altium Limited

You came to the right place! Please fill out the form below to get your free trial started.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.

Sounds exciting! Did you know we offer special discounted student licenses? For more information, click here.

In the meantime, feel free to request a free trial by filling out the form below.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.

Got it. You can download a free Altium Designer Viewer license which is valid for a 6 months.

Please fill out the form below to request one.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.

That’s great! Making things is awesome. We have the perfect program for you.

Upverter is a free community-driven platform designed specifically to meet the needs of makers like you.

Click here to give it a try!

If would like to speak with a representative, please contact your local Altium office.
Copyright © Altium Limited

Got it. You can download a free Altium Designer Viewer license which is valid for a 6 months.

Please fill out the form below to request one.

By clicking “Get Your Free Trial”, you are agreeing to our Privacy Policy.
You may receive communications from Altium and can change your notification preferences at any time.