Menu

#150 ASCO using dynamic loaded VA model, crash qucsator

0.0.18
closed-fixed
None
5
2014-05-16
2014-05-07
Guilherme
No

Reported by Mike Brinson:

While working on new RF component models for Qucs a bug has emerged
which causes Qucs to core dump.

The problem occurs when ASCO is used to optimize circuit performance,
where the circuit includes a compiled Verilog-A model constructed using the new dynamic_loader system.

In the case of a simple 2 resistor voltage divider small signal AC analysis works without problems.
However, when R2 set to 50 Ohms and R1 is optimized in the region 1 Ohm to 100 Ohms to give Vres 0.5 V, Qucs core dumps. (Vinput AC is set to 1V)

I have also tested Qucs/ASCO using a similar circuit but with transient analysis. The same result occurs.

Also please note if R1 is replaced by a subcircuit made up of standard Qucs parts optimization using ASCO works without problems.

1 Attachments

Discussion

  • Guilherme

    Guilherme - 2014-05-07

    For security reasons qucsator requires the path and the name of the dynamic objects (compiled VA models).

    $ ./qucsator -h
    <snip>
      -p, --path     project path (or location of dynamic modules)
      -m, --module   list of dynamic loaded modules (base names separated by space)
    

    Currently asco does not propagate arguments down to the simulator.

    One alternative is to use a general.sh wrapping script to call qucsator with the required arguments.

    $ asco -h
    <snip>
    Usage : asco -<simulator> <inputfile>
    
    Examples:
    <snip>
              asco -qucs    <inputfile>.txt
              asco -general <inputfile>.*
    

    Looking into the ASCO code errfunc.c file:

            case 50: /*Qucs*/
                #ifndef __MINGW32__
                sprintf(lkk, "nice -n 19 qucsator -i %s.txt -o %s.dat > /dev/null", hostname, hostname);
                #else
                sprintf(lkk, "qucsator -i %s.txt -o %s.dat > NUL", hostname, hostname);
                #endif
                break;
            case 100: /*general*/
                #ifndef __MINGW32__
                sprintf(lkk, "nice -n 19 ./general.sh %s %s", hostname, hostname);
                #else
                sprintf(lkk, "./general.sh %s %s", hostname, hostname);
                #endif
                break;
    

    Not sure how the general.sh would work on Windows.

     
  • Guilherme

    Guilherme - 2014-05-09

    No, the general.sh will not work. To patch asco is also not ideal.
    Asco call the qucastor inside error function. Hence, several function calls will need to be modified just to pass the remaining qucs arguments (-p -m).

    Perhaps annotation of the netlist with (-p -m) dynamic VA modules is better. If the netlist is annotated the arguments can be ignored. Looking into it.

     
  • Guilherme

    Guilherme - 2014-05-11

    See current workaround in branch: dyload-annotate

    If dynamic modules are loaded and used on the netlist, the project path and module names are appended to the netlist as comments.

    Something like

    # --path=/Users/guitorri/qucs_bugs/va_loader_inverter_prj
    # --module=mybsim4v30nMOS mybsim4v30pMOS mypotentiometer
    

    Qucsator then looks for --path and --module to extract the data. This is a bit inefficient as the netlist has to be read in advance. Alternatives: check for a configuration file, use environment variables, do the check during normal netlist parse.

    I believe it make sense to annotate the netlist directly. Specially if one thinks about hierarhical projects, with multiple modules living in different locations (situation not yet tested).

     
  • Guilherme

    Guilherme - 2014-05-16
    • status: open --> closed-fixed
     
  • Guilherme

    Guilherme - 2014-05-16

    merged into master

     

Log in to post a comment.

MongoDB Logo MongoDB