Subversion Repositories Vertical

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/* $Id: print_quartus.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $ */
2
/* Quartus pin fit file creator
3
 *
4
 * $Log: print_quartus.c,v $
5
 * Revision 1.1.1.1  2003/11/04 23:34:57  mjames
6
 * Imported into local repositrory
7
 *
8
 * Revision 1.12  2003/01/02 21:37:16  mjames
9
 * Experiment on creating NOT_ROUTABLE_H and NOT_ROUTABLE_L
10
 * properties on the nets so that pin jumpers can be made without a problem.
11
 *
12
 * Still need to sort out pin assignments made to these not_routable nets
13
 * which will become legal in some cases so that pullups and pulldown
14
 * pins can be used on the FPGA.
15
 *
16
 * Revision 1.11  2002/09/09 10:12:02  mjames
17
 * Moved pin remapping function to pin ident editing function from
18
 * sorting pin name routine.
19
 *
20
 * Revision 1.10  2002/08/14 12:06:41  mjames
21
 * Removed debug level setting function that should not have been here
22
 *
23
 * Revision 1.9  2002/08/06 12:52:38  mjames
24
 * Merge in from latest version
25
 *
26
 *
27
 * Revision 1.9  2002/04/10 14:29:10  mjames
28
 * Moved setting debug level to cmdutil.c
29
 *
30
 * Amended print external command to list all net names on socket pins
31
 * whether routed or not.
32
 *
33
 * Revision 1.8  2002/01/16 10:08:13  mjames
34
 * removed unused variable
35
 *
36
 * Revision 1.7  2001/10/31 22:20:12  mjames
37
 * Tidying up problematical comments caused by CVS
38
 * 'intelligent' comment guessing
39
 *
40
 * Revision 1.6  2001/10/22 10:58:18  mjames
41
 * Added required header files
42
 *
43
 * Revision 1.5  2001/09/21 14:20:38  mjames
44
 * Changed layout of printout to include device type if needed
45
 *
46
 * Revision 1.4  2001/07/09 15:38:02  mjames
47
 * Corrected printout errors that made reference to deleted net objects.
48
 *
49
 * Revision 1.3  2001/07/09 09:34:23  mjames
50
 * Printing only named nets that are routable, to create
51
 * the correct Quatus configuration file
52
 *
53
 * Revision 1.2  2001/07/06 12:47:13  MJAMES
54
 * Slight changes made for use with Quartus
55
 *
56
 * Revision 1.1  2001/06/06 12:10:19  mjames
57
 * Move from HPUX
58
 * */
59
/* ********************************************************************** */
60
#include "cmdlog.h"
61
#include "cmdparse.h"
62
#include "database.h"
63
#include "equivalent.h"
64
#include "expression.h"
65
#include "generic.h"
66
#include "print_vhdl.h"
67
#include "print_vlog.h"
68
#include "printout.h"
69
#include "sorting.h"
70
#include "vertcl_main.h"
71
 
72
#include <ctype.h>
73
#include <regex.h>
74
#include <stdio.h>
75
#include <stdlib.h>
76
#include <string.h>
77
#include <sys/types.h>
78
#include <time.h>
79
 
80
#if defined NEED_DECODE_PIN
81
static char *decode_quartus_pin[] = {"NONE",
82
                                     "input",
83
                                     "output",
84
                                     "output", /* buffer is a sort of Output pin (lower case is
85
                                                  for info only )*/
86
                                     "inout",
87
                                     "CONFIG_PIN",
88
                                     "POWER_PIN"};
89
#endif
90
 
91
void print_quartus_pinfit (FILE *f, socket_t *dev, int options)
92
{
93
        node_t *n;
94
 
95
        /* sort all the nodes into alphabetical order */
96
        sort_nodes (dev, NO_EXTRACT_XY);
97
 
98
        if (dev->is_external)
99
                fprintf (f, "#  External Connection\n\n");
100
        else
101
                fprintf (f, "#  Internal Socket\n\n");
102
        /* if it hasnt got a name, use its identifier */
103
 
104
        if (!ISNULLSTR (dev->name))
105
                fprintf (f, "CHIP (%s) {\n", check_null_str (dev->name));
106
        else
107
                fprintf (f, "CHIP (%s) {\n", dev->identifier);
108
 
109
        if (!ISNULLSTR (dev->type))
110
        {
111
                fprintf (f, " ASSIGNED TO AN \"%s\";\n", check_null_str (dev->type));
112
        }
113
 
114
        n = dev->nodes;
115
 
116
        while (n)
117
        {
118
                if (n->net && IS_ROUTABLE (n->net->how_routed) &&
119
                    (n->net->list_ref == &named_list))
120
                {
121
                        fprintf (
122
                            f,
123
                            "\t%-20s : LOCATION = Pin_%-10s;\n",
124
                            n->net->name,
125
                            n->identifier);
126
                }
127
                n = n->sktnext; /* traverse to next pin on socket */
128
        };
129
 
130
        fprintf (f, "  }\n");
131
}