DPGEN_NMUX2(3)
π DPGEN_NMUX2(3) β the multiplexer macro-generator, bestie edition
okay so this is a page from the Alliance - genlib User's Manual and it's literally about a macro-generator called DPGEN_NMUX2. it's giving very niche, very powerful, very "iykyk". let's get into it π
β¨ NAME β¨
DPGEN_NMUX2 β Multiplexer Macro-Generator. yes bestie, it makes muxes. iconic behavior.
πΈ SYNOPSIS πΈ
#include <genlib.h>
void GENLIB_MACRO (DPGEN_NMUX2, char *modelname, long flags, long N,
long drive);
that's the whole vibe. one include, one call, and you're off π
π¦ DESCRIPTION π¦
so what this does is generate a N bits two inputs multiplexer β with a complemented output and a power of drive β and it names the whole thing modelname. she's built different fr fr.
valid drive values are, and I cannot stress this enough: 2 or 4. that's the list. that's it. don't try to be creative, the creativity is not the assignment here π
π§ TERMINAL NAMES π§
here's the cast of characters, in order, no notes:
cmd: select (1 bit). the main character, the decision-maker, the one picking the lane πi1: input (N bits).i0: input (N bits).nq: output (N bits). note the n β complemented, she's built that way πvdd: power.vss: ground.
β BEHAVIOR β
the actual logic, and yes we are copying this exactly because it's load-bearing:
nq <= WITH cmd SELECT not i0 WHEN '0',
not i1 WHEN '1';
so like. cmd says '0' β you get not i0. cmd says '1' β you get not i1. simple, clean, slays β¨
π₯ EXAMPLE π₯
here's how you'd actually call it, with a 32-bit mux at drive of 2:
GENLIB_MACRO(DPGEN_NMUX2, "model_nmux2_32"
, F_BEHAV|F_PLACE
, 32
, 2
);
and then you instantiate it, because a macro with no instance is just a vibe with nowhere to go:
GENLIB_LOINS( "model_nmux2_32"
, "instance1_nmux2_32"
, "cmd"
, "i1[31:0]"
, "i0[31:0]"
, "nq[31:0]"
, "vdd", "vss", NULL
);
look at those terminal names lining up with the list above. obsessed. that's the whole flow, no cap π«Ά
π SEE ALSO π
go read those too, bestie, they're the extended universe π
quick reminder:driveonly takes2or4. anything else and we simply don't know her. π
that's the whole page!! this one came from ASIM/LIP6, dated 30 July 2004 β so yeah she's vintage, she's classic, she's aging like fine wine π anyway love u, go generate some muxes, mwah πβ¨
π¦ where this page comes from
- fedora 43: alliance-devel 5.1.1-35.20160506gitd8c05cd.fc42 Β· GPL-2.0-only
- fedora 43: alliance-devel 5.1.1-35.20160506gitd8c05cd.fc42 Β· GPL-2.0-only
- fedora 44: alliance-devel 5.1.1-35.20160506gitd8c05cd.fc42 Β· GPL-2.0-only
- fedora 44: alliance-devel 5.1.1-35.20160506gitd8c05cd.fc42 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms