Remove CM synthesizer device from build system

This commit is contained in:
Vadim Kuznetsov 2023-05-29 16:28:13 +03:00
parent 2b5bdd44e8
commit 35e4d1f088
6 changed files with 41 additions and 15 deletions

View File

@ -48,7 +48,7 @@
#include "main.h"
#include "schematic.h"
#include "extsimkernels/abstractspicekernel.h"
#include "extsimkernels/xspice_cmbuilder.h"
//#include "extsimkernels/xspice_cmbuilder.h"
extern SubMap FileList;
@ -504,7 +504,7 @@ void LibraryDialog::slotSave()
kern->createSubNetlsit(ts,true);
intoStream(Stream, tmp, "Spice");
delete kern;
XSPICE_CMbuilder *bld = new XSPICE_CMbuilder(Doc);
/*XSPICE_CMbuilder *bld = new XSPICE_CMbuilder(Doc);
QStringList srcs,dsts;
bld->getModIfsFileList(srcs);
for (QString& ifl : srcs) {
@ -518,7 +518,7 @@ void LibraryDialog::slotSave()
s += ">\n";
Stream<<s;
delete bld;
delete bld;*/
}
// save verilog model

View File

@ -16,8 +16,8 @@ spicecompat.h
customsimdialog.h
simsettingsdialog.h
verilogawriter.h
xspice_cmbuilder.h
codemodelgen.h
#xspice_cmbuilder.h
#codemodelgen.h
)
SET(EXTSIMKERNELS_SRCS
@ -30,8 +30,8 @@ spicecompat.cpp
customsimdialog.cpp
simsettingsdialog.cpp
verilogawriter.cpp
xspice_cmbuilder.cpp
codemodelgen.cpp
#xspice_cmbuilder.cpp
#codemodelgen.cpp
)
SET(EXTSIMKERNELS_MOC_HDRS

View File

@ -53,6 +53,7 @@ Ngspice::Ngspice(Schematic *sch_, QObject *parent) :
simulator_cmd = QucsSettings.NgspiceExecutable; //rely on $PATH
}
simulator_parameters = "";
spinit_name = QDir::toNativeSeparators(QucsSettings.S4Qworkdir+"/.spiceinit");
}
/*!
@ -508,15 +509,17 @@ void Ngspice::slotSimulate()
removeAllSimulatorOutputs();
XSPICE_CMbuilder *CMbuilder = new XSPICE_CMbuilder(Sch);
/*XSPICE_CMbuilder *CMbuilder = new XSPICE_CMbuilder(Sch);
CMbuilder->cleanSpiceinit();
CMbuilder->createSpiceinit(/*initial_spiceinit=*/collectSpiceinit(Sch));
CMbuilder->createSpiceinit(collectSpiceinit(Sch));
if (CMbuilder->needCompile()) {
CMbuilder->cleanCModelTree();
CMbuilder->createCModelTree(output);
CMbuilder->compileCMlib(output);
}
delete CMbuilder;
delete CMbuilder;*/
cleanSpiceinit();
createSpiceinit(/*initial_spiceinit=*/collectSpiceinit(Sch));
//startNgSpice(tmp_path);
SimProcess->setWorkingDirectory(workdir);
@ -662,3 +665,22 @@ void Ngspice::setSimulatorParameters(QString parameters)
{
simulator_parameters = parameters;
}
void Ngspice::cleanSpiceinit()
{
QFileInfo inf(spinit_name);
if (inf.exists()) QFile::remove(spinit_name);
}
void Ngspice::createSpiceinit(const QString &initial_spiceinit)
{
if (initial_spiceinit.isEmpty()) return;
QFile spinit(spinit_name);
if (spinit.open(QIODevice::WriteOnly)) {
QTextStream stream(&spinit);
if (!initial_spiceinit.isEmpty()) {
stream << initial_spiceinit << '\n';
}
spinit.close();
}
}

View File

@ -38,11 +38,15 @@ class Ngspice : public AbstractSpiceKernel
Q_OBJECT
private:
QString spinit_name;
bool checkNodeNames(QStringList &incompat);
static QString collectSpiceinit(Schematic *sch);
bool findMathFuncInc(QString &mathf_inc);
QString getParentSWPscript(Component *pc_swp, QString sim, bool before, bool &hasDblSWP);
QString getParentSWPCntVar(Component *pc_swp, QString sim);
void cleanSpiceinit();
void createSpiceinit(const QString &initial_spiceinit);
public:
explicit Ngspice(Schematic *sch_, QObject *parent = 0);

View File

@ -82,7 +82,7 @@
#include "misc.h"
#include "extsimkernels/verilogawriter.h"
#include "extsimkernels/simsettingsdialog.h"
#include "extsimkernels/codemodelgen.h"
//#include "extsimkernels/codemodelgen.h"
#include "symbolwidget.h"
// icon for unsaved files (diskette)
@ -3150,7 +3150,7 @@ void QucsApp::slotBuildVAModule()
}
void QucsApp::slotBuildXSPICEIfs(int mode)
/*void QucsApp::slotBuildXSPICEIfs(int mode)
{
if (!isTextDocument(DocumentTab->currentWidget())) {
Schematic *Sch = (Schematic*)DocumentTab->currentWidget();
@ -3235,7 +3235,7 @@ void QucsApp::slotEDDtoIFS()
void QucsApp::slotEDDtoMOD()
{
slotBuildXSPICEIfs(spicecompat::cmgenEDDmod);
}
}*/
void QucsApp::slotShowModel()
{

View File

@ -183,9 +183,9 @@ private slots:
void slotSaveNetlist();
void slotAfterSpiceSimulation();
void slotBuildVAModule();
void slotBuildXSPICEIfs(int mode = 0);
/*void slotBuildXSPICEIfs(int mode = 0);
void slotEDDtoIFS();
void slotEDDtoMOD();
void slotEDDtoMOD();*/
void slotShowModel();
void slotSearchLibComponent(const QString &);
void slotSearchLibClear();