aboutsummaryrefslogtreecommitdiffstats
path: root/package/linux-atm/patches/200-no_libfl.patch
blob: 1f7ae028c5a0c1b2d6c7432fdcfbb6b4fd2a8afd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
Index: linux-atm-2.4.1/src/qgen/Makefile.am
===================================================================
--- linux-atm-2.4.1.orig/src/qgen/Makefile.am	2007-10-20 19:19:10.354218533 +0200
+++ linux-atm-2.4.1/src/qgen/Makefile.am	2007-10-20 19:19:16.814586679 +0200
@@ -3,7 +3,7 @@
 
 qgen_SOURCES = common.c common.h file.c file.h first.c ql_y.y ql_l.l qgen.c \
 		qgen.h second.c third.c
-qgen_LDADD = -lfl
+qgen_LDADD = 
 
 q_dump_SOURCES = common.c
 q_dump_LDADD = qd.dump.standalone.o
Index: linux-atm-2.4.1/src/qgen/Makefile.in
===================================================================
--- linux-atm-2.4.1.orig/src/qgen/Makefile.in	2007-10-20 19:19:11.898306522 +0200
+++ linux-atm-2.4.1/src/qgen/Makefile.in	2007-10-20 19:19:16.814586679 +0200
@@ -90,7 +90,7 @@
 
 qgen_SOURCES = common.c common.h file.c file.h first.c ql_y.y ql_l.l qgen.c 		qgen.h second.c third.c
 
-qgen_LDADD = -lfl
+qgen_LDADD = 
 
 q_dump_SOURCES = common.c
 q_dump_LDADD = qd.dump.standalone.o
Index: linux-atm-2.4.1/src/qgen/ql_l.c
===================================================================
--- linux-atm-2.4.1.orig/src/qgen/ql_l.c	2007-10-20 19:19:11.906306980 +0200
+++ linux-atm-2.4.1/src/qgen/ql_l.c	2007-10-20 19:19:16.842588278 +0200
@@ -501,6 +501,11 @@
 #include "qgen.h"
 #include "ql_y.h"
 
