1 /////////////////////////////////////////////////////////////////////////////// 2 // BSD 3-Clause License 3 // 4 // Copyright (c) 2019, Nefelus Inc 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 "dbHashTable.h" 38 #include "dbMatrix.h" 39 #include "dbTypes.h" 40 #include "dbVector.h" 41 #include "odb.h" 42 // User Code Begin Includes 43 // User Code End Includes 44 45 namespace odb { 46 47 class dbIStream; 48 class dbOStream; 49 class dbDiff; 50 class _dbDatabase; 51 class _dbTechLayerCutClassRule; 52 template <class T> 53 class dbTable; 54 class _dbTechLayerSpacingEolRule; 55 class _dbTechLayerCutSpacingRule; 56 class _dbTechLayerMinStepRule; 57 class _dbTechLayerCornerSpacingRule; 58 class _dbTechLayerSpacingTablePrlRule; 59 class _dbTechLayerCutSpacingTableOrthRule; 60 class _dbTechLayerCutSpacingTableDefRule; 61 class _dbTechLayerCutEnclosureRule; 62 class _dbTechLayerEolExtensionRule; 63 class _dbTechLayerEolKeepOutRule; 64 // User Code Begin Classes 65 class _dbTechLayerSpacingRule; 66 class _dbTechMinCutRule; 67 class _dbTechMinEncRule; 68 class _dbTechV55InfluenceEntry; 69 class _dbTechLayerAntennaRule; 70 // User Code End Classes 71 72 struct dbTechLayerFlags 73 { 74 uint num_masks_ : 2; 75 dbTechLayerType::Value type_ : 4; 76 dbTechLayerDir::Value direction_ : 4; 77 dbTechLayerMinStepType::Value minstep_type_ : 2; 78 uint has_max_width_ : 1; 79 uint has_thickness_ : 1; 80 uint has_area_ : 1; 81 uint has_protrusion_ : 1; 82 uint has_alias_ : 1; 83 uint has_xy_pitch_ : 1; 84 uint has_xy_offset_ : 1; 85 bool rect_only_ : 1; 86 bool right_way_on_grid_only_ : 1; 87 bool right_way_on_grid_only_check_mask_ : 1; 88 bool rect_only_except_non_core_pins_ : 1; 89 uint lef58_type_ : 3; 90 uint spare_bits_ : 6; 91 }; 92 // User Code Begin Structs 93 // User Code End Structs 94 95 class _dbTechLayer : public _dbObject 96 { 97 public: 98 // User Code Begin Enums 99 // User Code End Enums 100 101 dbTechLayerFlags flags_; 102 103 dbTable<_dbTechLayerCutClassRule>* cut_class_rules_tbl_; 104 dbHashTable<_dbTechLayerCutClassRule> cut_class_rules_hash_; 105 106 dbTable<_dbTechLayerSpacingEolRule>* spacing_eol_rules_tbl_; 107 108 dbTable<_dbTechLayerCutSpacingRule>* cut_spacing_rules_tbl_; 109 110 dbTable<_dbTechLayerMinStepRule>* minstep_rules_tbl_; 111 112 dbTable<_dbTechLayerCornerSpacingRule>* corner_spacing_rules_tbl_; 113 114 dbTable<_dbTechLayerSpacingTablePrlRule>* spacing_table_prl_rules_tbl_; 115 116 dbTable<_dbTechLayerCutSpacingTableOrthRule>* cut_spacing_table_orth_tbl_; 117 118 dbTable<_dbTechLayerCutSpacingTableDefRule>* cut_spacing_table_def_tbl_; 119 120 dbTable<_dbTechLayerCutEnclosureRule>* cut_enc_rules_tbl_; 121 122 dbTable<_dbTechLayerEolExtensionRule>* eol_ext_rules_tbl_; 123 124 dbTable<_dbTechLayerEolKeepOutRule>* eol_keep_out_rules_tbl_; 125 126 // User Code Begin Fields 127 128 uint _pitch_x; 129 uint _pitch_y; 130 uint _offset_x; 131 uint _offset_y; 132 uint _width; 133 uint _spacing; 134 double _resistance; 135 double _capacitance; 136 double _edge_capacitance; 137 uint _wire_extension; 138 uint _number; 139 uint _rlevel; 140 double _area; 141 uint _thickness; 142 uint _max_width; 143 int _min_width; 144 int _min_step; 145 int _min_step_max_length; 146 int _min_step_max_edges; 147 148 struct 149 { // Protrusion 150 uint _width; 151 uint _length; 152 uint _from_width; 153 } _pt; 154 char* _name; 155 char* _alias; 156 dbId<_dbTechLayer> _upper; 157 dbId<_dbTechLayer> _lower; 158 dbTable<_dbTechLayerSpacingRule>* _spacing_rules_tbl; 159 160 dbTable<_dbTechMinCutRule>* _min_cut_rules_tbl; 161 dbTable<_dbTechMinEncRule>* _min_enc_rules_tbl; 162 dbTable<_dbTechV55InfluenceEntry>* _v55inf_tbl; 163 dbVector<uint> _v55sp_length_idx; 164 dbVector<uint> _v55sp_width_idx; 165 dbMatrix<uint> _v55sp_spacing; 166 167 dbVector<uint> _two_widths_sp_idx; 168 dbVector<int> _two_widths_sp_prl; 169 dbMatrix<uint> _two_widths_sp_spacing; 170 171 dbId<_dbTechLayerAntennaRule> _oxide1; 172 dbId<_dbTechLayerAntennaRule> _oxide2; 173 // User Code End Fields 174 _dbTechLayer(_dbDatabase*, const _dbTechLayer& r); 175 _dbTechLayer(_dbDatabase*); 176 ~_dbTechLayer(); 177 bool operator==(const _dbTechLayer& rhs) const; 178 bool operator!=(const _dbTechLayer& rhs) const { return !operator==(rhs); } 179 bool operator<(const _dbTechLayer& rhs) const; 180 void differences(dbDiff& diff, 181 const char* field, 182 const _dbTechLayer& rhs) const; 183 void out(dbDiff& diff, char side, const char* field) const; 184 dbObjectTable* getObjectTable(dbObjectType type); 185 // User Code Begin Methods 186 uint getV55RowIdx(const int& rowVal) const; 187 uint getV55ColIdx(const int& colVal) const; 188 uint getTwIdx(const int width, const int prl) const; 189 // User Code End Methods 190 }; 191 dbIStream& operator>>(dbIStream& stream, _dbTechLayer& obj); 192 dbOStream& operator<<(dbOStream& stream, const _dbTechLayer& obj); 193 // User Code Begin General 194 // User Code End General 195 } // namespace odb 196 // Generator Code End Header 197