ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
ioWriteBook.c File Reference
#include <math.h>
#include "base/main/main.h"
#include "map/mio/mio.h"
#include "ioAbc.h"
Include dependency graph for ioWriteBook.c:

Go to the source code of this file.

Macros

#define NODES   0
 
#define PL   1
 
#define coreHeight   1
 
#define termWidth   1
 
#define termHeight   1
 

Functions

void Io_WriteBookLogic (Abc_Ntk_t *pNtk, char *FileName)
 FUNCTION DEFINITIONS ///.
 
void Io_WriteBook (Abc_Ntk_t *pNtk, char *FileName)
 

Macro Definition Documentation

◆ coreHeight

#define coreHeight   1

Definition at line 31 of file ioWriteBook.c.

◆ NODES

#define NODES   0

CFile****************************************************************

FileName [ioWriteBook.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Command processing package.]

Synopsis [Procedures to write Bookshelf files.]

Author [Myungchul Kim]

Affiliation [U of Michigan]

Date [Ver. 1.0. Started - October 25, 2008.]

Revision [

Id
ioWriteBook.c,v 1.00 2005/11/10 00:00:00 mckima Exp

]

Definition at line 29 of file ioWriteBook.c.

◆ PL

#define PL   1

Definition at line 30 of file ioWriteBook.c.

◆ termHeight

#define termHeight   1

Definition at line 33 of file ioWriteBook.c.

◆ termWidth

#define termWidth   1

Definition at line 32 of file ioWriteBook.c.

Function Documentation

◆ Io_WriteBook()

void Io_WriteBook ( Abc_Ntk_t * pNtk,
char * FileName )

Function*************************************************************

Synopsis [Write the network into a BOOK file with the given name.]

Description []

SideEffects []

SeeAlso []

Definition at line 100 of file ioWriteBook.c.

101{
102
103 FILE * pFileNodes, * pFileNets, * pFileAux;
104 FILE * pFileScl, * pFilePl, * pFileWts;
105 char * FileExt = ABC_CALLOC( char, strlen(FileName)+7 );
106 unsigned coreCellArea=0;
107 Abc_Ntk_t * pExdc, * pNtkTemp;
108 int i;
109
110 assert( Abc_NtkIsNetlist(pNtk) );
111 // start writing the files
112 strcpy(FileExt, FileName);
113 pFileNodes = fopen( strcat(FileExt,".nodes"), "w" );
114 strcpy(FileExt, FileName);
115 pFileNets = fopen( strcat(FileExt,".nets"), "w" );
116 strcpy(FileExt, FileName);
117 pFileAux = fopen( strcat(FileExt,".aux"), "w" );
118
119 // write the aux file
120 if ( (pFileNodes == NULL) || (pFileNets == NULL) || (pFileAux == NULL) )
121 {
122 fclose( pFileAux );
123 fprintf( stdout, "Io_WriteBook(): Cannot open the output files.\n" );
124 return;
125 }
126 fprintf( pFileAux, "RowBasedPlacement : %s.nodes %s.nets %s.scl %s.pl %s.wts",
127 FileName, FileName, FileName, FileName, FileName );
128 fclose( pFileAux );
129
130 // write the master network
131 coreCellArea+=Io_NtkWriteNodes( pFileNodes, pNtk );
132 Io_NtkWriteNets( pFileNets, pNtk );
133
134 // write EXDC network if it exists
135 pExdc = Abc_NtkExdc( pNtk );
136 if ( pExdc )
137 {
138 coreCellArea+=Io_NtkWriteNodes( pFileNodes, pNtk );
139 Io_NtkWriteNets( pFileNets, pNtk );
140 }
141
142 // make sure there is no logic hierarchy
143 assert( Abc_NtkWhiteboxNum(pNtk) == 0 );
144
145 // write the hierarchy if present
146 if ( Abc_NtkBlackboxNum(pNtk) > 0 )
147 {
148 Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pNtkTemp, i )
149 {
150 if ( pNtkTemp == pNtk )
151 continue;
152 coreCellArea+=Io_NtkWriteNodes( pFileNodes, pNtkTemp );
153 Io_NtkWriteNets( pFileNets, pNtkTemp );
154 }
155 }
156 fclose( pFileNodes );
157 fclose( pFileNets );
158
159 strcpy(FileExt, FileName);
160 pFileScl = fopen( strcat(FileExt,".scl"), "w" );
161 strcpy(FileExt, FileName);
162 pFilePl = fopen( strcat(FileExt,".pl"), "w" );
163 strcpy(FileExt, FileName);
164 pFileWts = fopen( strcat(FileExt,".wts"), "w" );
165 ABC_FREE(FileExt);
166
167 Io_NtkBuildLayout( pFileScl, pFilePl, pNtk, 1.0, 10, coreCellArea );
168 fclose( pFileScl );
169 fclose( pFilePl );
170 fclose( pFileWts );
171}
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
#define ABC_FREE(obj)
Definition abc_global.h:267
Vec_Ptr_t * vModules
Definition abc.h:225
Abc_Des_t * pDesign
Definition abc.h:180
#define assert(ex)
Definition util_old.h:213
int strlen()
char * strcpy()
char * strcat()
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Io_WriteBookLogic()

void Io_WriteBookLogic ( Abc_Ntk_t * pNtk,
char * FileName )

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Write the network into a Bookshelf file with the given name.]

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file ioWriteBook.c.

76{
77 Abc_Ntk_t * pNtkTemp;
78 // derive the netlist
79 pNtkTemp = Abc_NtkToNetlist(pNtk);
80 if ( pNtkTemp == NULL )
81 {
82 fprintf( stdout, "Writing BOOK has failed.\n" );
83 return;
84 }
85 Io_WriteBook( pNtkTemp, FileName );
86 Abc_NtkDelete( pNtkTemp );
87}
ABC_DLL Abc_Ntk_t * Abc_NtkToNetlist(Abc_Ntk_t *pNtk)
Definition abcNetlist.c:100
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
void Io_WriteBook(Abc_Ntk_t *pNtk, char *FileName)
Here is the call graph for this function: