What's happening is that the pin name is taking precedence when using the same layer name as both a pin name and an auxiliary layer.
Here's the DEVICE definition in question:
DEVICE mn ngate nsd(drain) gate(gate) nsd("source") psub(pwell) <pwell>
The property calculations are incorrect when a pin name (psub in this example) and the auxiliary layer represent the same layer (pwell).
Calibre does not flag that there are 2 layers defined with the same name when they are used as both pin name and auxiliary layer in a DEVICE statement.
You may also see this problem as well proximity commands enclosure_parallel and enclosure_perpendicular appearing use the wrong layer to calculate device parameters.
The reason this is happening is that DEVICE pin names have precedence over auxiliary layer names in device property computations. In this case, using the same name, pwell, twice in the DEVICE statement, as a 4th terminal pin name and as an auxiliary layer name created this situation.
The well proximity code looks like this:
LT = enclosure_perpendicular( ngate, pwell, source, 20 )
WT = enclosure_parallel( ngate, pwell, source, 20 )
The 4th terminal layer psub is used to calculate the LT and WT parameters instead of the auxiliary pwell layer as intended. Calibre does not flag that there are 2 layers defined with the same name.
You can resolve the name conflict by either:
- Changing the pin name
- Changing the auxiliary layer name