DPGEN_XNOR2MASK(3)
π DPGEN_XNOR2MASK π
okay bestie, welcome to the Alliance - genlib User's Manual corner of the internet, where today we're unlocking the Programmable Mask Macro-Generator β¨ it's giving hardware, it's giving generator, it's giving iconic π
β¨ NAME β¨
DPGEN_XNOR2MASK β the Programmable Mask Macro-Generator, no cap π
πΈ SYNOPSIS πΈ
#include <genlib.h>
void GENLIB_MACRO (DPGEN_XNOR2MASK, char *modelname, long flags, long N,
char *constVal);
like, that's the whole vibe right there π
π¦ DESCRIPTION π¦
So basically it generates an N bits conditionnal XNOR mask and names it modelname. slay.
How it works, bestie, listen up :
- if the
cmdsignal is set to'0', the mask is NOT applied, so the whole operator behave like an inverter. it's literally just flipping bits, periodt π - if the
cmdsignal is set to'1', the mask IS applied, and the output is the complemented result of the input value XORed with the mask (supplied by constVal). ate that π
The constant constVal is given to the macro-generator call, therefore the value cannot be changed afterward : it's hard wired in the operator. it's committed. no takebacks, no edits, iykyk π
β οΈ A common error is to give a real C constant for the constVal argument. Be aware that it is a character string. yes, a string, bestie, not a number. the number of people who trip on this... π
π TERMINAL NAMES π
cmd: mask control (1 bit). the main character of this whole operation πi0: input (N bits).q: output (N bits).vdd: power.vss: ground.
π BEHAVIOR π
nq <= WITH cmd SELECT not(i0) WHEN '0',
not(i0 xor X"0000FFFF") WHEN '1';
look at her. the conditional. the range. the drama β¨
π EXAMPLE π
GENLIB_MACRO(DPGEN_XNOR2MASK, "model_xnor2mask_0000FFFF_32"
, F_BEHAV|F_PLACE
, 32
, "0x0000FFFF" /* A string! */
);
GENLIB_LOINS( "model_xnor2mask_0000FFFF_32"
, "instance1_xnor2mask_32"
, "cmd"
, "i0[31:0]"
, "q[31:0]"
, "vdd", "vss", NULL
);
see that /* A string! */ comment? yeah, that's the whole point, don't forget it π
π SEE ALSO π
and that's the tea, bestie π«Ά this lil page came to you from ASIM/LIP6, dated 30 July 2004 β oldie but a goodie, fr fr πβ¨π
π¦ 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