Implement $ftell, $fseek and $rewind system functions.
[iverilog.git] / functor.h
blob83aed16b3d4e6a618f01758ce1448624cfbf0b21
1 #ifndef __functor_H
2 #define __functor_H
3 /*
4 * Copyright (c) 1999-2005 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)
10 * any later version.
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
21 #ifdef HAVE_CVS_IDENT
22 #ident "$Id: functor.h,v 1.23 2005/07/07 16:22:49 steve Exp $"
23 #endif
26 * The functor is an object that can be applied to a design to
27 * transform it. This is different from the target_t, which can only
28 * scan the design but not transform it in any way.
30 * When a functor it scanning a process, signal or node, the functor
31 * is free to manipulate the list by deleting items, including the
32 * node being scanned. The Design class scanner knows how to handle
33 * the situation. However, if objects are added to the netlist, there
34 * is no guarantee that object will be scanned unless the functor is
35 * rerun.
38 class Design;
39 class NetNet;
40 class NetProcTop;
42 struct functor_t {
43 virtual ~functor_t();
45 /* Events are scanned here. */
46 virtual void event(class Design*des, class NetEvent*);
48 /* This is called once for each signal in the design. */
49 virtual void signal(class Design*des, class NetNet*);
51 /* This method is called for each process in the design. */
52 virtual void process(class Design*des, class NetProcTop*);
54 /* This method is called for each structural adder. */
55 virtual void lpm_add_sub(class Design*des, class NetAddSub*);
57 /* This method is called for each structural comparator. */
58 virtual void lpm_compare(class Design*des, class NetCompare*);
60 /* This method is called for each structural constant. */
61 virtual void lpm_const(class Design*des, class NetConst*);
63 /* This method is called for each structural constant. */
64 virtual void lpm_divide(class Design*des, class NetDivide*);
66 /* Constant literals. */
67 virtual void lpm_literal(class Design*des, class NetLiteral*);
69 /* This method is called for each structural constant. */
70 virtual void lpm_modulo(class Design*des, class NetModulo*);
72 /* This method is called for each FF in the design. */
73 virtual void lpm_ff(class Design*des, class NetFF*);
75 /* Handle LPM combinational logic devices. */
76 virtual void lpm_logic(class Design*des, class NetLogic*);
78 /* This method is called for each multiplier. */
79 virtual void lpm_mult(class Design*des, class NetMult*);
81 /* This method is called for each MUX. */
82 virtual void lpm_mux(class Design*des, class NetMux*);
84 /* This method is called for each unary reduction gate. */
85 virtual void lpm_ureduce(class Design*des, class NetUReduce*);
87 virtual void sign_extend(class Design*des, class NetSignExtend*);
90 struct proc_match_t {
91 virtual ~proc_match_t();
93 virtual int assign(class NetAssign*);
94 virtual int assign_nb(class NetAssignNB*);
95 virtual int condit(class NetCondit*);
96 virtual int event_wait(class NetEvWait*);
97 virtual int block(class NetBlock*);
102 * $Log: functor.h,v $
103 * Revision 1.23 2005/07/07 16:22:49 steve
104 * Generalize signals to carry types.
106 * Revision 1.22 2005/05/24 01:44:27 steve
107 * Do sign extension of structuran nets.
109 * Revision 1.21 2005/02/03 04:56:20 steve
110 * laborate reduction gates into LPM_RED_ nodes.
112 * Revision 1.20 2002/08/12 01:34:59 steve
113 * conditional ident string using autoconfig.
115 * Revision 1.19 2002/06/05 03:44:25 steve
116 * Add support for memory words in l-value of
117 * non-blocking assignments, and remove the special
118 * NetAssignMem_ and NetAssignMemNB classes.
120 * Revision 1.18 2002/06/04 05:38:44 steve
121 * Add support for memory words in l-value of
122 * blocking assignments, and remove the special
123 * NetAssignMem class.
125 * Revision 1.17 2000/09/17 21:26:15 steve
126 * Add support for modulus (Eric Aardoom)
128 * Revision 1.16 2000/08/01 02:48:42 steve
129 * Support <= in synthesis of DFF and ram devices.
131 * Revision 1.15 2000/07/16 04:56:07 steve
132 * Handle some edge cases during node scans.
134 * Revision 1.14 2000/07/15 05:13:44 steve
135 * Detect muxing Vz as a bufufN.
137 * Revision 1.13 2000/04/20 00:28:03 steve
138 * Catch some simple identity compareoptimizations.
140 #endif