piel.tools.hdl21#

Submodules#

Functions#

configure_ngspice_simulation([run_directory])

Configures the NGSPICE simulation for the circuit and returns a simulation options class.

configure_operating_point_simulation(testbench, **kwargs)

configure_transient_simulation(testbench, stop_time_s, ...)

run_simulation(simulation[, simulator_name, ...])

Runs the simulation for the circuit and returns the results.

convert_numeric_to_prefix(value)

This function converts a numeric value to a number under a SPICE unit closest to the base prefix. This allows us

Package Contents#

configure_ngspice_simulation(run_directory: piel.types.PathTypes = '.')[source]#

Configures the NGSPICE simulation for the circuit and returns a simulation options class.

Parameters:

run_directory (PathTypes) – Directory where the simulation will be run.

Returns:

Configured NGSPICE simulation options.

Return type:

vsp.SimOptions

configure_operating_point_simulation(testbench: piel.types.AnalogueModule, **kwargs)[source]#
configure_transient_simulation(testbench: piel.types.AnalogueModule, stop_time_s: float, step_time_s: float, **kwargs)[source]#
run_simulation(simulation: Any, simulator_name: Literal['ngspice'] = 'ngspice', simulation_options: Any = None, to_csv: bool = True)[source]#

Runs the simulation for the circuit and returns the results.

Parameters:
  • simulation (h.sim.Sim) – HDL21 simulation class.

  • simulator_name (Literal["ngspice"]) – Name of the simulator to use.

  • simulation_options (Optional[vsp.SimOptions]) – Options for the simulation. Defaults to None.

  • to_csv (bool) – Whether to save the results to a CSV file. Defaults to True.

Returns:

Results of the simulation.

Return type:

hs.SimResult

convert_numeric_to_prefix(value: float)[source]#

This function converts a numeric value to a number under a SPICE unit closest to the base prefix. This allows us to connect a particular number real output, into a term that can be used in a SPICE netlist.