Engee documentation
Notebook

Verilog code generation from a model

This example uses the model from the following demonstration https://engee.com/helpcenter/stable/ru/interactive-scripts/base_simulation/PID_fixed.html, and given its use of fixed-point data types, we can afford to generate code from them in Verilog languages. The code will be generated from the PID-regulator block.

image.png

Now let's generate code in Verilog language from this model. To do this, set the attribute target="verilog" in the programme control function of the code generator.

Verilog is a hardware description language (HDL) used for designing and modelling digital systems such as FPGA and ASIC circuits. It allows the structure and behaviour of digital circuits to be described at the register and logic level, making it an essential tool for hardware engineers. Verilog supports parallel process modelling, which is critical for circuits with a large number of simultaneously operating components. The main applications of Verilog are listed below.

  1. FPGA and ASIC design: Verilog allows you to describe complex digital systems, which can then be synthesised into physical circuits on FPGAs or integrated circuits.

  2. Simulation and Verification: Verilog provides simulation capabilities, allowing you to test and debug circuits before implementing them in hardware.

  3. development automation: synthesizers translate Verilog code into optimised logic circuits, simplifying the process of building and testing hardware components.

Verilog is used in projects requiring high-speed data processing and reliable parallel execution.

In [ ]:
engee.generate_code("$(@__DIR__)/pid_fixed.engee", "$(@__DIR__)/verilog"; subsystem_name="SubSystem", target="verilog")
[ Info: Generated code and artifacts: /user/start/examples/codegen/verilog/verilog

Now let's analyse the results.

image.png

As we can see, the code was successfully generated and can be further applied in further development.

Conclusion

In this example, we have looked at the code generation capabilities of Engee and shown you how to apply this tool to your projects.

Blocks used in example