ACT Library
Loading...
Searching...
No Matches
cells.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 __ACT_PASS_CELL_H__
25#define __ACT_PASS_CELL_H__
26
27#include <set>
28#include <map>
29#include <act/act.h>
30#include <act/iter.h>
31#include <common/hash.h>
32#include <common/bitset.h>
33#include <common/array.h>
34
35struct act_prsinfo;
36
37struct idmap {
38 A_DECL (ActId *, ids);
39 int nout;
40 int nat;
41};
42
43
44class ActCellPass : public ActPass {
45public:
48
49 int run (Process *p = NULL);
50
51 void Print (FILE *fp);
52
53 list_t *getNewCells () { return _new_cells; }
54 list_t *getUsedCells() { return _used_cells; }
55
56private:
57 void *local_op (Process *p, int mode = 0);
58 void free_local (void *);
59
60 /*-- private data structures --*/
61 struct cHashtable *cell_table;
67
68 list_t *_new_cells;
69 list_t *_used_cells;
70
71 /*-- private functions --*/
72 void add_new_cell (struct act_prsinfo *pi);
74 struct act_prsinfo *_gen_prs_attributes (act_prs_lang_t *prs, int ninp = -1,
75 int noutp = -1);
76 void dump_celldb (FILE *);
77 Expr *_idexpr (int idx, struct act_prsinfo *pi);
79 struct act_prsinfo *pi);
81 act_prs_lang_t *gate);
82
89 void flush_pending (Scope *sc);
90};
91
92
93#endif /* __ACT_PASS_CELL_H__ */
This is used to record a connection in the input design file.
Definition: body.h:234
Definition: cells.h:44
void flush_pending(Scope *sc)
int _collect_cells(ActNamespace *cells)
void add_new_cell(struct act_prsinfo *pi)
void add_passgates_cap()
ActCellPass(Act *a)
struct cHashtable * cell_table
Definition: cells.h:61
void Print(FILE *fp)
void _collect_one_passgate(Scope *sc, act_prs_lang_t *prs)
int run(Process *p=NULL)
void free_local(void *)
list_t * getUsedCells()
Definition: cells.h:54
void dump_celldb(FILE *)
void prs_to_cells(Process *p)
list_t * getNewCells()
Definition: cells.h:53
Expr * _idexpr(int idx, struct act_prsinfo *pi)
struct idmap current_idmap
Definition: cells.h:65
void _collect_one_prs(Scope *sc, act_prs_lang_t *prs)
void * local_op(Process *p, int mode=0)
int cell_count
Definition: cells.h:64
struct act_prsinfo * _gen_prs_attributes(act_prs_lang_t *prs, int ninp=-1, int noutp=-1)
list_t * _used_cells
Definition: cells.h:69
int proc_inst_count
Definition: cells.h:63
int _leak_flag
Definition: cells.h:66
ActBody_Conn * _build_connections(const char *name, struct act_prsinfo *pi)
ActBody_Conn * _build_connections(const char *name, act_prs_lang_t *gate)
list_t * _new_cells
Definition: cells.h:68
void _collect_one_cap(Scope *sc, act_prs_lang_t *prs)
ActNamespace * cell_ns
Definition: cells.h:62
void collect_gates(Scope *sc, act_prs_lang_t **pprs)
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
const char * name
the name for the pass
Definition: act.h:822
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
This contains the implementation of a number of C++ iterators to make it easier to walk through an AC...
Structure that holds a prs sub-language body. This consists of a linked-list of individual items in t...
Definition: lang.h:140
Definition: expr.h:79
Definition: cells.h:37
int nat
Definition: cells.h:40
A_DECL(ActId *, ids)
int nout
Definition: cells.h:39