164 lines
5.1 KiB
HTML
164 lines
5.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
|
<!--Converted with LaTeX2HTML 2012 (1.2)
|
|
original version by: Nikos Drakos, CBLU, University of Leeds
|
|
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
|
|
* with significant contributions from:
|
|
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>DpgenShift</TITLE>
|
|
<META NAME="description" CONTENT="DpgenShift">
|
|
<META NAME="keywords" CONTENT="dpgen">
|
|
<META NAME="resource-type" CONTENT="document">
|
|
<META NAME="distribution" CONTENT="global">
|
|
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
|
<META NAME="Generator" CONTENT="LaTeX2HTML v2012">
|
|
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
|
|
|
<LINK REL="STYLESHEET" HREF="SoC.css">
|
|
|
|
<LINK REL="next" HREF="node26.html">
|
|
<LINK REL="previous" HREF="node24.html">
|
|
<LINK REL="up" HREF="dpgen.html">
|
|
<LINK REL="next" HREF="node26.html">
|
|
</HEAD>
|
|
|
|
<BODY >
|
|
|
|
<DIV CLASS="navigation">
|
|
<table align="center" width="100%" cellpadding="0" cellspacing="2">
|
|
<tr><td class="navigation" align="left" width="33%"><B>Previous</B></td>
|
|
<td class="navigation" align="center" width="34%"><B>Up</B></td>
|
|
<td class="navigation" align="right" width="33%"><B>Next</B></td>
|
|
|
|
</tr><tr>
|
|
<td class="navigation" align="left" width="33%"><A HREF="node24.html">DpgenAdsb2f</A></td>
|
|
<td class="navigation" align="center" width="34%"><A HREF="dpgen.html">Dpgen generators User's Manual</A></td>
|
|
<td class="navigation" align="right" width="33%"><A HREF="node26.html">DpgenShrot</A></td>
|
|
|
|
</tr></table>
|
|
<hr>
|
|
<br>
|
|
</DIV>
|
|
<!--End of Navigation Panel-->
|
|
|
|
<H1><A NAME="SECTION000250000000000000000">
|
|
DpgenShift</A>
|
|
</H1>
|
|
|
|
<UL>
|
|
<LI><SPAN CLASS="textbf">Name</SPAN> : DpgenShift - Shifter Macro-Generator
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">Synopsys</SPAN> :
|
|
<PRE>
|
|
Generate ( 'DpgenShift', modelname
|
|
, param = { 'nbit' : n
|
|
, 'physical' : True
|
|
}
|
|
)
|
|
</PRE>
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">Description</SPAN> : Generates a <code>n</code> bits shifter named <code>modelname</code>.
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">Terminal Names</SPAN> :
|
|
|
|
<UL>
|
|
<LI><SPAN CLASS="textbf">op</SPAN> : select the kind of shift (input, 2 bits)
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">shamt</SPAN> : the shift amount (input, <code>Y</code> bits)
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">i</SPAN> : value to shift (input, <code>n</code> bits)
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">o</SPAN> : output (<code>n</code> bits)
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">vdd</SPAN> : power
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">vss</SPAN> : ground
|
|
|
|
</LI>
|
|
</UL>
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">Parameters</SPAN> : Parameters are given in the map <code>param</code>.
|
|
|
|
<UL>
|
|
<LI><SPAN CLASS="textbf">nbit</SPAN> (mandatory) : Defines the size of the generator
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">physical</SPAN> (optional, default value : False) : In order to generate a layout
|
|
|
|
</LI>
|
|
</UL>
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">How it works</SPAN> :
|
|
|
|
<UL>
|
|
<LI>If the <code>op[0]</code> signal is set to <code>one</code>, performs a right shift, performs a left shift otherwise.
|
|
</LI>
|
|
<LI>If the <code>op[1]</code> signal is set to <code>one</code>, performs an arithmetic shift (only meaningful in case of a right shift).
|
|
</LI>
|
|
<LI>shamt : specifies the shift amount. The width of this signal (<code>Y</code>) is computed from the operator's width : <code>Y = ceil(log2(n)) </code>- 1
|
|
|
|
</LI>
|
|
</UL>
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">Example</SPAN> :
|
|
<PRE>
|
|
from stratus import *
|
|
|
|
class inst_shifter ( Model ) :
|
|
|
|
def Interface ( self ) :
|
|
self.instop = SignalIn ( "instop", 2 )
|
|
self.instshamt = SignalIn ( "instshamt", 2 )
|
|
self.insti = SignalIn ( "insti", 4 )
|
|
self.insto = SignalOut ( "insto", 4 )
|
|
|
|
self.vdd = VddIn ( "vdd" )
|
|
self.vss = VssIn ( "vss" )
|
|
|
|
def Netlist ( self ) :
|
|
Generate ( 'DpgenShifter', 'shifter_4'
|
|
, param = { 'nbit' : 4
|
|
, 'physical' : True
|
|
}
|
|
)
|
|
self.I = Inst ( 'shifter_4', 'inst'
|
|
, map = { 'op' : self.instop
|
|
, 'shamt' : self.instshamt
|
|
, 'i' : self.insti
|
|
, 'o' : self.insto
|
|
, 'vdd' : self.vdd
|
|
, 'vss' : self.vss
|
|
}
|
|
)
|
|
|
|
def Layout ( self ) :
|
|
Place ( self.I, NOSYM, Ref(0, 0) )
|
|
</PRE>
|
|
</LI>
|
|
</UL>
|
|
|
|
<DIV CLASS="navigation">
|
|
<p>
|
|
<hr><table align="center" width="100%" cellpadding="0" cellspacing="2">
|
|
<tr><td class="navigation" align="left" width="33%"><B>Previous</B></td>
|
|
<td class="navigation" align="center" width="34%"><B>Up</B></td>
|
|
<td class="navigation" align="right" width="33%"><B>Next</B></td>
|
|
|
|
</tr><tr>
|
|
<td class="navigation" align="left" width="33%"><A HREF="node24.html">DpgenAdsb2f</A></td>
|
|
<td class="navigation" align="center" width="34%"><A HREF="dpgen.html">Dpgen generators User's Manual</A></td>
|
|
<td class="navigation" align="right" width="33%"><A HREF="node26.html">DpgenShrot</A></td>
|
|
|
|
</tr></table>
|
|
<hr>
|
|
|
|
</DIV>
|
|
<!--End of Navigation Panel-->
|
|
<ADDRESS>
|
|
Sophie B<small>ELLOEIL</small><br>20051116.1
|
|
</ADDRESS>
|
|
</BODY>
|
|
</HTML>
|