2 * Copyright (c) 2001 Stephen Williams (steve@icarus.com)
4 * This source code is free software; you can redistribute it
5 * and/or modify it in source code form under the terms of the GNU
6 * General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 #ident "$Id: gates.c,v 1.14 2003/11/12 03:20:14 steve Exp $"
23 # include <ivl_target.h>
24 # include "fpga_priv.h"
27 static void show_cell_scope(ivl_scope_t scope
)
29 if (device
->show_cell_scope
== 0) {
30 fprintf(stderr
, "fpga.tgt: ivl_synthesis_cell(scope)"
31 " not supported by this target.\n");
35 device
->show_cell_scope(scope
);
38 static void show_gate_logic(ivl_net_logic_t net
)
40 if (device
->show_logic
== 0) {
41 fprintf(stderr
, "fpga.tgt: IVL LOGIC not supported"
42 " by this target.\n");
46 assert(device
->show_logic
);
47 device
->show_logic(net
);
50 static void show_gate_lpm(ivl_lpm_t net
)
52 switch (ivl_lpm_type(net
)) {
55 if (device
->show_add
== 0) {
56 fprintf(stderr
, "fpga.tgt: IVL_LPM_ADD not supported"
57 " by this target.\n");
60 device
->show_add(net
);
64 if (device
->show_sub
== 0) {
65 fprintf(stderr
, "fpga.tgt: IVL_LPM_SUB not supported"
66 " by this target.\n");
69 device
->show_sub(net
);
73 if (device
->show_cmp_eq
== 0) {
74 fprintf(stderr
, "fpga.tgt: IVL_LPM_CMP_EQ not supported"
75 " by this target.\n");
78 device
->show_cmp_eq(net
);
82 if (device
->show_cmp_ne
== 0) {
83 fprintf(stderr
, "fpga.tgt: IVL_LPM_CMP_NE not supported"
84 " by this target.\n");
87 device
->show_cmp_ne(net
);
91 if (device
->show_cmp_ge
== 0) {
92 fprintf(stderr
, "fpga.tgt: IVL_LPM_CMP_GE not supported"
93 " by this target.\n");
96 device
->show_cmp_ge(net
);
100 if (device
->show_cmp_gt
== 0) {
101 fprintf(stderr
, "fpga.tgt: IVL_LPM_CMP_GT not supported"
102 " by this target.\n");
105 device
->show_cmp_gt(net
);
109 if (device
->show_dff
== 0) {
110 fprintf(stderr
, "fpga.tgt: IVL_LPM_FF not supported"
111 " by this target.\n");
114 device
->show_dff(net
);
118 if (device
->show_mux
== 0) {
119 fprintf(stderr
, "fpga.tgt: IVL_LPM_MUX not supported"
120 " by this target.\n");
123 device
->show_mux(net
);
127 if (device
->show_mult
== 0) {
128 fprintf(stderr
, "fpga.tgt: IVL_LPM_MULT not supported"
129 " by this target.\n");
132 device
->show_mult(net
);
136 if (device
->show_shiftl
== 0) {
137 fprintf(stderr
, "fpga.tgt: IVL_LPM_SHIFTL not supported"
138 " by this target.\n");
141 device
->show_shiftl(net
);
145 if (device
->show_shiftr
== 0) {
146 fprintf(stderr
, "fpga.tgt: IVL_LPM_SHIFTR not supported"
147 " by this target.\n");
150 device
->show_shiftr(net
);
154 fprintf(stderr
, "fpga.tgt: unknown LPM type %u\n",
160 int show_scope_gates(ivl_scope_t net
, void*x
)
164 if (scope_has_attribute(net
, "ivl_synthesis_cell")) {
165 show_cell_scope(net
);
169 for (idx
= 0 ; idx
< ivl_scope_logs(net
) ; idx
+= 1)
170 show_gate_logic(ivl_scope_log(net
, idx
));
172 for (idx
= 0 ; idx
< ivl_scope_lpms(net
) ; idx
+= 1)
173 show_gate_lpm(ivl_scope_lpm(net
, idx
));
175 return ivl_scope_children(net
, show_scope_gates
, 0);
180 * Revision 1.14 2003/11/12 03:20:14 steve
181 * devices need show_cmp_gt
183 * Revision 1.13 2003/08/09 03:23:03 steve
184 * Add support for IVL_LPM_MULT device.
186 * Revision 1.12 2003/08/07 04:04:01 steve
187 * Add an LPM device type.
189 * Revision 1.11 2003/06/24 03:55:01 steve
190 * Add ivl_synthesis_cell support for virtex2.
192 * Revision 1.10 2002/10/28 02:05:56 steve
193 * Add Virtex code generators for left shift,
194 * subtraction, and GE comparators.
196 * Revision 1.9 2002/08/12 01:35:03 steve
197 * conditional ident string using autoconfig.
199 * Revision 1.8 2002/08/11 23:47:04 steve
200 * Add missing Log and Ident strings.
202 * Revision 1.7 2001/09/09 22:23:28 steve
203 * Virtex support for mux devices and adders
204 * with carry chains. Also, make Virtex specific
205 * implementations of primitive logic.
207 * Revision 1.6 2001/09/02 21:33:07 steve
208 * Rearrange the XNF code generator to be generic-xnf
209 * so that non-XNF code generation is also possible.
211 * Start into the virtex EDIF output driver.