piel.tools.hdl21#

Submodules#

Package Contents#

Functions#

configure_ngspice_simulation([run_directory])

This function configures the NGSPICE simulation for the circuit and returns a simulation class.

configure_operating_point_simulation(testbench, **kwargs)

This function configures the DC operating point simulation for the circuit and returns a simulation class.

configure_transient_simulation(testbench, stop_time_s, ...)

This function configures the transient simulation for the circuit and returns a simulation class.

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

This function runs the transient 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 to connect a particular number real output, into a term that can be used in a SPICE netlist.

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

This function configures the NGSPICE simulation for the circuit and returns a simulation class.

Parameters:

run_directory (piel_path_types) – Directory where the simulation will be run

Returns:

Configured NGSPICE simulation options

Return type:

simulation_options

configure_operating_point_simulation(testbench: hdl21.Module, **kwargs)[source]#

This function configures the DC operating point simulation for the circuit and returns a simulation class.

Parameters:
  • testbench (Module) – HDL21 testbench

  • **kwargs – Additional arguments to be passed to the operating point simulation such as name.

Returns:

HDL21 simulation class

Return type:

Simulation

configure_transient_simulation(testbench: hdl21.Module, stop_time_s: float, step_time_s: float, **kwargs)[source]#

This function configures the transient simulation for the circuit and returns a simulation class.

Parameters:
  • testbench (Module) – HDL21 testbench

  • stop_time_s (float) – Stop time of the simulation in seconds

  • step_time_s (float) – Step time of the simulation in seconds

  • **kwargs – Additional arguments to be passed to the transient simulation

Returns:

HDL21 simulation class

Return type:

Simulation

run_simulation(simulation: hdl21.sim.Sim, simulator_name: Literal[ngspice] = 'ngspice', simulation_options: vlsirtools.spice.SimOptions | None = None, to_csv: bool = True)[source]#

This function runs the transient simulation for the circuit and returns the results.

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

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

  • simulation_options (Optional[vsp.SimOptions]) – Simulation options

  • to_csv (bool) – Whether to save the results to a csv file

Returns:

Simulation results

Return type:

results

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.