Introducing Enumerated Values

Upon popular request, airhdl now supports enumerated values for register fields.

Enumerated values are a convenient was to give names to specific field values. As an example, we’ll take a two bit mode field that is used to control a processing engine. This field supports the following values:

• 0: disabled
• 1: manual
• 2: automatic

When creating and/or editing this field in airhdl, you now have a way to capture those values in the user interface. You just need to enter them as comma-separated key/value pairs:

2020-04-26_9-16-19

Once you have done that, airhdl knows about those values and corresponding symbols appear in the generated files. For example, in the generated C header, you’ll find them as preprocessor defines:

2020-04-26_9-22-07

Of course, your enumerated values are available in the generated RTL code (VHDL and SystemVerilog) as constants too.

We hope you’ll find them useful.

 

Published by

Guy Eschemann

FPGA consultant

Leave a Reply

Your email address will not be published. Required fields are marked *