DPGEN_MUX2(3)

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

πŸ’– DPGEN_MUX2 β€” Multiplexer Macro-Generator πŸ’–

okay bestie so this is a page from the Alliance - genlib User's Manual, section 3, and it's literally all about DPGEN_MUX2. it's giving "macro-generator that makes you a multiplexer" and honestly? iconic. let's get into it πŸ¦‹


✨ NAME ✨

DPGEN_MUX2 β€” Multiplexer Macro-Generator πŸŽ€

✨ SYNOPSIS ✨

#include  <genlib.h>

void GENLIB_MACRO (DPGEN_MUX2, char *modelname, long flags, long N, long
drive);

like, that's the whole vibe. one function call and you're off 🫢

✨ DESCRIPTION ✨

so basically you're generating an N bits two inputs multiplexer, and you get to name it whatever you want with modelname. main character energy fr fr πŸ’…

valid drive values are literally just: 1, 2 or 4. no cap, that's the whole list. don't try anything else, bestie πŸ™ˆ


🌸 TERMINAL NAMES 🌸

the lineup, in order, no skips:

  1. cmd : select (1 bit).
  2. i1 : input (N bits).
  3. i0 : input (N bits).
  4. q : output (N bits).
  5. vdd : power.
  6. vss : ground.

six terminals. all accounted for. slay ✨


πŸ¦‹ BEHAVIOR πŸ¦‹

the moment. the way that it do:

q <= WITH cmd SELECT i0 WHEN '0',
                     i1 WHEN '1';

so when cmd says '0' you get i0, when cmd says '1' you get i1. periodt πŸ‘‘


🌈 EXAMPLE 🌈

here's how you actually use it, copy-paste core:

GENLIB_MACRO(DPGEN_MUX2, "model_mux2_32"
                       , F_BEHAV|F_PLACE
                       , 32
                       , 1
                       );

GENLIB_LOINS( "model_mux2_32"
            , "instance1_mux2_32"
            , "cmd"
            , "i1[31:0]"
            , "i0[31:0]"
            ,  "q[31:0]"
            , "vdd", "vss", NULL
            );

a 32-bit mux, drive of 1, and then you instantiate it. obsessed πŸ”₯


πŸ’œ SEE ALSO πŸ’œ


go read those if you want the full lore, bestie πŸ“

and that's the whole page! πŸ’– this lil' beauty came from ASIM/LIP6, dated 30 July 2004, and it's living in the DPGEN_MUX2(3) section of the manual. mwah, bye bestie πŸ§šβœ¨πŸ’…

πŸ“¦ where this page comes from