DPGEN_NOR2MASK(3)

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

πŸ’– 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 cmd signal 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 cmd signal is set to '1', the mask IS applied, and the output is the complemented result of the input value ORed with the mask (supplied by constVal). 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 🧚

  1. cmd : mask control (1 bit).
  2. i0 : input (N bits).
  3. q : output (N bits).
  4. vdd : power.
  5. 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