---
name: "addlotrs"
section: "3"
platform: "linux"
package: "alliance"
version: "5.1.1-3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/addlotrs"
---

# addlotrs(3)

create a logical transistor

## NAME

addlotrs - create a logical transistor

## SYNOPSYS

```
#include "mlo.h"
lotrs_list ∗addlotrs(ptfig, type, x, y, width, length,
		ps, pd, xs, xd,
		ptgrid, ptsource, ptdrain, ptbulk, name)
lofig_list ∗ptfig;
char type;
long x, y;
unsigned short width, length;
unsigned short ps, pd;
unsigned short xs, xd;
losig_list ∗ptgrid, ∗ptsource, ∗ptdrain, ∗ptbulk;
const char ∗name;
```

## PARAMETERS

- *ptfig*

  Pointer to the figure in which the transistor should be added

- *type*

  transistor type

- *x, y*

  Transistor coordinates

- *width, length*

  Transistor grid width and length

- *ps, pd*

  Perimeters of the source and drain

- *xs, xd*

  Values to compute the areas of the source and drain, see [**lotrs**(3)](/lotrs/3.md) for the effective area computation

- *ptgrid*

  Pointer to the signal to be connected on the transistor grid

- *ptsource*

  Pointer to the signal to be connected on the transistor source

- *ptdrain*

  Pointer to the signal to be connected on the transistor drain

- *ptbulk*

  Pointer to the signal to be connected on the transistor bulk

- *name*

  Transistor instance name

## DESCRIPTION

**addlotrs** creates a new transistor, and adds it to the list of transistors pointed to by *ptfig-\>LOTRS*. The new transistor is  added in front of the list, and becomes itself the list head.\
 The *type* parameter can take six values :

- **TRANSN**

  for a N channel transistor

- **TRANSP**

  for a P channel transistor

- **TRANSN\_FAST**

  for a high speed N channel transistor

- **TRANSP\_FAST**

  for a high speed P channel transistor

- **TRANSN\_HVIO**

  for a low leakage N channel transistor

- **TRANSP\_HVIO**

  for a low leakage P channel transistor

The *x*, *y*, *width* , *length*, *ps*, *pd*, *xs* and *xd*,  arguments fill respectivly the *X*, *Y*, *WIDTH*, *LENGTH*, *PS*, *PD*, *XS* and *XD* fields.\
 Four connectors are created each time a transistor is added, and the *ptgrid*, *ptsource*, *ptdrain* and *ptbulk* **losig**s are attached to the *SIG* field of the **locon** of the appropriate connector. The connectors names are *grid*, *source*, *drain* and *bulk*, their direction, *DIR*, are set to **'T'**, and their *TYPE* **INTERNAL**. For details on the structures, see [**locon**(3)](/locon/3.md) and [**lotrs**(3)](/lotrs/3.md).

## RETURN VALUE

**addlotrs** returns a pointer to the newly created transistor.

## ERRORS

**"∗∗∗ mbk error ∗∗∗ illegal transistor type :** *type***"**

The *type* is not a legal transistor type.

## EXAMPLE

```
#include "mlo.h"
void n1_y() /∗ transistor netlist of an inverter ∗/
{
lofig_list ∗pt;
losig_list ∗in, ∗out, ∗vdd, ∗vss;
	pt = addlofig("n1_y");
	addlocon(pt, "in", in = givelosig(pt, 0), IN);
	addlocon(pt, "out", out = givelosig(pt, 1), OUT);
	addlocon(pt, "vdd", vdd = givelosig(pt, 2), IN);
	addlocon(pt, "vss", vdd = givelosig(pt, 3), IN);
	addlotrs(pt, TRANSN, 0, 0, 6, 1, in, vss, out, vss, trn_n1_y);
	addlotrs(pt, TRANSP, 0, 0, 12, 1, in, vdd, out, vdd, trp_n1_y);
}
```

## SEE ALSO

**mbk**(1), [**lofig**(3)](/lofig/3.md), [**lotrs**(3)](/lotrs/3.md), [**locon**(3)](/locon/3.md), [**dellotrs**(3)](/dellotrs/3.md).
