1 /****************************************************************************
2     Copyright (C) 1987-2015 by Jeffery P. Hansen
3 
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8 
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 
14     You should have received a copy of the GNU General Public License along
15     with this program; if not, write to the Free Software Foundation, Inc.,
16     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 
18     Last edit by hansen on Sat Apr 23 22:53:00 2005
19 ****************************************************************************/
20 #ifndef __igenerate_h
21 #define __igenerate_h
22 
23 /*
24  * Code for the sides of a module instance.  These should match the
25  * w->orient code for wires attached to that side.
26  */
27 #define PSIDE_UNKNOWN	-1
28 #define PSIDE_RIGHT	0
29 #define PSIDE_TOP	1
30 #define PSIDE_LEFT	2
31 #define PSIDE_BOTTOM	3
32 #define PSIDE_MAX	4
33 
34 /*****************************************************************************
35  *
36  * Temporary descriptor for interface generator port description.
37  *
38  * Objects of this type are generally temporary and thus are created/destroyed
39  * with malloc/free instead of ob_malloc/ob_free.
40  *
41  *****************************************************************************/
42 typedef struct {
43   char		*igp_name;		/* Name of port */
44   int		igp_iotype;		/* I/O type of port */
45   int		igp_side;		/* Side of block for port */
46   int		igp_bits;		/* Number of bits */
47   int		igp_pos;		/* Port position */
48   int		igp_offset;		/* Offset of this pin as numerator and denominator */
49 
50   /* These members are used only for symbol blocks */
51   int		igp_keep;		/* Keep the position of the port */
52   int		igp_x,igp_y;		/* Position of port */
53 } IGPort;
54 
55 IGPort **igen_getInterfacePorts(GModuleDef *M,int *N);
56 void igen_freePortList(IGPort **portList,int n);
57 int igen_generate_initial(GModuleDef *M);
58 
59 int igen_command(const char *op,const char *mod_name,int argc,const char *argv[]);
60 int igen_strToSide(const char *side);
61 
62 #endif
63 
64