Verilog I/O

Readers

frontend.readVerilog(filename: str) Netlist[source]

Read the verilog from a file and return the netlist.

Parameters:

filename (str) – the name of the file to read

Raises:

FileNotFoundError – if the file does not exist

Returns:

the netlist

Return type:

Netlist

Writers

frontend.writeVerilog(netlist: frontend.modules.netlist.Netlist | frontend.modules.module.Module, filename: str)[source]

Write the netlist to a verilog file

Parameters:
  • netlist (Netlist | Module) – the netlist or module to write

  • filename (str) – the name of the file to write

Note

The input can be either a netlist or a module

Example usage:

netlist = readVerilog("path/to/verilog/file.v")
writeVerilog(netlist, "path/to/output/file.v")

See also

Related functions: readVerilog()