DPGEN_ROM4(3)

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

✨ DPGEN_ROM4(3) ✨

okay bestie, welcome to the Alliance - genlib User's Manual πŸ’– this one is the DPGEN_ROM4 page and it's literally the 4 words ROM Macro-Generator. sit down, hydrate, let's go 🫢


🌸 NAME 🌸

DPGEN_ROM4 β€” the 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 πŸ¦‹

So what it does is generate a ROM that's N bits and 2 words, optimized, and you get to name it modelname. that's the whole vibe ✨

🌈 TERMINAL NAMES 🌈

the terminals, in order, no cap:

  1. sel1 β€” the upper bit of the address (input, 1 bits).
  2. sel0 β€” the lower bit of the address (input, 1 bits).
  3. q β€” the selected word (output, N bit).
  4. vdd β€” power.
  5. vss β€” ground.

πŸ’« BEHAVIOR πŸ’«

the actual behavior, copy-pasted from the source of truth, do not touch:

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

πŸ‘‘ EXAMPLE πŸ‘‘

here's how you'd actually call it, and yeah the values are strings, they're strings, the comments say so twice because it matters 😭

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 πŸ”₯


and that's the page, bestie πŸ’œ ASIM/LIP6 dropped this one on 30 July 2004 and it's still serving. go build something iconic, periodt βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from