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

# GENLIB\_MACRO(3)

Interface with all MACRO generators.

## NAME

GENLIB\_MACRO - Interface with all MACRO generators.

## SYNOPSIS

**#include  \<genlib.h\>**

**void GENLIB\_MACRO (long** *function***, char \****modelname***, long** *flags***, long** *N***, long** *drive***, long** *regNumber***, char \****constVal***);**

## DESCRIPTION

The **GENLIB\_MACRO()** fonction call is the generic interface to all **genlib** macro generators. As all generators do not have the sames arguments it takes a variable number of arguments.

Arguments are of two kinds :

- •

  Mandatory arguments : those arguments must always be supplied. They represents the minimal set of common arguments for all macro-generators. Mandatory arguments comme firts in the arguments list.

- •

  Optional arguments : arguments specifics to a macro-generator or a class of macro-generators.

### ARGUMENTS

- 1\.

  long  *function* : (mandatory) specify which macro-generator is to be invoked. For example, to create a two entry multiplexer gives GENLIB\_MUX2.

- 2\.

  char\* *modelname* : (mandatory) specify the name of the model to be generated. For example : "model\_mux2\_32bits".

- 3\.

  long  *flags* : (mandatory) tells which views are to be generated. It is a logical combination of the following values : (**ORed**)

  - 1\.

    F\_PLACE : generate physical view (placement only).

  - 2\.

    F\_BEHAV : generate behavioral view (**VHDL** view).

  - 3\.

    F\_LSB\_FIRST : the terminal of index zero is matched to the LSB, thus a 32 bits vector will be written : "signal\[31:0\]".

  - 4\.

    F\_MSB\_FIRST : the terminal of index zero is matched to the MSB, thus a 32 bits vector will be written : "signal\[0:31\]" (aka. IBM notation).

- 4\.

  long  *N* : (mandatory) width of the model's bus to be generated.

- 5\.

  long  *drive* : (optional) output power drive.

- 6\.

  long  *regNumber* : (optional) number of registers or depth of for a FIFO macro-generator.

- 7\.

  char\* *constval* : (optional) a character string holding a constant. For example : "0xFFFF0000".

### AVAILABLE MACRO-GENERATORS

- •

  Inverters and Buffers :

  - •

    [**DPGEN\_INV**(3)](/DPGEN_INV/3.md)

  - •

    [**DPGEN\_BUFF**(3)](/DPGEN_BUFF/3.md)

- •

  Boolean Operators :

  - •

    [**DPGEN\_NAND2**(3)](/DPGEN_NAND2/3.md)

  - •

    [**DPGEN\_NAND3**(3)](/DPGEN_NAND3/3.md)

  - •

    [**DPGEN\_NAND4**(3)](/DPGEN_NAND4/3.md)

  - •

    [**DPGEN\_AND2**(3)](/DPGEN_AND2/3.md)

  - •

    [**DPGEN\_AND3**(3)](/DPGEN_AND3/3.md)

  - •

    [**DPGEN\_AND4**(3)](/DPGEN_AND4/3.md)

  - •

    [**DPGEN\_NOR2**(3)](/DPGEN_NOR2/3.md)

  - •

    [**DPGEN\_NOR3**(3)](/DPGEN_NOR3/3.md)

  - •

    [**DPGEN\_NOR4**(3)](/DPGEN_NOR4/3.md)

  - •

    [**DPGEN\_OR2**(3)](/DPGEN_OR2/3.md)

  - •

    [**DPGEN\_OR3**(3)](/DPGEN_OR3/3.md)

  - •

    [**DPGEN\_OR4**(3)](/DPGEN_OR4/3.md)

  - •

    [**DPGEN\_XOR2**(3)](/DPGEN_XOR2/3.md)

  - •

    [**DPGEN\_XNOR2**(3)](/DPGEN_XNOR2/3.md)

- •

  Multiplexers and Tristates :

  - •

    [**DPGEN\_NMUX2**(3)](/DPGEN_NMUX2/3.md)

  - •

    [**DPGEN\_MUX2**(3)](/DPGEN_MUX2/3.md)

  - •

    [**DPGEN\_NBUSE**(3)](/DPGEN_NBUSE/3.md)

  - •

    [**DPGEN\_BUSE**(3)](/DPGEN_BUSE/3.md)

- •

  Programmable Masks :

  - •

    [**DPGEN\_NAND2MASK**(3)](/DPGEN_NAND2MASK/3.md)

  - •

    [**DPGEN\_NOR2MASK**(3)](/DPGEN_NOR2MASK/3.md)

  - •

    [**DPGEN\_XNOR2MASK**(3)](/DPGEN_XNOR2MASK/3.md)

- •

  Arithmetics Operators :

  - •

    [**DPGEN\_ADSB2F**(3)](/DPGEN_ADSB2F/3.md)

  - •

    [**DPGEN\_SHIFT**(3)](/DPGEN_SHIFT/3.md)

- •

  Miscellaneous :

  - •

    [**DPGEN\_NUL**(3)](/DPGEN_NUL/3.md)

  - •

    [**DPGEN\_CONST**(3)](/DPGEN_CONST/3.md)

  - •

    [**DPGEN\_ROM2**(3)](/DPGEN_ROM2/3.md)

  - •

    [**DPGEN\_ROM4**(3)](/DPGEN_ROM4/3.md)

- •

  Registers :

  - •

    [**DPGEN\_RF1**(3)](/DPGEN_RF1/3.md)

  - •

    **DPGEN\_RF1R0**(3)

  - •

    [**DPGEN\_FIFO**(3)](/DPGEN_FIFO/3.md)

  - •

    [**DPGEN\_RF1D**(3)](/DPGEN_RF1D/3.md)

  - •

    **DPGEN\_RF1DR0**(3)

  - •

    [**DPGEN\_DFF**(3)](/DPGEN_DFF/3.md)

  - •

    [**DPGEN\_DFFT**(3)](/DPGEN_DFFT/3.md)

  - •

    [**DPGEN\_SFF**(3)](/DPGEN_SFF/3.md)

  - •

    [**DPGEN\_SFFT**(3)](/DPGEN_SFFT/3.md)

## SEE ALSO

**mbk**(1),
