DPGEN_ROM2(3)

πŸ“¦ version 5.1.1-unstable-2025-02, in nixos 26.05, nixpkgs unstable

πŸ’– DPGEN_ROM2 πŸ’–

okay so bestie, welcome to the DPGEN_ROM2(3) page from the Alliance - genlib User's Manual β€” yes she's a library function page, she's fancy, she's in section 3, she lives in genlib.h land, and she's about to make you a whole ROM. no cap. πŸŽ€


✨ NAME ✨

DPGEN_ROM2 β€” the 2 words ROM Macro-Generator. that's it, that's her whole job description, and she ate. πŸ’…


🌸 SYNOPSIS 🌸

#include  <genlib.h>

void GENLIB_MACRO (DPGEN_ROM2, char *modelname, long flags, long N, char
*constVal0, char *constVal1);

like, that's the whole entrance. copy it exactly, don't freestyle the signature, i'm begging. πŸ™ˆ


πŸ¦‹ DESCRIPTION πŸ¦‹

Generate a N bits 2 words optimized ROM named modelname.

that's the vibe. you hand her a name and a size, she hands you a ROM. main character energy fr fr. ✨

🧚 TERMINAL NAMES 🧚

the terminals, in order, so you know who's who at the party:

  1. sel0 : address of the value (input, 1 bits).
  2. q : the selected word (output, N bit).
  3. vdd : power.
  4. vss : ground.
lowkey iconic lineup ngl β€” one address bit in, N bits of word out, plus the power rails doing their lil thing. 🫢

🌈 BEHAVIOR 🌈

here's the whole personality, in glorious code:

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

(and yes, that spelling up there is exactly how the original wrote it β€” i'm not touching it, i don't make the rules, i just relay them faithfully. πŸ’€)


πŸ”₯ EXAMPLE πŸ”₯

okay so here's what it actually looks like when you use her. study the strings, they're literally strings, i cannot stress this enough:

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 those /* A string! */ comments? the manpage is screaming at you that those are strings. listen to her. "0b1010" in quotes, not a number, a string, periodt. 😭


πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're the besties:


and that's the whole page, bestie β€” no details left behind, every flag, terminal, code snippet and warning preserved with love. πŸ’œ

signing off from ASIM/LIP6, dated 30 July 2004, on the DPGEN_ROM2(3) tip β€” mwah, go build something cute. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from