DPGEN_ROM4(3)
β¨ 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:
sel1β the upper bit of the address (input, 1 bits).sel0β the lower bit of the address (input, 1 bits).qβ the selected word (output, N bit).vddβ power.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
- nixos 26.05: alliance 5.1.1-unstable-2025-02-24
- nixpkgs unstable: alliance 5.1.1-unstable-2025-02-24
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms