DPGEN_BUSE(3)
DPGEN_BUSE π
okay bestie, welcome to DPGEN_BUSE(3) from the Alliance - genlib User's Manual β yeah that genlib, the one you keep opening at 2am. this is the tristate Macro-Generator page and it's genuinely so good, no cap. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
DPGEN_BUSE β the tristate Macro-Generator. that's it. that's the whole vibe. π
πΈ SYNOPSIS πΈ
#include <genlib.h>
void GENLIB_MACRO (DPGEN_BUSE, char *modelname, long flags, long N);
yes literally two lines and one of them is the include. iconic behaviour tbh β¨
π¦ DESCRIPTION π¦
Generate a N bits two inputs tristate with named modelname. that's the entire job description, and it does it beautifully. no notes. π
π TERMINAL NAMES π
the terminals, in order, because order matters bestie:
cmd: select (1 bit). one singular bit. she's small but she decides everything. main character energy fr.i0: input (N bits). the actual data, all N of it.q: output (N bits). same width, she's matching.vdd: power. β‘vss: ground. π
π BEHAVIOR π
ts:BLOCK(cmd = '1') BEGIN
q <= GUARDED i0;
END
so when cmd is '1', the guarded assignment lets i0 through to q β and when she's not selected, that output is tristate, floating, off doing her own thing π¦. the GUARDED is doing the heavy lifting there, don't skip her.
π₯ EXAMPLE π₯
GENLIB_MACRO(DPGEN_BUSE, "model_buse_32"
, F_BEHAV|F_PLACE
, 32
);
GENLIB_LOINS( "model_buse_32"
, "instance1_buse_32"
, "cmd"
, "i0[31:0]"
, "q[31:0]"
, "vdd", "vss", NULL
);
a whole 32-bit tristate bus, generated and instantiated, and she ate. π
note the 32 up top and the [31:0] down below β that's the same 32 bits living her best life, not a coincidence, do not "fix" it. π
π SEE ALSO π
ASIM/LIP6 Β· 30 July 2004 β that's the source, the version and the date bestie, we always cite our sources. go generate something cute, ily, bye ππβ¨
π¦ 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