+int yywrap(void)
+{
+        return 1;
+}
+
 
 typedef struct _tree {
     struct _tree *left,*right;
Index: linux-atm-2.4.1/src/sigd/cfg_l.c
===================================================================
--- linux-atm-2.4.1.orig/src/sigd/cfg_l.c	2007-10-20 19:19:10.378219897 +0200
+++ linux-atm-2.4.1/src/sigd/cfg_l.c	2007-10-20 19:19:16.854588969 +0200
@@ -11,6 +11,10 @@
 #include <stdio.h>
 #include <unistd.h>
 
+int yywrap(void)
+{
+        return 1;
+}
 
 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
 #ifdef c_plusplus
Index: linux-atm-2.4.1/src/sigd/Makefile.am
===================================================================
--- linux-atm-2.4.1.orig/src/sigd/Makefile.am	2007-10-20 19:19:10.386220355 +0200
+++ linux-atm-2.4.1/src/sigd/Makefile.am	2007-10-20 19:19:16.882590565 +0200
@@ -8,7 +8,7 @@
 			$(top_builddir)/src/qgen/qd.dump.o \
 			$(top_builddir)/src/lib/libatm.la \
 			$(top_builddir)/src/saal/libsaal.a
-atmsigd_LDADD = $(atmsigd_XTRAS) -lfl
+atmsigd_LDADD = $(atmsigd_XTRAS) 
 atmsigd_DEPENDENCIES = mess.c $(atmsigd_XTRAS)
 
 CLEANFILES = mess.c
Index: linux-atm-2.4.1/src/sigd/Makefile.in
===================================================================
--- linux-atm-2.4.1.orig/src/sigd/Makefile.in	2007-10-20 19:19:12.018313361 +0200
+++ linux-atm-2.4.1/src/sigd/Makefile.in	2007-10-20 19:19:16.886590795 +0200
@@ -92,7 +92,7 @@
 
 atmsigd_XTRAS = mess.o $(top_builddir)/src/qgen/q.out.o 			$(top_builddir)/src/qgen/qd.dump.o 			$(top_builddir)/src/lib/libatm.la 			$(top_builddir)/src/saal/libsaal.a
 
-atmsigd_LDADD = $(atmsigd_XTRAS) -lfl
+atmsigd_LDADD = $(atmsigd_XTRAS) 
 atmsigd_DEPENDENCIES = mess.c $(atmsigd_XTRAS)
 
 CLEANFILES = mess.c
Index: linux-atm-2.4.1/src/switch/debug/debug.c
===================================================================
--- linux-atm-2.4.1.orig/src/switch/debug/debug.c	2007-10-20 19:19:12.414335932 +0200
+++ linux-atm-2.4.1/src/switch/debug/debug.c	2007-10-20 19:19:16.894591246 +0200
@@ -20,6 +20,11 @@
 
 #define PRV(call) ((FAB *) (call)->fab)
 
+int yywrap(void)
+{
+        return 1;
+}
+
 
 typedef struct _fab {
     CALL *next; /* relay.c may not keep track of calls, but WE are */
Index: linux-atm-2.4.1/src/switch/debug/Makefile.am
===================================================================
--- linux-atm-2.4.1.orig/src/switch/debug/Makefile.am	2007-10-20 19:19:10.406221495 +0200
+++ linux-atm-2.4.1/src/switch/debug/Makefile.am	2007-10-20 19:19:16.906591931 +0200
@@ -5,7 +5,7 @@
 sw_debug_SOURCES = debug.c
 sw_debug_XTRAS = $(top_builddir)/src/switch/libsw.a \
 			$(top_builddir)/src/lib/libatm.la
-sw_debug_LDADD = $(sw_debug_XTRAS) -lfl
+sw_debug_LDADD = $(sw_debug_XTRAS) 
 			
 sw_debug_DEPENDENCIES = $(sw_debug_XTRAS)
 
Index: linux-atm-2.4.1/src/switch/debug/Makefile.in
===================================================================
--- linux-atm-2.4.1.orig/src/switch/debug/Makefile.in	2007-10-20 19:19:12.378333877 +0200
+++ linux-atm-2.4.1/src/switch/debug/Makefile.in	2007-10-20 19:19:16.918592613 +0200
@@ -92,7 +92,7 @@
 sw_debug_SOURCES = debug.c
 sw_debug_XTRAS = $(top_builddir)/src/switch/libsw.a 			$(top_builddir)/src/lib/libatm.la
 
-sw_debug_LDADD = $(sw_debug_XTRAS) -lfl
+sw_debug_LDADD = $(sw_debug_XTRAS) 
 
 sw_debug_DEPENDENCIES = $(sw_debug_XTRAS)
 
Index: linux-atm-2.4.1/src/switch/tcp/Makefile.am
===================================================================
--- linux-atm-2.4.1.orig/src/switch/tcp/Makefile.am	2007-10-20 19:19:10.422222406 +0200
+++ linux-atm-2.4.1/src/switch/tcp/Makefile.am	2007-10-20 19:19:16.922592837 +0200
@@ -5,7 +5,7 @@
 sw_tcp_SOURCES = tcpsw.c
 sw_tcp_XTRAS = $(top_builddir)/src/switch/libsw.a \
 		$(top_builddir)/src/lib/libatm.la
-sw_tcp_LDADD = $(sw_tcp_XTRAS) -lfl
+sw_tcp_LDADD = $(sw_tcp_XTRAS) 
 sw_tcp_DEPENDENCIES = $(sw_tcp_XTRAS)
 
 EXTRA_DIST = mkfiles README
Index: linux-atm-2.4.1/src/switch/tcp/Makefile.in
===================================================================
--- linux-atm-2.4.1.orig/src/switch/tcp/Makefile.in	2007-10-20 19:19:12.422336385 +0200
+++ linux-atm-2.4.1/src/switch/tcp/Makefile.in	2007-10-20 19:19:16.926593064 +0200
@@ -92,7 +92,7 @@
 sw_tcp_SOURCES = tcpsw.c
 sw_tcp_XTRAS = $(top_builddir)/src/switch/libsw.a 		$(top_builddir)/src/lib/libatm.la
 
-sw_tcp_LDADD = $(sw_tcp_XTRAS) -lfl
+sw_tcp_LDADD = $(sw_tcp_XTRAS) 
 sw_tcp_DEPENDENCIES = $(sw_tcp_XTRAS)
 
 EXTRA_DIST = mkfiles README
Index: linux-atm-2.4.1/src/switch/tcp/tcpsw.c
===================================================================
--- linux-atm-2.4.1.orig/src/switch/tcp/tcpsw.c	2007-10-20 19:19:12.426336614 +0200
+++ linux-atm-2.4.1/src/switch/tcp/tcpsw.c	2007-10-20 19:19:16.954594660 +0200
@@ -35,6 +35,10 @@
 #define MAX_PACKET (ATM_MAX_AAL5_PDU+sizeof(struct atmtcp_hdr))
 #define BUFFER_SIZE (MAX_PACKET*2)
 
+int yywrap(void)
+{
+        return 1;
+}
 
 typedef struct _table {
     struct _link *out;	/* output port */
Index: linux-atm-2.4.1/src/test/ispl_l.c
===================================================================
--- linux-atm-2.4.1.orig/src/test/ispl_l.c	2007-10-20 19:19:10.442223546 +0200
+++ linux-atm-2.4.1/src/test/ispl_l.c	2007-10-20 19:19:16.962595124 +0200
@@ -11,6 +11,11 @@
 #include <stdio.h>
 #include <unistd.h>
 
+int yywrap(void)
+{
+	return 1;
+}
+
 
 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
 #ifdef c_plusplus
Index: linux-atm-2.4.1/src/test/Makefile.am
===================================================================
--- linux-atm-2.4.1.orig/src/test/Makefile.am	2007-10-20 19:19:11.858304242 +0200
+++ linux-atm-2.4.1/src/test/Makefile.am	2007-10-20 19:19:16.962595124 +0200
@@ -15,7 +15,7 @@
 bw_SOURCES = bw.c
 isp_SOURCES = isp.c isp.h ispl_y.y ispl_l.l
 isp_XTRAS = $(LDADD)
-isp_LDADD = $(isp_XTRAS) -lfl
+isp_LDADD = $(isp_XTRAS) 
 isp_DEPENDENCIES = $(isp_XTRAS) errnos.inc
 window_SOURCES = window.c
 
Index: linux-atm-2.4.1/src/test/Makefile.in
===================================================================
--- linux-atm-2.4.1.orig/src/test/Makefile.in	2007-10-20 19:19:11.826302420 +0200
+++ linux-atm-2.4.1/src/test/Makefile.in	2007-10-20 19:19:16.962595124 +0200
@@ -102,7 +102,7 @@
 bw_SOURCES = bw.c
 isp_SOURCES = isp.c isp.h ispl_y.y ispl_l.l
 isp_XTRAS = $(LDADD)
-isp_LDADD = $(isp_XTRAS) -lfl
+isp_LDADD = $(isp_XTRAS) 
 isp_DEPENDENCIES = $(isp_XTRAS) errnos.inc
 window_SOURCES = window.c
 
span class="n">nVars, unsigned * uTruthNode, unsigned * uTruthPerm ); static char ** s_pPerms = NULL; static int s_nPerms; //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /**Function************************************************************* Synopsis [Attaches gates from the current library to the internal nodes.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ int Abc_NtkAttach( Abc_Ntk_t * pNtk ) { Mio_Library_t * pGenlib; unsigned ** puTruthGates; unsigned uTruths[6][2]; Abc_Obj_t * pNode; Mio_Gate_t ** ppGates; int nGates, nFanins, i; assert( Abc_NtkIsSopLogic(pNtk) ); // check that the library is available pGenlib = (Mio_Library_t *)Abc_FrameReadLibGen(); if ( pGenlib == NULL ) { printf( "The current library is not available.\n" ); return 0; } // start the truth tables Abc_AttachSetupTruthTables( uTruths ); // collect all the gates ppGates = Mio_CollectRoots( pGenlib, 6, (float)1.0e+20, 1, &nGates, 0 ); // derive the gate truth tables puTruthGates = ABC_ALLOC( unsigned *, nGates ); puTruthGates[0] = ABC_ALLOC( unsigned, 2 * nGates ); for ( i = 1; i < nGates; i++ ) puTruthGates[i] = puTruthGates[i-1] + 2; for ( i = 0; i < nGates; i++ ) Mio_DeriveTruthTable( ppGates[i], uTruths, Mio_GateReadPinNum(ppGates[i]), 6, puTruthGates[i] ); // assign the gates to pNode->pCopy Abc_NtkCleanCopy( pNtk ); Abc_NtkForEachNode( pNtk, pNode, i ) { nFanins = Abc_ObjFaninNum(pNode); if ( nFanins == 0 ) { if ( Abc_SopIsConst1((char *)pNode->pData) ) pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadConst1(pGenlib); else pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadConst0(pGenlib); } else if ( nFanins == 1 ) { if ( Abc_SopIsBuf((char *)pNode->pData) ) pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadBuf(pGenlib); else pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadInv(pGenlib); } else if ( nFanins > 6 ) { printf( "Cannot attach gate with more than 6 inputs to node %s.\n", Abc_ObjName(pNode) ); ABC_FREE( puTruthGates[0] ); ABC_FREE( puTruthGates ); ABC_FREE( ppGates ); return 0; } else if ( !Abc_NodeAttach( pNode, ppGates, puTruthGates, nGates, uTruths ) ) { printf( "Could not attach the library gate to node %s.\n", Abc_ObjName(pNode) ); ABC_FREE( puTruthGates[0] ); ABC_FREE( puTruthGates ); ABC_FREE( ppGates ); return 0; } } ABC_FREE( puTruthGates[0] ); ABC_FREE( puTruthGates ); ABC_FREE( ppGates ); ABC_FREE( s_pPerms ); // perform the final transformation Abc_NtkForEachNode( pNtk, pNode, i ) { if ( pNode->pCopy == NULL ) { printf( "Some elementary gates (constant, buffer, or inverter) are missing in the library.\n" ); return 0; } } // replace SOP representation by the gate representation Abc_NtkForEachNode( pNtk, pNode, i ) pNode->pData = pNode->pCopy, pNode->pCopy = NULL; pNtk->ntkFunc = ABC_FUNC_MAP; Extra_MmFlexStop( (Extra_MmFlex_t *)pNtk->pManFunc ); pNtk->pManFunc = pGenlib; printf( "Library gates are successfully attached to the nodes.\n" ); // make sure that everything is okay if ( !Abc_NtkCheck( pNtk ) ) { printf( "Abc_NtkAttach: The network check has failed.\n" ); return 0; } return 1; } /**Function************************************************************* Synopsis [] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ int Abc_NodeAttach( Abc_Obj_t * pNode, Mio_Gate_t ** ppGates, unsigned ** puTruthGates, int nGates, unsigned uTruths[][2] ) { int Perm[10]; int pTempInts[10]; unsigned uTruthNode[2]; Abc_Obj_t * pFanin; Mio_Gate_t * pGate; int nFanins, i; // compute the node's truth table Abc_AttachComputeTruth( (char *)pNode->pData, uTruths, uTruthNode ); // find the matching gate and permutation pGate = Abc_AttachFind( ppGates, puTruthGates, nGates, uTruthNode, Perm ); if ( pGate == NULL ) return 0; // permute the fanins nFanins = Abc_ObjFaninNum(pNode); Abc_ObjForEachFanin( pNode, pFanin, i ) pTempInts[i] = pFanin->Id; for ( i = 0; i < nFanins; i++ ) pNode->vFanins.pArray[Perm[i]] = pTempInts[i]; // set the gate pNode->pCopy = (Abc_Obj_t *)pGate; return 1; } /**Function************************************************************* Synopsis [Sets up the truth tables.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Abc_AttachSetupTruthTables( unsigned uTruths[][2] ) { int m, v; for ( v = 0; v < 5; v++ ) uTruths[v][0] = 0; // set up the truth tables for ( m = 0; m < 32; m++ ) for ( v = 0; v < 5; v++ ) if ( m & (1 << v) ) uTruths[v][0] |= (1 << m); // make adjustments for the case of 6 variables for ( v = 0; v < 5; v++ ) uTruths[v][1] = uTruths[v][0]; uTruths[5][0] = 0; uTruths[5][1] = ATTACH_FULL; } /**Function************************************************************* Synopsis [Compute the truth table of the node's cover.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Abc_AttachComputeTruth( char * pSop, unsigned uTruthsIn[][2], unsigned * uTruthRes ) { // Mvc_Cube_t * pCube; unsigned uSignCube[2]; int Value; // int nInputs = pCover->nBits/2; int nInputs = 6; int nFanins = Abc_SopGetVarNum(pSop); char * pCube; int k; // make sure that the number of input truth tables in equal to the number of gate inputs assert( nInputs < 7 ); // clean the resulting truth table uTruthRes[0] = 0; uTruthRes[1] = 0; if ( nInputs < 6 ) { // consider the case when only one unsigned can be used // Mvc_CoverForEachCube( pCover, pCube ) Abc_SopForEachCube( pSop, nFanins, pCube ) { uSignCube[0] = ATTACH_FULL; // Mvc_CubeForEachVarValue( pCover, pCube, Var, Value ) Abc_CubeForEachVar( pCube, Value, k ) { if ( Value == '0' ) uSignCube[0] &= ~uTruthsIn[k][0]; else if ( Value == '1' ) uSignCube[0] &= uTruthsIn[k][0]; } uTruthRes[0] |= uSignCube[0]; } if ( Abc_SopGetPhase(pSop) == 0 ) uTruthRes[0] = ~uTruthRes[0]; if ( nInputs < 5 ) uTruthRes[0] &= ATTACH_MASK(1<<nInputs); } else { // consider the case when two unsigneds should be used // Mvc_CoverForEachCube( pCover, pCube ) Abc_SopForEachCube( pSop, nFanins, pCube ) { uSignCube[0] = ATTACH_FULL; uSignCube[1] = ATTACH_FULL; // Mvc_CubeForEachVarValue( pCover, pCube, Var, Value ) Abc_CubeForEachVar( pCube, Value, k ) { if ( Value == '0' ) { uSignCube[0] &= ~uTruthsIn[k][0]; uSignCube[1] &= ~uTruthsIn[k][1]; } else if ( Value == '1' ) { uSignCube[0] &= uTruthsIn[k][0]; uSignCube[1] &= uTruthsIn[k][1]; } } uTruthRes[0] |= uSignCube[0]; uTruthRes[1] |= uSignCube[1]; } // complement if the SOP is complemented if ( Abc_SopGetPhase(pSop) == 0 ) { uTruthRes[0] = ~uTruthRes[0]; uTruthRes[1] = ~uTruthRes[1]; } } } /**Function************************************************************* Synopsis [Find the gate by truth table.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ Mio_Gate_t * Abc_AttachFind( Mio_Gate_t ** ppGates, unsigned ** puTruthGates, int nGates, unsigned * uTruthNode, int * Perm ) { unsigned uTruthPerm[2]; int i, v, iNum; // try the gates without permutation if ( (iNum = Abc_AttachCompare( puTruthGates, nGates, uTruthNode )) >= 0 ) { for ( v = 0; v < 6; v++ ) Perm[v] = v; return ppGates[iNum]; } // get permutations if ( s_pPerms == NULL ) { s_pPerms = Extra_Permutations( 6 ); s_nPerms = Extra_Factorial( 6 ); } // try permutations for ( i = 0; i < s_nPerms; i++ ) { Abc_TruthPermute( s_pPerms[i], 6, uTruthNode, uTruthPerm ); if ( (iNum = Abc_AttachCompare( puTruthGates, nGates, uTruthPerm )) >= 0 ) { for ( v = 0; v < 6; v++ ) Perm[v] = (int)s_pPerms[i][v]; return ppGates[iNum]; } } return NULL; } /**Function************************************************************* Synopsis [Find the gate by truth table.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ int Abc_AttachCompare( unsigned ** puTruthGates, int nGates, unsigned * uTruthNode ) { int i; for ( i = 0; i < nGates; i++ ) if ( puTruthGates[i][0] == uTruthNode[0] && puTruthGates[i][1] == uTruthNode[1] ) return i; return -1; } /**Function************************************************************* Synopsis [Permutes the 6-input truth table.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Abc_TruthPermute( char * pPerm, int nVars, unsigned * uTruthNode, unsigned * uTruthPerm ) { int nMints, iMintPerm, iMint, v; uTruthPerm[0] = uTruthPerm[1] = 0; nMints = (1 << nVars); for ( iMint = 0; iMint < nMints; iMint++ ) { if ( (uTruthNode[iMint>>5] & (1 << (iMint&31))) == 0 ) continue; iMintPerm = 0; for ( v = 0; v < nVars; v++ ) if ( iMint & (1 << v) ) iMintPerm |= (1 << pPerm[v]); uTruthPerm[iMintPerm>>5] |= (1 << (iMintPerm&31)); } } //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// ABC_NAMESPACE_IMPL_END