extflat: integrate cb_extflat_hiervisitdevs_t for EFHierVisitDevs()

This commit is contained in:
Darryl L. Miles
2025-08-06 22:58:30 +01:00
parent e1be3fe7d2
commit 6bbcd65c5f
4 changed files with 33 additions and 19 deletions
+19 -7
View File
@@ -572,11 +572,14 @@ subcktHierVisit(
* ----------------------------------------------------------------------------
*/
/* ARGSUSED */
/* @typedef cb_extflat_hiervisitdevs_t (UNUSED) */
int
spcdevHierVisit(
HierContext *hc,
Dev *dev, /* Dev being output */
float scale) /* Scale transform for output */
float scale, /* Scale transform for output */
ClientData cdata) /* unused */
{
DevParam *plist, *pptr;
DevTerm *gate, *source, *drain;
@@ -1150,11 +1153,14 @@ spcdevHierVisit(
* ----------------------------------------------------------------------------
*/
/* ARGSUSED */
/* @typedef cb_extflat_hiervisitdevs_t (UNUSED) */
int
spcdevHierMergeVisit(
HierContext *hc,
Dev *dev, /* Dev being output */
float scale) /* Scale of transform (may be non-integer) */
float scale, /* Scale of transform (may be non-integer) */
ClientData cdata) /* unused */
{
DevTerm *gate, *source, *drain;
EFNode *subnode, *snode, *dnode, *gnode;
@@ -1272,12 +1278,15 @@ spcdevHierMergeVisit(
* ----------------------------------------------------------------------------
*/
/* ARGSUSED */
/* @typedef cb_extflat_hiervisitdevs_t (UNUSED) */
int
spccapHierVisit(
HierContext *hc,
HierName *hierName1,
HierName *hierName2,
double cap)
double cap,
ClientData cdata) /* unused */
{
cap = cap / 1000;
if (fabs(cap) <= EFCapThreshold)
@@ -1574,7 +1583,7 @@ devMergeHierVisit(
float m;
if (esDistrJunct)
devDistJunctHierVisit(hc, dev, scale);
devDistJunctHierVisit(hc, dev, scale, PTR2CD(NULL));
if (dev->dev_nterm < 2)
{
@@ -1720,11 +1729,14 @@ mergeThem:
* ----------------------------------------------------------------------------
*/
/* ARGSUSED */
/* @typedef cb_extflat_hiervisitdevs_t (UNUSED) */
int
devDistJunctHierVisit(
HierContext *hc,
Dev *dev, /* Dev to examine */
float scale) /* Scale tranform of output */
float scale, /* Scale tranform of output */
ClientData cdata) /* unused */
{
EFNode *n;
int i, l, w;
@@ -2195,10 +2207,10 @@ esHierVisit(
devMergeList = NULL;
}
else if (esDistrJunct)
EFHierVisitDevs(hcf, devDistJunctHierVisit, (ClientData)NULL);
EFHierVisitDevs(hcf, devDistJunctHierVisit, PTR2CD(NULL));
/* Output devices */
EFHierVisitDevs(hcf, spcdevHierVisit, (ClientData)NULL);
EFHierVisitDevs(hcf, spcdevHierVisit, PTR2CD(NULL));
/* Output lumped parasitic resistors */
EFHierVisitResists(hcf, spcresistHierVisit, (ClientData)NULL);
+1 -1
View File
@@ -52,7 +52,7 @@ extern int spcdevOutNode(const HierName *prefix, const HierName *suffix, const c
extern int spcnAP(DevTerm *dterm, EFNode *node, int resClass, float scale, char *asterm, char *psterm, float m, FILE *outf, int w);
extern int parallelDevs(const devMerge *f1, const devMerge *f2);
extern int nodeHspiceName(char *s);
extern int devDistJunctHierVisit(HierContext *hc, Dev *dev, float scale);
extern int devDistJunctHierVisit(HierContext *hc, Dev *dev, float scale, ClientData cdata); /* @typedef cb_extflat_hiervisitdevs_t (UNUSED) */
extern int spcnAPHier(DevTerm *dterm, HierName *hierName, int resClass, float scale, char *asterm, char *psterm, float m, FILE *outf);
extern void mergeAttr(char **a1, char **a2);
extern int update_w(short resClass, int w, EFNode *n);