Isotel.net
Isotel DAQ & Metering Forums
Administrator
offline
5 posts
Oct 28 2018
28 October 2018 - 18:42

Welcome to Isotel DAQ & Metering community support.

05 February 2019 - 20:40

Hi,

It will take up to 2.1 GB of memory to simulate it.

However you may reduce consumption for a bit (300 MB for 50 ms transient analysis) by adding the save command to list the nodes of interest and discard the rest into the prssine.cir:

.control
save clk rst prsout out

after simulation is done you should have got the plots to the screen immediately (?)

Anyway you might be getting v(out) 0 since you're looking at the wrong plot:

No. of Data Rows : 5734581
FFT: Time span: 0.05 s, input length: 5000001, zero padding: 3388607
FFT: Frequency resolution: 20 Hz, output length: 4194305
ngspice 169 -> setplot
List of plots available:

Current sp2 * mixed signal simulation demo project - digital sine generator with 8-bit prs and a low-pass filter, <uros@isotel.eu> (Spectrum)
    tran2   * mixed signal simulation demo project - digital sine generator with 8-bit prs and a low-pass filter, <uros@isotel.eu> (Transient Analysis (linearized))
    tran1   * mixed signal simulation demo project - digital sine generator with 8-bit prs and a low-pass filter, <uros@isotel.eu> (Transient Analysis)
    const   Constant values (constants)
ngspice 170 -> setplot tran1
ngspice 171 -> plot v(out)
Warning: Missing charsets in String to FontSet conversion

Doing 10 ms is also fine, it will show most of the harmonics.

BR Uros

11 February 2019 - 18:29

I should have mentioned that you do not need to explicitly set the other plot to plot a signal in ngspice, you may refer to a plot by its name, like:

ngspice 174 -> plot tran1.out

That's how different runs (plots) can be easily compared to each other.

19 April 2019 - 15:21

the [process->N_din] is indeed gcc extension not supported by the clang:

static void exchangedata(Process_t * process, double time, uint8_t din[], uint8_t dout[])
{
    typedef struct {
        double time;
        uint8_t din[process->N_din];

however you may use some static number, large enough to fit all your inputs, so 10 would fit 80 bits, etc, you may reserve some more and it should work. So instead of [process->N_din] just write [64]