DPGEN_SHIFT(3)
π DPGEN_SHIFT β the shifter macro-generator bestie β¨
okay so this is a page from the Alliance - genlib User's Manual, and it's all about DPGEN_SHIFT, the Shifter Macro-Generator. yes queen, we're generating shifters today π
β¨ NAME β¨
DPGEN_SHIFT β Shifter Macro-Generator π¦
πΈ SYNOPSIS πΈ
#include <genlib.h>
void GENLIB_MACRO (DPGEN_SHIFT, char *modelname, long flags, long N);
π DESCRIPTION π
bestie, this literally generates a shifter with N bits and names it modelname. that's the whole vibe β¨
how it works (the lore π§):
- if the
op[0]signal is set to'1'it performs a right shift, and performs a left shift otherwise. no in-between, it's giving binary π - if the
op[1]signal is set to'1'it performs an arithmetic shift (and lowkey this one is only meaningful in case of a right shift, so don't come for me). shamt: specifies the shift amount. the width of this signal (Y) is computed from the operator's width like this:Y = ceil(log2(N)) - 1. math ate, periodt π―
π«Ά TERMINAL NAMES π«Ά
op: select the kind of shift (input, 2 bit).shamt: the shift amount (input,Ybits).i: value to shift (input,Nbits).o: output (Nbits).vdd: power.vss: ground.
π EXAMPLE π
GENLIB_MACRO(DPGEN_SHIFT, "model_shift_32",
F_BEHAV|F_PLACE,
32);
GENLIB_LOINS("model_shift_32",
"instance1_shift_32",
"op[1:0]",
"shamt[4:0]",
"x[31:0]",
"y[31:0]",
"vdd", "vss", NULL);
look at her go π iconic behavior fr fr π
π SEE ALSO π
ngl if you got all the way here you're the main character of this manpage π go shift some bits bestie, iykyk π
this whole thing comes courtesy of ASIM/LIP6, dated 30 July 2004 β vintage but still slaying π π
π¦ 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