DPGEN_NOR2MASK(3)
π DPGEN_NOR2MASK π
okay bestie, welcome to the Alliance - genlib User's Manual page for DPGEN_NOR2MASK(3) and honestly? she's a baddie. a Programmable Mask Macro-Generator. yes ma'am. let's get into it π
β¨ SYNOPSIS β¨
#include <genlib.h>
void GENLIB_MACRO (DPGEN_NOR2MASK, char *modelname, long flags, long N,
char *constVal);
that's the whole vibe right there, no notes π
πΈ DESCRIPTION πΈ
so what she does is generate a N bits conditionnal NOR mask and she names it modelname. periodt.
How it works (the way that this is actually so simple, i'm obsessed):
- if the
cmdsignal is set to'0', the mask is NOT applied, so the whole operator behave like an inverter. literally just inverting. she's off duty β¨ - if the
cmdsignal is set to'1', the mask IS applied, and the output is the complemented result of the input value ORed with the mask (supplied byconstVal). she's ON. main character energy π
the constant constVal is given to the macro-generator call, which means the value cannot be changed afterward β it's hard wired in the operator. no take-backs, no edits, no growth, she is who she is π¦
β οΈ a common error is to give a real C constant for the constVal argument. be aware that it is a character string. like, in quotes. as a string. not me watching people get this wrong every single time π
π§ TERMINAL NAMES π§
cmd: mask control (1 bit).i0: input (N bits).q: output (N bits).vdd: power.vss: ground.
π BEHAVIOR π
nq <= WITH cmd SELECT not(i0) WHEN '0',
not(i0 or X"0000FFFF") WHEN '1';
look at her go. iconic. β
π EXAMPLE π
GENLIB_MACRO(DPGEN_NOR2MASK, "model_nor2mask_0000FFFF_32"
, F_BEHAV|F_PLACE
, 32
, "0x0000FFFF" /* A string! */
);
GENLIB_LOINS( "model_nor2mask_0000FFFF_32"
, "instance1_nor2mask_32"
, "cmd"
, "i0[31:0]"
, "q[31:0]"
, "vdd", "vss", NULL
);
see that little /* A string! */ comment? yeah. that's the reminder. iykyk π
π«Ά SEE ALSO π«Ά
okay that's the page, go forth and mask responsibly π
ASIM/LIP6 Β· 30 July 2004 β yeah she's an older queen but she still ate, fr fr. mwah π πβ¨
π¦ where this page comes from
- fedora 43: alliance-devel 5.1.1-35.20160506gitd8c05cd.fc42 Β· GPL-2.0-only
- fedora 43: alliance-devel 5.1.1-35.20160506gitd8c05cd.fc42 Β· GPL-2.0-only
- fedora 44: alliance-devel 5.1.1-35.20160506gitd8c05cd.fc42 Β· GPL-2.0-only
- fedora 44: alliance-devel 5.1.1-35.20160506gitd8c05cd.fc42 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms