DPGEN_CONST(3)

πŸ“¦ version 5.1.1, in fedora 43, fedora 44

πŸ’– DPGEN_CONST β€” the constant macro-generator, bestie πŸ’–

okay so this is a page from the Alliance - genlib User's Manual, it lives in section 3 of the manual (that's the (3) in DPGEN_CONST(3), iykyk), and it's literally all about generating constant macros. no cap. let's get into it 🫢


✨ NAME ✨

DPGEN_CONST β€” Constant Macro-Generator πŸ‘‘

🌸 SYNOPSIS 🌸

#include  <genlib.h>

void GENLIB_MACRO (DPGEN_CONST, char *modelname, long flags, long N,
char *constVal0);

like, that's the whole vibe. #include <genlib.h> and then you call GENLIB_MACRO with DPGEN_CONST as the first thing. periodt πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically: generate a N bits constant named modelname. that's it, that's the function. iconic behaviour honestly ✨

πŸŽ€ TERMINAL NAMES πŸŽ€

here's the whole cast of characters, in order, no skips:

  1. q : the constant (output, N bit). ⭐
  2. vdd : power. ⚑
  3. vss : ground. 🌍

πŸ’€ BEHAVIOR πŸ’€

the actual behaviour is this lil line:

q <= constVal;

not me being obsessed with how simple that is 😭

πŸ”₯ EXAMPLE πŸ”₯

here's how you'd actually use it, bestie β€” watch the formatting:

GENLIB_MACRO(DPGEN_CONST, "model_const_0xFFFF0000"
                       , F_BEHAV|F_PLACE
                       , 4
                       , "0xFFFF0000"  /* A string! */
                       );

GENLIB_LOINS( "model_const_0xFFFF0000"
            , "instance1_const_0xFFFF0000"
            , "q[31:0]"
            , "vdd", "vss", NULL
            );
ok real talk β€” that /* A string! */ comment is doing the lord's work because "0xFFFF0000" is a string, not a number. do not come for me, just read the comment. πŸ™ˆ

🌈 SEE ALSO 🌈


and that's the tea πŸ“ this whole page is from ASIM/LIP6, dated 30 July 2004 β€” vintage but still slaying, fr fr. go build something cute with it πŸ’œπŸ§š