DPGEN_MUX2(3)
π 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:
cmd: select (1 bit).i1: input (N bits).i0: input (N bits).q: output (N bits).vdd: power.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
- 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