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

# DPGEN\_ROM4(3)

4 words ROM Macro-Generator

## NAME

DPGEN\_ROM4 - 4 words ROM Macro-Generator

## SYNOPSIS

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

**void GENLIB\_MACRO (DPGEN\_ROM4, char \****modelname***, long** *flags***, long** *N***, char \****constVal0***, char \****constVal1***, char \****constVal2***, char \****constVal3***);**

## DESCRIPTION

Generate a *N* bits 2 words optimized ROM named *modelname*.

### TERMINAL NAMES

- 1\.

  sel1 : upper bit of the address (input, 1 bits).

- 2\.

  sel0 : lower bit of the address (input, 1 bits).

- 3\.

  q : the selected word (output, *N* bit).

- 4\.

  vdd : power.

- 5\.

  vss : ground.

### BEHAVIOR

```
q <= WITH sel1 & sel0 SELECT contsVal0  WHEN B"00",
                             contsVal1  WHEN B"01",
                             contsVal2  WHEN B"10",
                             constVal3  WHEN B"11";
```

## EXAMPLE

```
GENLIB_MACRO(DPGEN_ROM4, "model_rom4_set1_16"
                       , F_BEHAV|F_PLACE
                       , 4
                       , "0xFF00"  /* A string! */
                       , "0xCCCC"  /* A string! */
                       , "0xF0F0"  /* A string! */
                       , "0xAAAA"  /* A string! */
                       );
GENLIB_LOINS( "model_rom4_set1_16"
            , "instance1_rom4_set1_16"
            , "sel1"
            , "sel0"
            , "q[31:0]"
            , "vdd", "vss", NULL
            );
```

## SEE ALSO

[**GENLIB\_MACRO**(3)](/GENLIB_MACRO/3.md), [**genlib**(1)](/genlib/1.md)
