4 * Copyright (c) 2001-2003 Stephen Williams (steve@icarus.com)
6 * This source code is free software; you can redistribute it
7 * and/or modify it in source code form under the terms of the GNU
8 * General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
22 #ident "$Id: device.h,v 1.15 2007/02/26 19:49:49 steve Exp $"
25 # include <ivl_target.h>
28 * This code generator supports a variety of device types. It does
29 * this by keeping a device "driver" structure for each device
30 * type. The device structure contains pointers to functions that emit
31 * the proper XNF for a given type of device.
33 * If a device supports a method, the function pointer is filled in
34 * with a pointer to the proper function.
36 * If a device does not support the method, then the pointer is null.
38 typedef const struct device_s
* device_t
;
41 /* These methods draw leading and trailing format text. */
42 void (*show_header
)(ivl_design_t des
);
43 void (*show_footer
)(ivl_design_t des
);
44 /* Draw scopes marked by ivl_synthesis_cell */
45 void (*show_cell_scope
)(ivl_scope_t net
);
46 /* Draw pads connected to the specified signal. */
47 void (*show_pad
)(ivl_signal_t sig
, const char*str
);
48 /* Draw basic logic devices. */
49 void (*show_logic
)(ivl_net_logic_t net
);
50 /* This method emits a D type Flip-Flop */
51 void (*show_dff
)(ivl_lpm_t net
);
52 /* These methods show various comparators */
53 void (*show_cmp_eq
)(ivl_lpm_t net
);
54 void (*show_cmp_ne
)(ivl_lpm_t net
);
55 void (*show_cmp_ge
)(ivl_lpm_t net
);
56 void (*show_cmp_gt
)(ivl_lpm_t net
);
57 /* This method draws MUX devices */
58 void (*show_mux
)(ivl_lpm_t net
);
59 /* This method draws ADD devices */
60 void (*show_add
)(ivl_lpm_t net
);
61 void (*show_sub
)(ivl_lpm_t net
);
62 /* These methods draw SHIFT devices */
63 void (*show_shiftl
)(ivl_lpm_t net
);
64 void (*show_shiftr
)(ivl_lpm_t net
);
66 void (*show_mult
)(ivl_lpm_t net
);
68 void (*show_constant
)(ivl_net_const_t net
);
72 * Return the device_t cookie given the name of the architecture. If
73 * the device is not found, return 0.
75 * This function is used if the user specifies the architecture
76 * explicitly, with the -parch=name flag.
78 extern device_t
device_from_arch(const char*arch
);
83 * Revision 1.15 2007/02/26 19:49:49 steve
84 * Spelling fixes (larry doolittle)
86 * Revision 1.14 2003/11/12 03:20:14 steve
87 * devices need show_cmp_gt
89 * Revision 1.13 2003/10/27 02:18:27 steve
90 * Emit constants for LPM device.
92 * Revision 1.12 2003/08/09 03:23:03 steve
93 * Add support for IVL_LPM_MULT device.
95 * Revision 1.11 2003/06/24 03:55:00 steve
96 * Add ivl_synthesis_cell support for virtex2.
98 * Revision 1.10 2002/10/28 02:05:56 steve
99 * Add Virtex code generators for left shift,
100 * subtraction, and GE comparators.
102 * Revision 1.9 2002/08/12 01:35:02 steve
103 * conditional ident string using autoconfig.
105 * Revision 1.8 2002/08/11 23:47:04 steve
106 * Add missing Log and Ident strings.
108 * Revision 1.7 2001/09/16 01:48:16 steve
109 * Suppor the PAD attribute on signals.
111 * Revision 1.6 2001/09/02 21:33:07 steve
112 * Rearrange the XNF code generator to be generic-xnf
113 * so that non-XNF code generation is also possible.
115 * Start into the virtex EDIF output driver.
117 * Revision 1.5 2001/09/01 04:30:44 steve
120 * Revision 1.4 2001/09/01 02:28:42 steve
121 * Generate code for MUX devices.
123 * Revision 1.3 2001/09/01 02:01:30 steve
124 * identity compare, and PWR records for constants.
126 * Revision 1.2 2001/08/31 02:59:06 steve
127 * Add root port SIG records.
129 * Revision 1.1 2001/08/28 04:14:20 steve
130 * Add the fpga target.