coriolis/stratus1/doc/stratus/latex/stratus/node4.html

326 lines
9.4 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>Stratus</TITLE>
<META NAME="description" CONTENT="Stratus">
<META NAME="keywords" CONTENT="stratus">
<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="node5.html">
<LINK REL="previous" HREF="node3.html">
<LINK REL="up" HREF="node3.html">
<LINK REL="next" HREF="node5.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="node3.html">Introduction</A></td>
<td class="navigation" align="center" width="34%"><A HREF="node3.html">Introduction</A></td>
<td class="navigation" align="right" width="33%"><A HREF="node5.html">Example</A></td>
</tr></table>
<hr>
<br>
</DIV>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL CLASS="ChildLinks">
<LI><A NAME="tex2html116"
HREF="node4.html#SECTION00021100000000000000">Name</A>
<LI><A NAME="tex2html117"
HREF="node4.html#SECTION00021200000000000000">Description</A>
<LI><A NAME="tex2html118"
HREF="node4.html#SECTION00021300000000000000">Configuration</A>
<LI><A NAME="tex2html119"
HREF="node4.html#SECTION00021400000000000000">Description of a cell</A>
<LI><A NAME="tex2html120"
HREF="node4.html#SECTION00021500000000000000">Creation of the cell</A>
<LI><A NAME="tex2html121"
HREF="node4.html#SECTION00021600000000000000">Syntax</A>
<LI><A NAME="tex2html122"
HREF="node4.html#SECTION00021700000000000000">Syntax highlighting</A>
<LI><A NAME="tex2html123"
HREF="node4.html#SECTION00021800000000000000">Example</A>
<LI><A NAME="tex2html124"
HREF="node4.html#SECTION00021900000000000000">See Also</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<H2><A NAME="SECTION00021000000000000000"></A>
<A NAME="secstratus"></A>
<BR>
Stratus
</H2>
<H3><A NAME="SECTION00021100000000000000">
Name</A>
</H3>
<P>
Stratus - Procedural design language based upon <SPAN CLASS="textit">Python</SPAN>
<P>
<H3><A NAME="SECTION00021200000000000000">
Description</A>
</H3>
<P>
<SPAN CLASS="textit">Stratus</SPAN> is a set of <SPAN CLASS="textit">Python</SPAN> methods/functions dedicated to procedural generation purposes. From a user point of view, <SPAN CLASS="textit">Stratus</SPAN> is a circuit's description language that allows <SPAN CLASS="textit">Python</SPAN> programming flow control, variable use, and specialized functions in order to handle vlsi objects.
<BR>
<P>
Based upon the <SPAN CLASS="textit">Hurricane</SPAN> data structures, the <SPAN CLASS="textit">Stratus</SPAN> language gives the user the ability to describe netlist and layout views.
<P>
<H3><A NAME="SECTION00021300000000000000">
Configuration</A>
</H3>
A configuration file can be used to direct the generation process of Stratus. With this file, the user can choose the output format (vst, vhdl...), the simulator (asimut, ghdl...), the standard cell library... This configuration file named <code>.st_config.py</code> must be placed either in the HOME directory or in the current directory. This file contains a set of variables used in the process generation of Stratus, as for example :
<PRE>
format = 'vhdl'
simulator = 'ghdl'
</PRE>
The default configuration of Stratus uses the Alliance CAD system, ie <code>'vst'</code> as <code>format</code> and <code>'asimut'</code> as <code>simulator</code>.
<P>
<H3><A NAME="SECTION00021400000000000000">
Description of a cell</A>
</H3>
<P>
A cell is a hierachical structural description of a circuit in terms of ports (I/Os), signals (nets) and instances.
<BR>
<P>
The description of a cell is done by creating a new class, derivating for class <code>Model</code>, with different methods :
<P>
<UL>
<LI>Method <code>Interface</code> : Description of the external ports of the cell :
<UL>
<LI>SignalIn, SignalOut, ...
</LI>
</UL>
</LI>
<LI>Method <code>Netlist</code> : Description of the netlist of the cell :
<UL>
<LI>Inst, Signal
</LI>
</UL>
</LI>
<LI>Method <code>Layout</code> : Description of the layout of the cell :
<UL>
<LI>Place, PlaceTop, PlaceBottom, PlaceRight, PlaceLeft ...
</LI>
</UL>
</LI>
<LI>Method <code>Stimuli</code> : Description of the simulation stimuli of the cell :
<UL>
<LI>affect, addd ...
</LI>
</UL>
</LI>
</UL>
<P>
<H3><A NAME="SECTION00021500000000000000">
Creation of the cell</A>
</H3>
<P>
After the description of a cell as a sub-class of <code>Model</code>, the cell has to be instantiated. The different methods described before have to be called.
<P>
Then different methods are provided :
<UL>
<LI>Method <code>View</code> : Opens/Refreshes the editor in order to see the created layout
</LI>
<LI>Method <code>Save</code> : Saves the created cell in the desired format thanks to the configuration file
<UL>
<LI>no argument : creation of a netlist file </LI>
<LI>PHYSICAL : creation of a netlist file AND a layout file </LI>
<LI>STRATUS : creation of a python/stratus file
<UL>
<LI>FileName : optionnal argument when using Save(STRATUS) in order to choose the name of the file to be generated
</LI>
<LI>Be careful : if one wants to create a stratus file AND a netlist, always use Save(STRATUS) before Save() !
</LI>
</UL>
</LI>
</UL>
</LI>
<LI>Method <code>Testbench</code> : Creates the testbench of the cell using the <code>Stimuli</code> method to compute the stimuli. The output format depends of the <code>format</code> variable given in the configuration file
</LI>
<LI>Method <code>Simul</code> : Runs the simulation using the simulator named in the configuration file
</LI>
</UL>
<P>
<H3><A NAME="SECTION00021600000000000000">
Syntax</A>
</H3>
<P>
A <SPAN CLASS="textit">Stratus</SPAN> file must have a .py extension and must begin as follow :
<PRE>
#!/usr/bin/env python
from stratus import *
</PRE>
<P>
The description of a cell as a sub-class of <code>Model</code> is done as follow :
<PRE>
class myClass ( Model ) :
...
</PRE>
<P>
The creation of the cell is done by instantiating the previous class as follow :
<PRE>
exemple = myClass ( name, param )
</PRE>
<P>
After the different methods can be called as follow :
<PRE>
exemple.Interface()
exemple.Netlist()
exemple.Save()
...
</PRE>
<P>
In order to execute a <SPAN CLASS="textit">Stratus</SPAN> file (named <code>file</code> for example), one has two choices :
<PRE>
python file.py
</PRE>
Or :
<PRE>
chmod u+x file.py
./file.py
</PRE>
<P>
The names used in <SPAN CLASS="textit">Stratus</SPAN>, as arguments to <SPAN CLASS="textit">Stratus</SPAN> functions, should be alphanumerical, including the underscore. The arguments of <SPAN CLASS="textit">Stratus</SPAN> are case sensitive, so VDD is not equivalent to <SMALL>VDD</SMALL>.
<BR>
<P>
Vectorized connectors or signal can be used using the [<SMALL>N:M]</SMALL> construct.
<BR>
<P>
<H3><A NAME="SECTION00021700000000000000">
Syntax highlighting</A>
</H3>
<P>
When using vi, it's possible to have the right syntax highlighting :
<P>
<UL>
<LI>Commands to do when you want to change once the coloration of your file :
</LI>
</UL>
<PRE>
:syntax off
:source /asim/coriolis/share/etc/stratus.vim
</PRE>
<UL>
<LI>Modification of your .vimrc in order to have the syntax highlighting each time you open a file :
</LI>
</UL>
<PRE>
syntax off
autocmd BufRead,BufNewfile *.py so /asim/coriolis/share/etc/stratus.vim
syntax on
</PRE>
<P>
<H3><A NAME="SECTION00021800000000000000">
Example</A>
</H3>
<P>
You can see a concrete example at : <A HREF="node5.html#secexample"><SPAN CLASS="textit">Example</SPAN></A>
<P>
<H3><A NAME="SECTION00021900000000000000">
See Also</A>
</H3>
<P>
<A HREF="node6.html#secnetlist"><SPAN CLASS="textit">Netlist</SPAN></A>
<A HREF="node10.html#seclayout"><SPAN CLASS="textit">Layout</SPAN></A>
<A HREF="node19.html#secstimuli"><SPAN CLASS="textit">Stimuli</SPAN></A>
<A HREF="node20.html#secroute"><SPAN CLASS="textit">Place and Route</SPAN></A>
<A HREF="node44.html#seclibrary"><SPAN CLASS="textit">Virtual librayy</SPAN></A>
<A HREF="node35.html#secfacilities"><SPAN CLASS="textit">Instanciation facilities</SPAN></A>
<P>
<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="node3.html">Introduction</A></td>
<td class="navigation" align="center" width="34%"><A HREF="node3.html">Introduction</A></td>
<td class="navigation" align="right" width="33%"><A HREF="node5.html">Example</A></td>
</tr></table>
<hr>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
Sophie B<small>ELLOEIL</small><br>20051116.1
</ADDRESS>
</BODY>
</HTML>