Adding documentation on the shift/rotation operator.

This commit is contained in:
Frederic Petrot 2002-06-17 09:43:17 +00:00
parent 4c3c211ea5
commit a5108651b9
3 changed files with 139 additions and 24 deletions

View File

@ -31,25 +31,24 @@
<refsect1>
<title> Description </title>
<para> Generate a &N; bits shifter named &modelname;.
<para> Generate a &N; bits shifter with name &modelname;.
</para>
<para> How it works :
<itemizedlist>
<listitem>
<para> if <literal>op[0]</literal> signal is set to &one; perform
a right shift, left shift otherwise.
<para> if the <literal>op[0]</literal> signal is set to &one; performs
a right shift, performs a left shift otherwise.
</para>
</listitem>
<listitem>
<para> if <literal>op[1]</literal> signal is set to &one; perform
a sign extention, i.e. an arithmetic shift (only meaningful in case
of a right shift).
<para> if the <literal>op[1]</literal> signal is set to &one; performs
an arithmetic shift (only meaningful in case of a right shift).
</para>
</listitem>
<listitem>
<para> &shamt; : specify the shift amount. The wide of this signal
(&Y;) is computed from the operator's wide :
<literal>Y = log<subscript>2</subscript>(N) - 1</literal>.
<para> &shamt; : specifies the shift amount. The width of this signal
(&Y;) is computed from the operator's width :
<literal>Y = ceil(log<subscript>2</subscript>(N)) - 1</literal>.
</para>
</listitem>
</itemizedlist>
@ -67,10 +66,10 @@
<para> &shamt; : the shift amount (input, &Y; bits). </para>
</listitem>
<listitem>
<para> &i0; : value to shift (input, &N; bits). </para>
<para> &i; : value to shift (input, &N; bits). </para>
</listitem>
<listitem>
<para> &q; : output (&N; bits). </para>
<para> &o; : output (&N; bits). </para>
</listitem>
<listitem>
<para> <literal>vdd</literal> : power. </para>
@ -89,20 +88,17 @@
<para>
<programlisting>
GENLIB_MACRO(DPGEN_SHIFT, "model_shift_32"
, F_BEHAV|F_PLACE
, 32
);
GENLIB_MACRO(DPGEN_SHIFT, "model_shift_32",
F_BEHAV|F_PLACE,
32);
GENLIB_LOINS( "model_shift_32"
, "instance1_shift_32"
, "add_sub"
, "op[1:0]"
, "shamt[4:0]"
, "i0[31:0]"
, "q[31:0]"
, "vdd", "vss", NULL
);
GENLIB_LOINS("model_shift_32",
"instance1_shift_32",
"op[1:0]",
"shamt[4:0]",
"x[31:0]",
"y[31:0]",
"vdd", "vss", NULL);
</programlisting>
</para>

View File

@ -0,0 +1,115 @@
<refentry id="DPGEN-SHROT">
<?dbhtml filename="man_dpgen_shrot.html">
<refmeta>
<refentrytitle>DPGEN_SHROT</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>ASIM/LIP6</refmiscinfo>
</refmeta>
<refnamediv>
<refname> DPGEN_SHROT </refname>
<refpurpose> Shift/Rotation Macro-Generator </refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;genlib.h&gt;</funcsynopsisinfo>
<funcprototype>
<funcdef>void <function>GENLIB_MACRO</function></funcdef>
<paramdef>DPGEN_SHROT</paramdef>
<paramdef>char *<parameter>modelname</parameter></paramdef>
<paramdef>long <parameter>flags</parameter></paramdef>
<paramdef>long <parameter>N</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title> Description </title>
<para> Generate a &N; bits shift/rotation operator with name &modelname;.
</para>
<para> How it works :
<itemizedlist>
<listitem>
<para> if the <literal>op[0]</literal> signal is set to &one;
right shift/rotation occurs, otherwise left shift/rotation
occurs.
</para>
</listitem>
<listitem>
<para> if the <literal>op[1]</literal> signal is set to &one; performs
an arithmetic shift (only meaningful in case of a right shift).
</para>
</listitem>
<listitem>
<para> if the <literal>op[2]</literal> signal is set to &one; performs
a rotation, otherwise performs a shift.
</para>
</listitem>
<listitem>
<para> &shamt; : specifies the shift amount. The width of this signal
(&Y;) is computed from the operator's width :
<literal>Y = ceil(log<subscript>2</subscript>(N)) - 1</literal>.
</para>
</listitem>
</itemizedlist>
</para>
<refsect2>
<title> Terminal Names </title>
<orderedlist>
<listitem>
<para> &op; : select the kind of shift/rotation (input, 3 bit).
</para>
</listitem>
<listitem>
<para> &shamt; : the shift amount (input, &Y; bits). </para>
</listitem>
<listitem>
<para> &i; : value to shift (input, &N; bits). </para>
</listitem>
<listitem>
<para> &o; : output (&N; bits). </para>
</listitem>
<listitem>
<para> <literal>vdd</literal> : power. </para>
</listitem>
<listitem>
<para> <literal>vss</literal> : ground. </para>
</listitem>
</orderedlist>
</refsect2>
</refsect1>
<refsect1>
<title> Example </title>
<para>
<programlisting>
GENLIB_MACRO(DPGEN_SHROT, "rot25",
F_BEHAV|F_PLACE,
25);
GENLIB_LOINS("rot25",
"instance1_rot25",
"op[2:0]",
"shamt[4:0]",
"x[31:0]",
"y[31:0]",
"vdd", "vss", NULL);
</programlisting>
</para>
</refsect1>
&man-dpgen-see-also;
</refentry>

View File

@ -258,6 +258,10 @@
<refentrytitle>DPGEN_SHIFT</refentrytitle>
<manvolnum>3</manvolnum>
</citerefentry></link></para></listitem>
<listitem><para><link linkend="DPGEN-SHROT"><citerefentry>
<refentrytitle>DPGEN_SHROT</refentrytitle>
<manvolnum>3</manvolnum>
</citerefentry></link></para></listitem>
</itemizedlist>
</para>
</listitem>