1 ///////////////////////////////////////////////////////////////////////////////
2 // BSD 3-Clause License
3 //
4 // Copyright (c) 2020, The Regents of the University of California
5 // All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are met:
9 //
10 // * Redistributions of source code must retain the above copyright notice, this
11 //   list of conditions and the following disclaimer.
12 //
13 // * Redistributions in binary form must reproduce the above copyright notice,
14 //   this list of conditions and the following disclaimer in the documentation
15 //   and/or other materials provided with the distribution.
16 //
17 // * Neither the name of the copyright holder nor the names of its
18 //   contributors may be used to endorse or promote products derived from
19 //   this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 // POSSIBILITY OF SUCH DAMAGE.
32 
33 // Generator Code Begin Header
34 #pragma once
35 
36 #include "dbCore.h"
37 #include "dbVector.h"
38 #include "odb.h"
39 // User Code Begin Includes
40 // User Code End Includes
41 
42 namespace odb {
43 
44 class dbIStream;
45 class dbOStream;
46 class dbDiff;
47 class _dbDatabase;
48 class _dbTechLayer;
49 // User Code Begin Classes
50 class _dbTechLayerCutClassRule;
51 // User Code End Classes
52 
53 struct dbTechLayerCutSpacingTableDefRuleFlags
54 {
55   bool default_valid_ : 1;
56   bool same_mask_ : 1;
57   bool same_net_ : 1;
58   bool same_metal_ : 1;
59   bool same_via_ : 1;
60   bool layer_valid_ : 1;
61   bool no_stack_ : 1;
62   bool non_zero_enclosure_ : 1;
63   bool prl_for_aligned_cut_ : 1;
64   bool center_to_center_valid_ : 1;
65   bool center_and_edge_valid_ : 1;
66   bool no_prl_ : 1;
67   bool prl_valid_ : 1;
68   bool max_x_y_ : 1;
69   bool end_extension_valid_ : 1;
70   bool side_extension_valid_ : 1;
71   bool exact_aligned_spacing_valid_ : 1;
72   bool horizontal_ : 1;
73   bool prl_horizontal_ : 1;
74   bool vertical_ : 1;
75   bool prl_vertical_ : 1;
76   bool non_opposite_enclosure_spacing_valid_ : 1;
77   bool opposite_enclosure_resize_spacing_valid_ : 1;
78   uint spare_bits_ : 9;
79 };
80 // User Code Begin Structs
81 // User Code End Structs
82 
83 class _dbTechLayerCutSpacingTableDefRule : public _dbObject
84 {
85  public:
86   // User Code Begin Enums
87   // User Code End Enums
88 
89   dbTechLayerCutSpacingTableDefRuleFlags flags_;
90   int default_;
91   dbId<_dbTechLayer> second_layer_;
92   dbVector<
93       std::pair<dbId<_dbTechLayerCutClassRule>, dbId<_dbTechLayerCutClassRule>>>
94       prl_for_aligned_cut_tbl_;
95   dbVector<
96       std::pair<dbId<_dbTechLayerCutClassRule>, dbId<_dbTechLayerCutClassRule>>>
97       center_to_center_tbl_;
98   dbVector<
99       std::pair<dbId<_dbTechLayerCutClassRule>, dbId<_dbTechLayerCutClassRule>>>
100       center_and_edge_tbl_;
101   int prl_;
102   dbVector<std::tuple<dbId<_dbTechLayerCutClassRule>,
103                       dbId<_dbTechLayerCutClassRule>,
104                       int>>
105       prl_tbl_;
106   int extension_;
107   dbVector<std::pair<dbId<_dbTechLayerCutClassRule>, int>> end_extension_tbl_;
108   dbVector<std::pair<dbId<_dbTechLayerCutClassRule>, int>> side_extension_tbl_;
109   dbVector<std::pair<dbId<_dbTechLayerCutClassRule>, int>>
110       exact_aligned_spacing_tbl_;
111   dbVector<std::pair<dbId<_dbTechLayerCutClassRule>, int>>
112       non_opp_enc_spacing_tbl_;
113   dbVector<std::tuple<dbId<_dbTechLayerCutClassRule>, int, int, int>>
114       opp_enc_spacing_tbl_;
115   dbVector<dbVector<std::pair<int, int>>> spacing_tbl_;
116   std::map<std::string, uint> row_map_;
117   std::map<std::string, uint> col_map_;
118 
119   // User Code Begin Fields
120   // User Code End Fields
121   _dbTechLayerCutSpacingTableDefRule(
122       _dbDatabase*,
123       const _dbTechLayerCutSpacingTableDefRule& r);
124   _dbTechLayerCutSpacingTableDefRule(_dbDatabase*);
125   ~_dbTechLayerCutSpacingTableDefRule();
126   bool operator==(const _dbTechLayerCutSpacingTableDefRule& rhs) const;
127   bool operator!=(const _dbTechLayerCutSpacingTableDefRule& rhs) const
128   {
129     return !operator==(rhs);
130   }
131   bool operator<(const _dbTechLayerCutSpacingTableDefRule& rhs) const;
132   void differences(dbDiff& diff,
133                    const char* field,
134                    const _dbTechLayerCutSpacingTableDefRule& rhs) const;
135   void out(dbDiff& diff, char side, const char* field) const;
136   // User Code Begin Methods
137   // User Code End Methods
138 };
139 dbIStream& operator>>(dbIStream& stream,
140                       _dbTechLayerCutSpacingTableDefRule& obj);
141 dbOStream& operator<<(dbOStream& stream,
142                       const _dbTechLayerCutSpacingTableDefRule& obj);
143 // User Code Begin General
144 // User Code End General
145 }  // namespace odb
146    // Generator Code End Header
147