-bugs, prise en compte des cellules multi-sorties, +doc ...

This commit is contained in:
Christophe Alexandre 2002-12-09 15:03:28 +00:00
parent 044e091c5f
commit 710ad11452
7 changed files with 78 additions and 18 deletions

View File

@ -11,7 +11,7 @@ AC_SUBST(A2SDF_VERSION)
# For automake.
VERSION=$A2SDF_VERSION
PACKAGE=emmaus
PACKAGE=a2sdf
dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
@ -32,4 +32,5 @@ AM_ALLIANCE
AC_OUTPUT([
Makefile
src/Makefile
doc/Makefile
])

View File

@ -0,0 +1,4 @@
## Process this file with automake to produce Makefile.in
man_MANS = a2sdf.1
EXTRA_DIST = $(man_MANS)

View File

@ -0,0 +1,39 @@
.pl -.4
.TH A2SDF 1 "December 09, 2002" "ASIM/LIP6" "CAO\-VLSI Reference Manual"
.SH NAME
.TP
a2sdf
- alliance to sdf format converter
.so man1/alc_origin.1
.SH SYNOPSIS
.TP
\fBa2sdf\fP
[\fBoptions\fP] \fIcells_dir\fP \fIoutputname\fP
.br
.SH DESCRIPTION
\fBa2sdf\fP translates the SXLIB library to the SDF format. Please refer to
http://www.eda.org/sdf/ for more information on SDF format.
.br
Only the SXLIB library has got timing informations at the moment, so it's
the only library we are able to convert.
.br
\fBcells directory\fP
.br
The path to the SXLIB cells directory.
.br
\fBoutput name\fP
.br
Just the name of the file containing the timing information in sdf format.
It should be named with a .sdf extension.
.br
.SH OPTIONS
.PP
\fB-v[ersion]\fP displays the tool's version.
.br
\fB-h[elp]\fP displays a small help message.
.br
\fB-V[erbose]\fP sets the verbose mode on.
.br
.so man1/alc_bug_report.1

View File

@ -42,6 +42,12 @@ A2Sdf::CreateTimingCell(const char* name)
befig_list* befig = vhdlloadbefig(NULL,const_cast<char*>(name),0/*don't dump message*/);
assert(befig);
if (_verbose)
{
cout << " o Treating cell: " << name << endl;
}
list<const char*> outs;
for (const bepor_list* bepor=befig->BEPOR; bepor; bepor=bepor->NEXT)
{
@ -52,12 +58,6 @@ A2Sdf::CreateTimingCell(const char* name)
}
}
if (outs.size() > 1)
{
cerr << name << endl;
return;
}
for (list<const char*>::const_iterator lit = outs.begin();
lit != outs.end();
lit++)

View File

@ -10,11 +10,14 @@ class A2Sdf
public:
typedef list<TimingCell*> TimingCells;
private:
bool _verbose;
const char* _fileName;
TimingCells _timingCells;
public:
A2Sdf(const char* filename):
_fileName(filename), _timingCells()
A2Sdf(const char* filename, bool verbose)
: _verbose(verbose)
, _fileName(filename)
, _timingCells()
{}
~A2Sdf();

View File

@ -12,10 +12,10 @@ IOPath*
TimingCell::AddIOPath(const char* input, const char* output)
{
IOPathKey key(input, output);
IOPath* ioPath = _ioPaths[key];
if (ioPath)
return ioPath;
ioPath = new IOPath(input, output);
IOPaths::iterator ioPathIt;
if ((ioPathIt = _ioPaths.find(key)) != _ioPaths.end())
return ioPathIt->second;
IOPath* ioPath = new IOPath(input, output);
_ioPaths[key] = ioPath;
return ioPath;
}

View File

@ -10,7 +10,7 @@ using namespace std;
static void version(void)
{
cout << "a2sdf(" PACKAGE ") " VERSION << endl;
cout << "The " PACKAGE " package comes with NO WARRANTY" << endl;
cout << "ALLIANCE " << ALLIANCE_VERSION << endl;
}
int
@ -18,20 +18,22 @@ main(int argc, char** argv)
{
int showUsage = 0;
int showVersion = 0;
int verbose = 0;
const char* cellsDir = NULL;
const char* sdfFileName = NULL;
poptOption options[] = {
{ "help", 'h', POPT_ARG_NONE, &showUsage, 0, "print this message", 0},
{ "version", 'v', POPT_ARG_NONE, &showVersion, 0, "print the version information", 0},
{ "Verbose", 'V', POPT_ARG_NONE, &verbose, 0, "verbose mode", 0},
{ 0, 0, 0, 0, 0, 0, 0 }
};
poptContext context = poptGetContext("a2sdf", argc, (const char**)argv, options, 0);
poptSetOtherOptionHelp(context, "<cellsdir> <sdffilename> ");
poptSetOtherOptionHelp(context, " -hvV <cellsdir> <sdffilename> ");
if (int rc = poptGetNextOpt(context) < -1)
{
cerr << "simann: bad argument " << poptBadOption(context, POPT_BADOPTION_NOALIAS) << ": " << poptStrerror(rc) << endl;
cerr << "a2sdf: bad argument " << poptBadOption(context, POPT_BADOPTION_NOALIAS) << ": " << poptStrerror(rc) << endl;
cerr << "Try `" << argv[0] << " --help' for more information" << endl;
return 1;
}
@ -74,12 +76,14 @@ main(int argc, char** argv)
return 1;
}
A2Sdf a2sdf(sdfFileName);
A2Sdf a2sdf(sdfFileName, verbose);
int extensionlength = strlen(EXTENSION);
struct dirent* entry = NULL;
bool cellFound = false;
while ((entry = readdir (dir)) != NULL)
{
char* filename = entry->d_name;
@ -89,12 +93,21 @@ main(int argc, char** argv)
/* is extension of filename accepted */
if (strncmp (filename + filenamelength - extensionlength,
EXTENSION, extensionlength)) continue;
cellFound = true;
string cellName(filename);
cellName.erase( cellName.find(EXTENSION));
a2sdf.CreateTimingCell(cellName.c_str());
}
if (cellFound)
a2sdf.Dump();
else
{
cerr << " o Error: No cell to convert in: "
<< cellsDir << endl;
return 1;
}
return 0;
}