Questions on GSpiceUI

Help
Mike W.
2011-09-22
2013-03-26
  • Mike W.

    Mike W. - 2011-09-22

    Hi, msw012,

    I am a student in NTU, Singapore. I am now studying the source code of
    your great GSpiceUI. However, since I am a freshman, I have several
    questions about it.

    1. In which cpp file that the tool invoke the ngspice for simulation?
    2. In what way that it invoke ngspice? By using terminal?
    3. Can I change the code to use other spice software instead of
    ngspice? How?

    Thank you very much!

    Best,

    Franke

     
  • Mike W.

    Mike W. - 2011-09-22

    Hi Franke,

    1. In which cpp file that the tool invoke the ngspice for simulation?

    The NG-Spice simulator is envoked from the file main/FrmMain.cpp. The function
    is an event handler called FrmMain::OnSimRun( ). The line of code is 1110 :
      if( ! m_poPrcSimEng->bExec( ) )

    2. In what way that it invoke ngspice? By using terminal?

    An instance of the class PrcNgSpice (FrmMain::m_poPrcSimEng) looks after this.
    It is derived from the class PrcSimrBase which inherits from the wxWidgets class
    wxProcess. I wrote this code some time ago but from memory the wxProcess
    class creates a new process which runs NG-Spice, piping cin, cout and cerr
    back to the wxProcess object.

    3. Can I change the code to use other spice software instead of ngspice? How?

    If the other software uses exactly the same syntax as NG-Spice just create a
    symbolic link to the other software binary calling it ngspice and gSpiceUI will run
    it (assuming gSpiceUI does find the real NG-Spice first).

    If the other software uses a different syntax to NG-Spice or GNU-Cap then things
    get alot harder. gSpiceUI is designed to be extendable so it can manage the
    differences between NG-Spice and GNU-Cap so it could be modified to interface
    to a new simulation engine but it would require alot of work. The problem lays
    in the fact that an electronic simulation engine is inherently very complex so
    interfacing to it is a big task, there's no easy way.

    Hope this helps.

    Mike W.

    PS. I'm happy for you to do what you like with the code. I'm also interested to know
    what you are doing/planning since it's interested to know how people use gSpiceUI.

     

Log in to post a comment.