DPGEN_NAND2MASK(3)

๐Ÿ“ฆ version 5.1.1, in fedora 43, fedora 44

๐Ÿ’… DPGEN_NAND2MASK ๐Ÿ’…

okay bestie, welcome to the Alliance genlib corner of the manual, section 3. This one's called DPGEN_NAND2MASK and it's literally the Programmable Mask Macro-Generator</> โ€” no cap, that's its whole name. Let's get into it. ๐ŸŽ€


โœจ SYNOPSIS โœจ

like, this is how you even call it:

#include  <genlib.h>

void GENLIB_MACRO (DPGEN_NAND2MASK, char *modelname, long flags, long N,
char *constVal);

๐ŸŒธ DESCRIPTION ๐ŸŒธ

It generates an N bits conditionnal NAND mask named modelname. Yes, "conditionnal" with two n's, that's how the original spells it, we respect the source. ๐Ÿ’–

Now the way this thing actually works, because it's giving โœจlogic gate loreโœจ:

  • if the cmd signal is set to '0', the mask is NOT applied, so the whole operator behave like an inverter. ๐ŸŒ€
  • if the cmd signal is set to '1', the mask IS applied, and the output is the complemented result of the input value ANDed with the mask (supplied by constVal). ๐Ÿ’ฅ

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 is what it is, it's permanent, it's committed. ๐Ÿ”’

โš ๏ธ A common error is to give a real C constant for the constVal argument. Be aware that it is a character string. Like, it looks like a number bestie but it is a STRING. Do not be fooled. ๐Ÿ˜ญ

๐Ÿ”Œ 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 ๐Ÿง 

here's the vibe in literal code form, verbatim, don't touch it:

nq <= WITH cmd SELECT not(i0)                 WHEN '0',
                      not(i0 and X"0000FFFF") WHEN '1';

๐Ÿ”ฅ EXAMPLE ๐Ÿ”ฅ

look at this absolute serve of a call:

GENLIB_MACRO(DPGEN_NAND2MASK, "model_nand2mask_0000FFFF_32"
                            , F_BEHAV|F_PLACE
                            , 32
                            , "0x0000FFFF" /* A string! */
                            );

GENLIB_LOINS( "model_nand2mask_0000FFFF_32"
            , "instance1_nand2mask_32"
            , "cmd"
            , "i0[31:0]"
            ,  "q[31:0]"
            , "vdd", "vss", NULL
            );

not me pointing out that /* A string! */ comment like it's the main character... because honestly, it is. ๐Ÿ‘‘


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€


and that's the whole page bestie, you ate it, go generate some masks ๐Ÿ’…โœจ

signed, sealed, delivered by ASIM/LIP6 โ€” page date 30 July 2004 ๐Ÿฆ‹๐ŸŽ€๐Ÿ’– periodt.