173 lines
5.6 KiB
HTML
173 lines
5.6 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>DpgenAdsb2f</TITLE>
|
|
<META NAME="description" CONTENT="DpgenAdsb2f">
|
|
<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="node25.html">
|
|
<LINK REL="previous" HREF="node23.html">
|
|
<LINK REL="up" HREF="dpgen.html">
|
|
<LINK REL="next" HREF="node25.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="node23.html">DpgenXnor2mask</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="node25.html">DpgenShift</A></td>
|
|
|
|
</tr></table>
|
|
<hr>
|
|
<br>
|
|
</DIV>
|
|
<!--End of Navigation Panel-->
|
|
|
|
<H1><A NAME="SECTION000240000000000000000">
|
|
DpgenAdsb2f</A>
|
|
</H1>
|
|
|
|
<UL>
|
|
<LI><SPAN CLASS="textbf">Name</SPAN> : DpgenAdsb2f - Adder/Substractor Macro-Generator
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">Synopsys</SPAN> :
|
|
<PRE>
|
|
Generate ( 'DpgenAdsb2f', modelname
|
|
, param = { 'nbit' : n
|
|
, 'physical' : True
|
|
, 'behavioral' : True
|
|
}
|
|
)
|
|
</PRE>
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">Description</SPAN> : Generates a <code>n</code> bits adder/substractor named <code>modelname</code>.
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">Terminal Names</SPAN> :
|
|
|
|
<UL>
|
|
<LI><SPAN CLASS="textbf">i0</SPAN> : First operand (input, <code>n</code> bits)
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">i1</SPAN> : Second operand (input, <code>n</code> bits)
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">q</SPAN> : Output operand (ouput, <code>n</code> bits)
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">add_sub</SPAN> : Select addition or substraction (input, 1 bit)
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">c31</SPAN> : Sarry out. In unsigned mode, this is the overflow (output, 1 bit)
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">c30</SPAN> : Used to compute overflow in signed mode : <code>overflow = c31 xor c30</code> (output, 1 bit)
|
|
</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>
|
|
<LI><SPAN CLASS="textbf">behavioral</SPAN> (optional, default value : False) : In order to generate a behavior
|
|
|
|
</LI>
|
|
</UL>
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">How it works</SPAN> :
|
|
|
|
<UL>
|
|
<LI>If the <code>add_sub</code> signal is set to <code>zero</code>, an addition is performed, otherwise it's a substraction.
|
|
</LI>
|
|
<LI>Operation can be either signed or unsigned. In unsigned mode <code>c31</code> is the overflow ; in signed mode you have to compute overflow by <SPAN CLASS="textit">XORing</SPAN> <code>c31</code> and <code>c30</code>
|
|
|
|
</LI>
|
|
</UL>
|
|
</LI>
|
|
<LI><SPAN CLASS="textbf">Example</SPAN> :
|
|
<PRE>
|
|
from stratus import *
|
|
|
|
class inst_ADSB2F ( Model ) :
|
|
|
|
def Interface ( self ) :
|
|
self.in1 = SignalIn ( "in1", 8 )
|
|
self.in2 = SignalIn ( "in2", 8 )
|
|
self.out = SignalOut ( "o", 8 )
|
|
self.as = SignalIn ( "as", 1 )
|
|
self.c0 = SignalOut ( "c0", 1 )
|
|
self.c1 = SignalOut ( "c1", 1 )
|
|
|
|
self.vdd = VddIn ( "vdd" )
|
|
self.vss = VssIn ( "vss" )
|
|
|
|
def Netlist ( self ) :
|
|
Generate ( 'DpgenAdsb2f', 'adder_8'
|
|
, param = { 'nbit' : 8
|
|
, 'physical' : True
|
|
}
|
|
)
|
|
self.I = Inst ( 'adder_8', 'inst'
|
|
, map = { 'i0' : self.in1
|
|
, 'i1' : self.in2
|
|
, 'add_sub' : self.as
|
|
, 'q' : self.out
|
|
, 'c30' : self.c0
|
|
, 'c31' : self.c1
|
|
, '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="node23.html">DpgenXnor2mask</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="node25.html">DpgenShift</A></td>
|
|
|
|
</tr></table>
|
|
<hr>
|
|
|
|
</DIV>
|
|
<!--End of Navigation Panel-->
|
|
<ADDRESS>
|
|
Sophie B<small>ELLOEIL</small><br>20051116.1
|
|
</ADDRESS>
|
|
</BODY>
|
|
</HTML>
|