DPGEN_SHIFT.3alc - Man Page
Shifter Macro-Generator
Synopsis
#include <genlib.h>
void GENLIB_MACRO (DPGEN_SHIFT, char *modelname, long flags, long N);
Description
Generate a N bits shifter with name modelname.
How it works :
- if the op[0] signal is set to '1' performs a right shift, performs a left shift otherwise.
- if the op[1] signal is set to '1' performs an arithmetic shift (only meaningful in case of a right shift).
- shamt : specifies the shift amount. The width of this signal (Y) is computed from the operator's width : Y = ceil(log2(N)) - 1.
Terminal Names
- op : select the kind of shift (input, 2 bit).
- shamt : the shift amount (input, Y bits).
- i : value to shift (input, N bits).
- o : output (N bits).
- 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);
See Also
Referenced By
30 July 2004 ASIM/LIP6 Alliance - genlib User's Manual