Commit 45378ac1 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

NetlistWriter: rename ISOURCE to ISOURCE_PWL

parent 75e9cb39
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -40,11 +40,8 @@ NetlistWriterModule::NetlistWriterModule(Configuration& config, Messenger* messe
    config_.setDefault<std::string>("file_name", "output_netlist_event");
    file_name_ = config.get<std::string>("file_name");

    // Default source type set to ISOURCE_PULSE
    config_.setDefault<SourceType>("source_type", SourceType::ISOURCE_PULSE);
    // Get the source type, name and the circuit connected to it, as defined in the netlist
    source_type_ = config.get<SourceType>("source_type");

    // Get the source name and the circuit connected to it, as defined in the netlist
    source_name_ = config.get<std::string>("source_name");
    subckt_instance_name_ = config.get<std::string>("subckt_name");

@@ -220,7 +217,7 @@ void NetlistWriterModule::run(Event* event) {

            // ------- ISOURCE-------

            if(source_type_ == SourceType::ISOURCE) {
            if(source_type_ == SourceType::ISOURCE_PWL) {

                // Get pulse and timepoints
                const auto& pulse = pixel_charge.getPulse(); // the pulse containing charges and times
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ namespace allpix {
        };

        enum class SourceType {
            ISOURCE,
            ISOURCE_PWL,
            ISOURCE_PULSE,
        };

+6 −6
Original line number Diff line number Diff line
@@ -45,9 +45,9 @@ One way to get a netlist already formatted could be to extract it from the Caden

A new netlist is written for each event, reusing the header, footer, and circuit description from the netlist template specified with the `netlist_template` parameter. For each fired pixel, a source / circuit instance pair is added to the template.

The new source written can be parameterized with the parameter `source_type`. Two different types of sources can be used: `ISOURCE` and `ISOURCE_PULSE`:
The new source written can be parameterized with the parameter `source_type`. Two different types of sources can be used: `ISOURCE_PWL` and `ISOURCE_PULSE`:

* `ISOURCE` allows writing all the temporal current waveform using a PWL (Piecewise Linear). This requires the use of the `[PulseTransfer]` module to get the current waveform. A delay can also be added using `t_delay`
* `ISOURCE_PWL` allows writing all the temporal current waveform using a PWL (Piecewise Linear). This requires the use of the `[PulseTransfer]` module to get the current waveform. A delay can also be added using `t_delay`
* In order to lightweight the generated netlists, the `ISOURCE_PULSE` can be selected: it uses the total collected charge Q (instead of the current pulse). Charge and current are linked by $ Q = \int I(t)dt $. The current pulse is set with the parameters `t_delay`, `t_rise`, `t_width` and `t_fall`. The following equation is then used to determine the current: $ I=\frac{Q}{\frac{t_{rise}+t_{fall}}{2}+t_{width}} $

The generated netlist file name can be configured with a prefix taken from the `file_name` parameter, and contains the number of the event the netlist was generated for. The file extension is taken from the input netlist template file.
@@ -76,7 +76,7 @@ If performed, the electrical simulation puts in stand-by the execution of the ev
* `target`: Syntax for the additional data to be written in the netlist, either `SPECTRE` or `SPICE`.
* `netlist_template`: Location of file containing the netlist template of the circuit in one of the supported formats.
* `file_name` : Generated netlist prefix name to which the event number is added as suffix. Defaults to `output_netlist_event_`.
* `source_type`: Type of current source to be used, `ISOURCE` and `ISOURCE_PULSE`. Defaults to `ISOURCE_PULSE`.
* `source_type`: Type of current source to be used, `ISOURCE_PWL` and `ISOURCE_PULSE`.
* `source_name`: Name of the current source instance in the netlist.
* `subckt_name`: Name of the circuit the source is connected to.
* `common_nets`: Nets shared between the pixels.
@@ -90,13 +90,13 @@ If performed, the electrical simulation puts in stand-by the execution of the ev

## Usage

A possible configuration is using a `ISOURCE` and the `SPICE` syntax, requiring the collecting electrode capacitance:
A possible configuration is using a `ISOURCE_PWL` and the `SPICE` syntax, requiring the collecting electrode capacitance:

```ini
[NetlistWriter]
target = SPICE
netlist_template = "front_end.asc"
source_type = ISOURCE
source_type = ISOURCE_PWL
source_name = Instance_source
subckt_name = Instance_front_end
common_nets = Comp_vref, SUB, VDDA, VSSA, Vfbk
@@ -115,7 +115,7 @@ t_delay = 200ns
t_rise = 5ns
t_width = 20ns
t_fall = 5ns
source_name = Instance_pulse
source_name = Instance_source
subckt_name = Instance_front_end
common_nets = Comp_vref, SUB, VDDA, VSSA, Vfbk
waveform_to_save = Comp_vout