CellMacros.h revision 10447
1#ifndef __DSENT_MODEL_STD_CELLS_CELLMACROS_H__
2#define __DSENT_MODEL_STD_CELLS_CELLMACROS_H__
3
4#include "util/CommonType.h"
5#include "model/std_cells/StdCell.h"
6
7namespace DSENT
8{
9    class StdCell;
10
11    // Contains cell macros that can be created within standard cells
12    class CellMacros
13    {
14        private :
15            CellMacros();
16            ~CellMacros();
17
18        public:
19            //NOR2 Macro
20            //Adds a NOR2 to the standard cell, normalized to some size
21            static void addNor2(StdCell* cell_, const String& name_, bool sizable_, bool a1_to_zn_path_, bool a2_to_zn_path_,
22                                const String& a1_net_, const String& a2_net_, const String& zn_net_);
23            //Updates a NOR2 to to the standard cell, normalized to some size
24            static void updateNor2(StdCell* cell_, const String& name_, double normalized_size_);
25
26            //NAND2 Macro
27            //Adds a NAND2 to the standard cell, normalized to some size
28            static void addNand2(StdCell* cell_, const String& name_, bool sizable_, bool a1_to_zn_path_, bool a2_to_zn_path_,
29                                const String& a1_net_, const String& a2_net_, const String& zn_net_);
30            //Updates a NAND2 to to the standard cell, normalized to some size
31            static void updateNand2(StdCell* cell_, const String& name_, double normalized_size_);
32
33            //INVERTER Macro
34            //Adds a inverter to the standard cell, normalized to some size
35            static void addInverter(StdCell* cell_, const String& name_, bool sizable_, bool a_to_zn_path_,
36                                    const String& a_net_, const String& zn_net_);
37            //Updates an inverter to to the standard cell, normalized to some size
38            static void updateInverter(StdCell* cell_, const String& name_, double normalized_size_);
39
40            //INVZ Macro
41            //Adds a tristated inverter to the standard cell, normalized to some size
42            static void addTristate(StdCell* cell_, const String& name_, bool sizable_, bool a_to_zn_path_, bool oe_to_zn_path_, bool oen_to_zn_path_,
43                                    const String& a_net_, const String& oe_net_, const String& oen_net_, const String& zn_net_);
44            //Updates an tristated inverter to to the standard cell, normalized to some size
45            static void updateTristate(StdCell* cell_, const String& name_, double normalized_size_);
46
47            //Helper functions
48            //Returns the width of NMOS transistors, given the NMOS and PMOS stacking
49            static double calculateNmosWidth(const StdCell* cell_, unsigned int max_stacked_nmos_, unsigned int max_stacked_pmos_, unsigned int current_stack_nmos_);
50            //Returns the width of PMOS transistors, given the NMOS and PMOS stacking
51            static double calculatePmosWidth(const StdCell* cell_, unsigned int max_stacked_nmos_, unsigned int max_stacked_pmos_, unsigned int current_stack_pmos_);
52
53    }; // class CellMacros
54} // namespace DSENT
55
56#endif // __DSENT_MODEL_STD_CELLS_CELLMACROS_H__
57
58