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

# DPGEN\_ROM2(3)

2 words ROM Macro-Generator

## NAME

DPGEN\_ROM2 - 2 words ROM Macro-Generator

## SYNOPSIS

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

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

## DESCRIPTION

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

### TERMINAL NAMES

- 1\.

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

- 2\.

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

- 3\.

  vdd : power.

- 4\.

  vss : ground.

### BEHAVIOR

```
q <= WITH sel0 SELECT
     contsVal0  WHEN B"0",
     constVal1  WHEN B"1";
```

## EXAMPLE

```
GENLIB_MACRO(DPGEN_ROM2, "model_rom2_set1_4"
                       , F_BEHAV|F_PLACE
                       , 4
                       , "0b1010"  /* A string! */
                       , "0b1100"  /* A string! */
                       );
GENLIB_LOINS( "model_rom2_set1_4"
            , "instance1_rom2_4"
            , "sel0"
            , "q[31:0]"
            , "vdd", "vss", NULL
            );
```

## SEE ALSO

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