ACT Library
Loading...
Searching...
No Matches
aflat.h
Go to the documentation of this file.
1/*************************************************************************
2 *
3 * This file is part of the ACT library
4 *
5 * Copyright (c) 2018-2019 Rajit Manohar
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
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.
16 *
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., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 **************************************************************************
23 */
24#ifndef __AFLAT_H__
25#define __AFLAT_H__
26
27#include <act/act.h>
28
29class ActApplyPass : public ActPass {
30 public:
33
34 int run (Process *p = NULL);
35
36 void run_per_type (Process *p = NULL);
37
38 void setCookie (void *);
39 void setInstFn (void (*f) (void *, ActId *, UserDef *));
40 void setConnPairFn (void (*f) (void *, ActId *, ActId *));
41
42 void setProcFn (void (*f) (void *, Process *));
43 void setChannelFn (void (*f) (void *, Channel *));
44 void setDataFn (void (*f) (void *, Data *));
45
46 void printns (FILE *fp);
47
48 private:
49 int init ();
50
51 void *local_op (Process *p, int mode);
52 void *local_op (Channel *c, int mode);
53 void *local_op (Data *d, int mode);
54
55
56 void (*apply_per_proc_fn) (void *, Process *);
57 void (*apply_per_channel_fn) (void *, Channel *);
58 void (*apply_per_data_fn) (void *, Data *);
59
60
61 void (*apply_user_fn) (void *, ActId *, UserDef *);
62 void (*apply_conn_fn) (void *, ActId *, ActId *);
63 void *cookie;
64
65 list_t *prefixes;
66 list_t *prefix_array;
67 list_t *suffixes;
68 list_t *suffix_array;
69
70 /*-- private functions --*/
71 void push_namespace_name (const char *);
72
73 void push_name (const char *, Array *arr = NULL);
74 void pop_name ();
75
76 void push_name_suffix (const char *, Array *arr = NULL);
78
80
82 ActId *two, Array *ta,
83 const char *nm, Arraystep *na,
84 ActNamespace *isoneglobal,
85 ActNamespace *istwoglobal);
86
87 void _flat_rec_bool_conns (ActId *one, ActId *two, UserDef *ux,
88 Array *oa, Array *ta,
89 ActNamespace *isoneglobal,
90 ActNamespace *istwoglobal);
91
95
96};
97
98#endif /* __AFLAT_H__ */
Definition: aflat.h:29
void push_name(const char *, Array *arr=NULL)
void printns(FILE *fp)
void(* apply_user_fn)(void *, ActId *, UserDef *)
Definition: aflat.h:61
list_t * prefix_array
Definition: aflat.h:66
void push_name_suffix(const char *, Array *arr=NULL)
void setInstFn(void(*f)(void *, ActId *, UserDef *))
void setConnPairFn(void(*f)(void *, ActId *, ActId *))
void(* apply_per_proc_fn)(void *, Process *)
Definition: aflat.h:56
void _flat_single_connection(ActId *one, Array *oa, ActId *two, Array *ta, const char *nm, Arraystep *na, ActNamespace *isoneglobal, ActNamespace *istwoglobal)
void _flat_rec_bool_conns(ActId *one, ActId *two, UserDef *ux, Array *oa, Array *ta, ActNamespace *isoneglobal, ActNamespace *istwoglobal)
void * local_op(Data *d, int mode)
void run_per_type(Process *p=NULL)
list_t * prefixes
Definition: aflat.h:65
void _flat_ns(ActNamespace *)
list_t * suffixes
Definition: aflat.h:67
ActApplyPass(Act *a)
int run(Process *p=NULL)
void _any_global_conns(act_connection *c)
void setProcFn(void(*f)(void *, Process *))
void _flat_scope(Scope *)
void(* apply_conn_fn)(void *, ActId *, ActId *)
Definition: aflat.h:62
void setChannelFn(void(*f)(void *, Channel *))
void * local_op(Process *p, int mode)
void push_namespace_name(const char *)
void(* apply_per_channel_fn)(void *, Channel *)
Definition: aflat.h:57
void * cookie
Definition: aflat.h:63
void * local_op(Channel *c, int mode)
void(* apply_per_data_fn)(void *, Data *)
Definition: aflat.h:58
void pop_name()
list_t * suffix_array
Definition: aflat.h:68
void _flat_connections_bool(ValueIdx *vx)
void setCookie(void *)
void pop_name_suffix()
void setDataFn(void(*f)(void *, Data *))
The main Act class used to read in an ACT file and create basic data structures. All design informati...
Definition: act.h:334
This class is used to store Act identifiers that correspond to instances. Identifiers have an optiona...
Definition: act_id.h:56
The ActNamespace class holds all the information about a namespace.
Definition: namespaces.h:469
The main ActPass class used to implement an ACT analysis/synthesis pass. All the core tools use this ...
Definition: act.h:791
Act * a
Definition: act.h:810
Dense arrays, sparse arrays, and array dereferences.
Definition: act_array.h:65
Class for stepping through an array.
Definition: act_array.h:470
User-defined channel type. Channels can be unidirectional or bi-directional (sometimes called exchang...
Definition: types.h:1215
A user-defined data types.
Definition: types.h:1062
User-defined processes.
Definition: types.h:750
This is the data structure that holds all instances and their associated types within a scope....
Definition: namespaces.h:77
UserDef stores information that is common to all user-defined types. User-defined types are more comp...
Definition: types.h:310
This class is used to create an instance in a scope. The name comes from the fact that this is used t...
Definition: value.h:342
Connections.
Definition: value.h:113