DPGEN_NMUX2(3)

πŸ“¦ version 5.1.1, in fedora 43, fedora 44

πŸ’… 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:

  1. cmd : select (1 bit). the main character, the decision-maker, the one picking the lane πŸ‘‘
  2. i1 : input (N bits).
  3. i0 : input (N bits).
  4. nq : output (N bits). note the n β€” complemented, she's built that way πŸ’…
  5. vdd : power.
  6. 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: drive only takes 2 or 4. 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 πŸ’–βœ¨