1ADDLOINS(3)                  MBK LOGICAL FUNCTIONS                 ADDLOINS(3)
2
3
4

NAME

6       addloins - create a logical instance
7

SYNOPSIS

9       #include "mlo.h"
10       loins_list ∗addloins(ptfig, insname, ptmodel, sigchain)
11       lofig_list ∗ptfig;
12       char ∗insname;
13       lofig_list ∗ptmodel;
14       chain_list ∗sigchain;
15

PARAMETERS

17       ptfig               Pointer  to the figure in which the instance should
18                           be added
19
20       insname             Instance name
21
22       ptmodel             Pointer to the instance model
23
24       sigchain            Pointer to chain list of signal pointers
25

DESCRIPTION

27       addloins creates a new instance, and adds it to the list  of  instances
28       pointed  to  by ptfig->LOINS. The new instance is added in front of the
29       list, and becomes itself the list head.
30       The parameter insname fills the INSNAME field of the loins structure.
31       The ptmodel is used for two purposes. First,  the  ptmodel->NAME  fills
32       the  FIGNAME  field. Second, the connectors of the figure pointed to by
33       ptmodel are duplicated in the LOCON field, but the  signals  linked  to
34       each connector are the one given in the sigchain argument. See chain(3)
35       for details on chain_lists.
36       The matching is done in order, it means that  the  first  connector  is
37       linked  to  the  first  signal of the sigchain, and so on. Care must be
38       taken when instantiating in order  to  warranty  the  validity  of  the
39       netlist.  For details on the structure, see loins(3).
40

RETURN VALUE

42       addloins returns a pointer to the newly created instance.
43

ERRORS

45       "∗∗∗ mbk error ∗∗∗ addloins impossible : instance insname already exist
46       in figure ptfig->NAME"
47              The insname is the instance identifier. So it must be unique  at
48              a given hierarchy level.
49       "∗∗∗  mbk  error ∗∗∗ addloins impossible : instance model is the figure
50       figname itself"
51              The model of the instance has the  same  name  that  the  figure
52              where  the  instantiation  takes  place. This check is only per‐
53              formed for a single hierarchy level, in terms of its instances.
54       "∗∗∗ mbk error ∗∗∗ addloins impossible : connector  number  discrepancy
55       between   figure   ptmodel->NAME   and   instance   insname  in  figure
56       ptfig->NAME"
57              The number of signals in the sigchain is not equal to the number
58              of connectors of the model. The matching is not done correctly.
59

EXAMPLE

61       #include "mlo.h"
62       void add_na2_y(pt, in1, in2, out) /∗ add an instance of na2_y ∗/
63       lofig_list ∗pt; /∗ pointer to the figure ∗/
64       long in1, in2, out; /∗ signals indexes ∗/
65       {
66       chain_list ∗signal = NULL;
67          /∗ get the pointer when signal index is known ∗/
68          signal = addchain(signal, (void ∗)givelosig(pt, in1));
69          signal = addchain(signal, (void ∗)givelosig(pt, in2));
70          signal = addchain(signal, (void ∗)givelosig(pt, out));
71          /∗ get vdd and vss ∗/
72          signal = addchain(signal, (void ∗)give_vdd(pt));
73          signal = addchain(signal, (void ∗)give_vss(pt));
74          /∗ reverse the list ∗/
75          signal = reverse(signal);
76          addloins(pt, "nand", getlofig("na2_y"), signal);
77       }
78

SEE ALSO

80       mbk(1), lofig(3), loins(3), chain(3), getloins(3), delloins(3).
81
82
83
84
85
86
87ASIM/LIP6                       October 1, 1997                    ADDLOINS(3)
Impressum