The method committed yesterday (last commit) was found to be too

time-consuming (note the commit message "There are still likely much
better ways to do this").  Worked out a method of hashing the location
of terminals on other planes so that they can be looked up from the
address of the tile.  This requires only one pass through the devices
to locate and record the terminals, and no loops through devices when
processing tiles.  Also corrected the positioning of the substrate
terminal to be the center position of the device tile, not the substrate
tile.  This not only better represents the substrate connections, but
it also eliminates the condition in which many thousands of resistors
converge on the same point, which causes stack overflow.  With the
current scheme, stack overflow is unlikely to occur.
This commit is contained in:
R. Timothy Edwards
2026-06-06 20:04:47 -04:00
parent 1db2567841
commit 14afb4bd52
6 changed files with 194 additions and 33 deletions
+11
View File
@@ -51,6 +51,17 @@ typedef struct resistor
#define rr_connection1 rr_node[0]
#define rr_connection2 rr_node[1]
/* The resDevTerm structure holds information needed to quickly check */
/* if a tile belongs to a terminal of a device in a plane other than */
/* the plane of the device. */
typedef struct resdevterm
{
struct resdevterm *rdt_next; /* next connected device in the list */
Tile *rdt_tile; /* the tile of the device */
int rdt_term; /* terminal number, or -1 for substrate */
} resDevTerm;
/* Definitions for old FET-style MOSFET devices. Actual devices may have
* any number of terminals. "GATE" is the identifying type; "SUBS" is
* the substrate/well connection (if it exists), and the other terminals