algzander
algzander

Reputation: 11

How to generate HDL code without the simulation

I would like to generate HDL code without running the simulation. I managed to generate the code, but I had to run the simulation first. However, I would like to do it without this step. Is this possible, and how to do it?

Upvotes: 1

Views: 48

Answers (1)

Bogdan Vukobratovic
Bogdan Vukobratovic

Reputation: 161

Yes, when a module is simulated using a HDL simulator (such as Verilator), running the simulation will automatically generate the HDL code for that purpose.

In order to directly instruct PyGears to generate HDL, you should use hdlgen() function which is available via:

from pygears.hdl import hdlgen

The function supports the following parameters:

  • top - Path to the module (within the design hierarchy) that should be generated. PyGears uses POSIX like paths, i.e. '/path/to/my/module`
  • lang - HDL language to use. SystemVerilog: 'sv' and Verilog: 'v' currently supported
  • outdir - Directory where to place the generated files
  • copy_files - When set to True it will also copy needed files from PyGears library to outdir. When set to False, you will have to make sure to include the PyGears libraries also when using the generated files.

Upvotes: 1

Related Questions