diff --git a/src/OpenRoad.cc b/src/OpenRoad.cc index fc46d46587f..498c5b3f0be 100644 --- a/src/OpenRoad.cc +++ b/src/OpenRoad.cc @@ -109,7 +109,6 @@ using odb::dbChip; using odb::dbDatabase; using odb::dbLib; using odb::dbTech; -using odb::Rect; using sta::evalTclInit; diff --git a/src/dpl/src/CheckPlacement.cpp b/src/dpl/src/CheckPlacement.cpp index 83a26fb8907..1467b822ed9 100644 --- a/src/dpl/src/CheckPlacement.cpp +++ b/src/dpl/src/CheckPlacement.cpp @@ -48,8 +48,6 @@ using std::vector; using utl::DPL; -using utl::format_as; - void Opendp::checkPlacement(const bool verbose, const bool disallow_one_site_gaps, const string& report_file_name) diff --git a/src/dpl/src/FillerPlacement.cpp b/src/dpl/src/FillerPlacement.cpp index a03ae7c0115..a89a6e3f536 100644 --- a/src/dpl/src/FillerPlacement.cpp +++ b/src/dpl/src/FillerPlacement.cpp @@ -48,8 +48,6 @@ using utl::DPL; using odb::dbMaster; using odb::dbPlacementStatus; -using utl::format_as; - static dbTechLayer* getImplant(dbMaster* master) { if (!master) { diff --git a/src/dpl/src/Grid.cpp b/src/dpl/src/Grid.cpp index bc958be482a..865199c0b45 100644 --- a/src/dpl/src/Grid.cpp +++ b/src/dpl/src/Grid.cpp @@ -59,8 +59,6 @@ using utl::DPL; using odb::dbBox; using odb::dbRow; -using utl::format_as; - PixelPt::PixelPt(Pixel* pixel1, GridX grid_x, GridY grid_y) : pixel(pixel1), x(grid_x), y(grid_y) { diff --git a/src/dpl/src/Opendp.cpp b/src/dpl/src/Opendp.cpp index 02fb45b4079..b10d4d67468 100644 --- a/src/dpl/src/Opendp.cpp +++ b/src/dpl/src/Opendp.cpp @@ -62,11 +62,8 @@ using std::string; using utl::DPL; -using odb::dbMasterType; using odb::Rect; -using utl::format_as; - //////////////////////////////////////////////////////////////// bool Opendp::isMultiRow(const Cell* cell) const diff --git a/src/dpl/src/Place.cpp b/src/dpl/src/Place.cpp index d76b1961ec3..1c37fa7e15a 100644 --- a/src/dpl/src/Place.cpp +++ b/src/dpl/src/Place.cpp @@ -63,8 +63,6 @@ using std::vector; using utl::DPL; -using utl::format_as; - std::string Opendp::printBgBox( const boost::geometry::model::box& queryBox) { diff --git a/src/dpl/src/dbToOpendp.cpp b/src/dpl/src/dbToOpendp.cpp index 39e5869de4b..f2e23bfe2b8 100644 --- a/src/dpl/src/dbToOpendp.cpp +++ b/src/dpl/src/dbToOpendp.cpp @@ -48,8 +48,6 @@ namespace dpl { using std::string; using std::vector; -using utl::DPL; - using odb::dbBox; using odb::dbMaster; using odb::dbOrientType; diff --git a/src/drt/src/io/io_parser_helper.cpp b/src/drt/src/io/io_parser_helper.cpp index e0f2daedfd3..f0cef8c8fa9 100644 --- a/src/drt/src/io/io_parser_helper.cpp +++ b/src/drt/src/io/io_parser_helper.cpp @@ -257,7 +257,7 @@ std::pair getBloatingDist(frTechObject* tech, } return bloats; } - return std::make_pair(0, 0); + return {0, 0}; } } // namespace diff --git a/src/fin/src/DensityFill.cpp b/src/fin/src/DensityFill.cpp index 7890b05137f..fb22f123916 100644 --- a/src/fin/src/DensityFill.cpp +++ b/src/fin/src/DensityFill.cpp @@ -317,7 +317,7 @@ static std::pair getSpacing(dbTechLayer* layer, space_y = std::max(space_y, cfg.space_line_end); } - return std::make_pair(space_x, space_y); + return {space_x, space_y}; } // Two different polygons might be less than min space apart and this diff --git a/src/gpl/src/fft.cpp b/src/gpl/src/fft.cpp index 6e2bbaf6296..5fe3b799460 100644 --- a/src/gpl/src/fft.cpp +++ b/src/gpl/src/fft.cpp @@ -118,7 +118,7 @@ void FFT::updateDensity(int x, int y, float density) std::pair FFT::getElectroForce(int x, int y) const { - return std::make_pair(electroForceX_[x][y], electroForceY_[x][y]); + return {electroForceX_[x][y], electroForceY_[x][y]}; } float FFT::getElectroPhi(int x, int y) const diff --git a/src/gpl/src/nesterovBase.cpp b/src/gpl/src/nesterovBase.cpp index edc5c10da74..fb67a9af689 100644 --- a/src/gpl/src/nesterovBase.cpp +++ b/src/gpl/src/nesterovBase.cpp @@ -828,7 +828,7 @@ std::pair BinGrid::getDensityMinMaxIdxX(const GCell* gcell) const lowerIdx = std::max(lowerIdx, 0); upperIdx = std::min(upperIdx, binCntX_); - return std::make_pair(lowerIdx, upperIdx); + return {lowerIdx, upperIdx}; } std::pair BinGrid::getDensityMinMaxIdxY(const GCell* gcell) const @@ -840,7 +840,7 @@ std::pair BinGrid::getDensityMinMaxIdxY(const GCell* gcell) const lowerIdx = std::max(lowerIdx, 0); upperIdx = std::min(upperIdx, binCntY_); - return std::make_pair(lowerIdx, upperIdx); + return {lowerIdx, upperIdx}; } std::pair BinGrid::getMinMaxIdxX(const Instance* inst) const @@ -850,7 +850,7 @@ std::pair BinGrid::getMinMaxIdxX(const Instance* inst) const ? (inst->ux() - lx()) / binSizeX_ : (inst->ux() - lx()) / binSizeX_ + 1; - return std::make_pair(std::max(lowerIdx, 0), std::min(upperIdx, binCntX_)); + return {std::max(lowerIdx, 0), std::min(upperIdx, binCntX_)}; } std::pair BinGrid::getMinMaxIdxY(const Instance* inst) const @@ -860,7 +860,7 @@ std::pair BinGrid::getMinMaxIdxY(const Instance* inst) const ? (inst->uy() - ly()) / binSizeY_ : (inst->uy() - ly()) / binSizeY_ + 1; - return std::make_pair(std::max(lowerIdx, 0), std::min(upperIdx, binCntY_)); + return {std::max(lowerIdx, 0), std::min(upperIdx, binCntY_)}; } //////////////////////////////////////////////// diff --git a/src/gpl/src/placerBase.cpp b/src/gpl/src/placerBase.cpp index 9b550154350..f718635102f 100644 --- a/src/gpl/src/placerBase.cpp +++ b/src/gpl/src/placerBase.cpp @@ -1363,7 +1363,7 @@ static std::pair getMinMaxIdx(int ll, int upperIdx = (fastModulo((uu - coreLL), siteSize) == 0) ? (uu - coreLL) / siteSize : (uu - coreLL) / siteSize + 1; - return std::make_pair(std::max(minIdx, lowerIdx), std::min(maxIdx, upperIdx)); + return {std::max(minIdx, lowerIdx), std::min(maxIdx, upperIdx)}; } static bool isCoreAreaOverlap(Die& die, Instance& inst) diff --git a/src/gpl/src/routeBase.cpp b/src/gpl/src/routeBase.cpp index 8e24e9b9166..47c88369804 100644 --- a/src/gpl/src/routeBase.cpp +++ b/src/gpl/src/routeBase.cpp @@ -585,7 +585,7 @@ std::pair RouteBase::routability() "FinalRC lower than targetRC({}), routability not needed.", rbVars_.targetRC); resetRoutabilityResources(); - return std::make_pair(false, false); + return {false, false}; } // @@ -724,7 +724,7 @@ std::pair RouteBase::routability() nbVec_[0]->updateDensitySize(); resetRoutabilityResources(); - return std::make_pair(false, true); + return {false, true}; } log_->info(GPL, @@ -807,7 +807,7 @@ std::pair RouteBase::routability() // reset resetRoutabilityResources(); - return std::make_pair(true, true); + return {true, true}; } void RouteBase::revertGCellSizeToMinRc() diff --git a/src/gui/include/gui/gui.h b/src/gui/include/gui/gui.h index ca9feecfab2..f902d296640 100644 --- a/src/gui/include/gui/gui.h +++ b/src/gui/include/gui/gui.h @@ -329,12 +329,12 @@ class Descriptor virtual bool lessThan(std::any l, std::any r) const = 0; - static const Editor makeEditor(const EditorCallback& func, - const std::vector& options) + static Editor makeEditor(const EditorCallback& func, + const std::vector& options) { return {func, options}; } - static const Editor makeEditor(const EditorCallback& func) + static Editor makeEditor(const EditorCallback& func) { return makeEditor(func, {}); } @@ -357,7 +357,7 @@ class Selected { public: // Null case - Selected() : object_({}), descriptor_(nullptr) {} + Selected() = default; Selected(std::any object, const Descriptor* descriptor) : object_(std::move(object)), descriptor_(descriptor) @@ -429,7 +429,7 @@ class Selected private: std::any object_; - const Descriptor* descriptor_; + const Descriptor* descriptor_ = nullptr; }; // This is an interface for classes that wish to be called to render diff --git a/src/mpl/src/ParquetFP/src/skyline.cxx b/src/mpl/src/ParquetFP/src/skyline.cxx index 4afa1997696..fc24bb31d81 100644 --- a/src/mpl/src/ParquetFP/src/skyline.cxx +++ b/src/mpl/src/ParquetFP/src/skyline.cxx @@ -347,7 +347,7 @@ float SkylineContour::GetHeight(float left, float right) std::pair SkylineContour::GetHeightWithIdx(float left, float right) { if (!skyline_) { - return std::make_pair(0, -1); + return {0, -1}; } float height = 0; @@ -367,7 +367,7 @@ std::pair SkylineContour::GetHeightWithIdx(float left, float right) } cout << "return height: " << height << endl; - return std::make_pair(height, idx); + return {height, idx}; } // extract ContourArea diff --git a/src/mpl2/include/mpl2/rtl_mp.h b/src/mpl2/include/mpl2/rtl_mp.h index 17dc94a3b99..189d46a29a9 100644 --- a/src/mpl2/include/mpl2/rtl_mp.h +++ b/src/mpl2/include/mpl2/rtl_mp.h @@ -65,7 +65,6 @@ class MacroPlacer2 void init(sta::dbNetwork* network, odb::dbDatabase* db, - sta::dbSta* sta, utl::Logger* logger, par::PartitionMgr* tritonpart); @@ -99,7 +98,7 @@ class MacroPlacer2 float target_dead_space, float min_ar, int snap_layer, - bool bus_planning_flag, + bool bus_planning_on, const char* report_directory); void placeMacro(odb::dbInst* inst, diff --git a/src/mpl2/src/MakeMacroPlacer.cpp b/src/mpl2/src/MakeMacroPlacer.cpp index 3a578e50669..771b232dbeb 100644 --- a/src/mpl2/src/MakeMacroPlacer.cpp +++ b/src/mpl2/src/MakeMacroPlacer.cpp @@ -61,7 +61,6 @@ void initMacroPlacer2(OpenRoad* openroad) sta::evalTclInit(tcl_interp, sta::mpl2_tcl_inits); openroad->getMacroPlacer2()->init(openroad->getDbNetwork(), openroad->getDb(), - openroad->getSta(), openroad->getLogger(), openroad->getPartitionMgr()); } diff --git a/src/mpl2/src/SimulatedAnnealingCore.cpp b/src/mpl2/src/SimulatedAnnealingCore.cpp index f1b2952dc46..44f176cca89 100644 --- a/src/mpl2/src/SimulatedAnnealingCore.cpp +++ b/src/mpl2/src/SimulatedAnnealingCore.cpp @@ -389,9 +389,7 @@ void SimulatedAnnealingCore::packFloorplan() } std::vector accumulated_length(pos_seq_.size(), 0.0); - for (int i = 0; i < pos_seq_.size(); i++) { - const int macro_id = pos_seq_[i]; - + for (const int macro_id : pos_seq_) { // There may exist pin access macros with zero area in our sequence pair // when bus planning is on. This check is a temporary approach. if (macros_[macro_id].getWidth() <= 0 diff --git a/src/mpl2/src/clusterEngine.cpp b/src/mpl2/src/clusterEngine.cpp index 57acba0026a..d20bcb26329 100644 --- a/src/mpl2/src/clusterEngine.cpp +++ b/src/mpl2/src/clusterEngine.cpp @@ -1337,8 +1337,7 @@ void ClusteringEngine::updateSubTree(Cluster* parent) // When breaking large flat clusters, the children will // be modified, so, we need to iterate them using indexes. const UniqueClusterVector& new_children = parent->getChildren(); - for (int i = 0; i < new_children.size(); ++i) { - auto& child = new_children[i]; + for (auto& child : new_children) { child->setParent(parent); if (child->getNumStdCell() > max_std_cell_) { breakLargeFlatCluster(child.get()); @@ -2152,4 +2151,4 @@ void ClusteringEngine::clearTempMacroClusterMapping( } } -} // namespace mpl2 \ No newline at end of file +} // namespace mpl2 diff --git a/src/mpl2/src/graphics.cpp b/src/mpl2/src/graphics.cpp index 768179e8ffa..605b39ea1da 100644 --- a/src/mpl2/src/graphics.cpp +++ b/src/mpl2/src/graphics.cpp @@ -43,14 +43,7 @@ Graphics::Graphics(bool coarse, bool fine, odb::dbBlock* block, utl::Logger* logger) - : coarse_(coarse), - fine_(fine), - show_bundled_nets_(false), - skip_steps_(false), - is_skipping_(false), - only_final_result_(false), - block_(block), - logger_(logger) + : coarse_(coarse), fine_(fine), block_(block), logger_(logger) { gui::Gui::get()->registerRenderer(this); } diff --git a/src/mpl2/src/graphics.h b/src/mpl2/src/graphics.h index 789eff1efac..ec5679df6d7 100644 --- a/src/mpl2/src/graphics.h +++ b/src/mpl2/src/graphics.h @@ -115,13 +115,13 @@ class Graphics : public gui::Renderer, public Mpl2Observer odb::Rect outline_; std::vector> outlines_; - bool active_ = true; + bool active_{true}; bool coarse_; bool fine_; - bool show_bundled_nets_; - bool skip_steps_; - bool is_skipping_; - bool only_final_result_; + bool show_bundled_nets_{false}; + bool skip_steps_{false}; + bool is_skipping_{false}; + bool only_final_result_{false}; odb::dbBlock* block_; utl::Logger* logger_; diff --git a/src/mpl2/src/hier_rtlmp.cpp b/src/mpl2/src/hier_rtlmp.cpp index 2bd5b5c0ab8..3bc996e2509 100644 --- a/src/mpl2/src/hier_rtlmp.cpp +++ b/src/mpl2/src/hier_rtlmp.cpp @@ -69,12 +69,10 @@ HierRTLMP::~HierRTLMP() = default; // Constructors HierRTLMP::HierRTLMP(sta::dbNetwork* network, odb::dbDatabase* db, - sta::dbSta* sta, utl::Logger* logger, par::PartitionMgr* tritonpart) : network_(network), db_(db), - sta_(sta), logger_(logger), tritonpart_(tritonpart), tree_(std::make_unique()) diff --git a/src/mpl2/src/hier_rtlmp.h b/src/mpl2/src/hier_rtlmp.h index 2635afc01c5..53c63dc4656 100644 --- a/src/mpl2/src/hier_rtlmp.h +++ b/src/mpl2/src/hier_rtlmp.h @@ -99,7 +99,6 @@ class HierRTLMP public: HierRTLMP(sta::dbNetwork* network, odb::dbDatabase* db, - sta::dbSta* sta, utl::Logger* logger, par::PartitionMgr* tritonpart); ~HierRTLMP(); @@ -249,7 +248,6 @@ class HierRTLMP sta::dbNetwork* network_ = nullptr; odb::dbDatabase* db_ = nullptr; odb::dbBlock* block_ = nullptr; - sta::dbSta* sta_ = nullptr; utl::Logger* logger_ = nullptr; par::PartitionMgr* tritonpart_ = nullptr; std::unique_ptr tree_; diff --git a/src/mpl2/src/object.cpp b/src/mpl2/src/object.cpp index ed770109db3..70859a62539 100644 --- a/src/mpl2/src/object.cpp +++ b/src/mpl2/src/object.cpp @@ -103,14 +103,14 @@ void Metrics::addMetrics(const Metrics& metrics) macro_area_ += metrics.macro_area_; } -const std::pair Metrics::getCountStats() const +std::pair Metrics::getCountStats() const { - return std::pair(num_std_cell_, num_macro_); + return {num_std_cell_, num_macro_}; } -const std::pair Metrics::getAreaStats() const +std::pair Metrics::getAreaStats() const { - return std::pair(std_cell_area_, macro_area_); + return {std_cell_area_, macro_area_}; } unsigned int Metrics::getNumMacro() const @@ -167,7 +167,7 @@ int Cluster::getId() const return id_; } -const std::string Cluster::getName() const +const std::string& Cluster::getName() const { return name_; } @@ -183,7 +183,7 @@ void Cluster::setClusterType(const ClusterType& cluster_type) type_ = cluster_type; } -const ClusterType Cluster::getClusterType() const +const ClusterType& Cluster::getClusterType() const { return type_; } @@ -218,22 +218,22 @@ void Cluster::specifyHardMacros(std::vector& hard_macros) hard_macros_ = hard_macros; } -const std::vector Cluster::getDbModules() const +const std::vector& Cluster::getDbModules() const { return db_modules_; } -const std::vector Cluster::getLeafStdCells() const +const std::vector& Cluster::getLeafStdCells() const { return leaf_std_cells_; } -const std::vector Cluster::getLeafMacros() const +const std::vector& Cluster::getLeafMacros() const { return leaf_macros_; } -std::vector Cluster::getHardMacros() const +const std::vector& Cluster::getHardMacros() const { return hard_macros_; } @@ -369,7 +369,7 @@ void Cluster::setMetrics(const Metrics& metrics) metrics_ = metrics; } -const Metrics Cluster::getMetrics() const +const Metrics& Cluster::getMetrics() const { return metrics_; } @@ -464,7 +464,7 @@ void Cluster::setY(float y) } } -const std::pair Cluster::getLocation() const +std::pair Cluster::getLocation() const { if (!soft_macro_) { return {0, 0}; @@ -582,7 +582,7 @@ void Cluster::addConnection(int cluster_id, float weight) } } -const std::map Cluster::getConnection() const +const std::map& Cluster::getConnection() const { return connection_map_; } @@ -689,21 +689,21 @@ void Cluster::setPinAccess(int cluster_id, "Cannot set pin access for {} boundary.", toString(pin_access)); } - pin_access_map_[cluster_id] - = std::pair(pin_access, net_weight); + pin_access_map_[cluster_id] = {pin_access, net_weight}; } -const std::pair Cluster::getPinAccess(int cluster_id) +const std::pair& Cluster::getPinAccess(int cluster_id) { return pin_access_map_[cluster_id]; } -const std::map> Cluster::getPinAccessMap() const +const std::map>& Cluster::getPinAccessMap() + const { return pin_access_map_; } -const std::map> +const std::map>& Cluster::getBoundaryConnection() const { return boundary_connection_map_; @@ -771,13 +771,13 @@ void Cluster::setMacroTilings( macro_tilings_ = tilings; } -const std::vector> Cluster::getMacroTilings() const +const std::vector>& Cluster::getMacroTilings() const { return macro_tilings_; } // Virtual Connections -const std::vector> Cluster::getVirtualConnections() const +const std::vector>& Cluster::getVirtualConnections() const { return virtual_connections_; } @@ -887,9 +887,9 @@ void HardMacro::setY(float y) y_ = y; } -const std::pair HardMacro::getLocation() const +std::pair HardMacro::getLocation() const { - return std::pair(x_, y_); + return {x_, y_}; } // Note that the real X and Y does NOT include halo_width @@ -921,9 +921,9 @@ void HardMacro::setRealY(float y) y_ = y - halo_height_; } -const std::pair HardMacro::getRealLocation() const +std::pair HardMacro::getRealLocation() const { - return std::pair(x_ + halo_width_, y_ + halo_height_); + return {x_ + halo_width_, y_ + halo_height_}; } float HardMacro::getRealX() const @@ -971,12 +971,12 @@ odb::dbInst* HardMacro::getInst() const return inst_; } -const std::string HardMacro::getName() const +const std::string& HardMacro::getName() const { return name_; } -const std::string HardMacro::getMasterName() const +std::string HardMacro::getMasterName() const { if (inst_ == nullptr) { return name_; @@ -1040,7 +1040,7 @@ SoftMacro::SoftMacro(Cluster* cluster) } // name -const std::string SoftMacro::getName() const +const std::string& SoftMacro::getName() const { return name_; } diff --git a/src/mpl2/src/object.h b/src/mpl2/src/object.h index 763d656ea02..a98b10a706b 100644 --- a/src/mpl2/src/object.h +++ b/src/mpl2/src/object.h @@ -140,8 +140,8 @@ class Metrics float macro_area); void addMetrics(const Metrics& metrics); - const std::pair getCountStats() const; - const std::pair getAreaStats() const; + std::pair getCountStats() const; + std::pair getAreaStats() const; unsigned int getNumMacro() const; unsigned int getNumStdCell() const; float getStdCellArea() const; @@ -176,11 +176,11 @@ class Cluster // cluster id can not be changed int getId() const; // cluster name can be updated - const std::string getName() const; + const std::string& getName() const; void setName(const std::string& name); // cluster type (default type = MixedCluster) void setClusterType(const ClusterType& cluster_type); - const ClusterType getClusterType() const; + const ClusterType& getClusterType() const; std::string getClusterTypeString() const; // Instances (Here we store dbModule to reduce memory) @@ -189,10 +189,10 @@ class Cluster void addLeafMacro(odb::dbInst* leaf_macro); void addLeafInst(odb::dbInst* inst); void specifyHardMacros(std::vector& hard_macros); - const std::vector getDbModules() const; - const std::vector getLeafStdCells() const; - const std::vector getLeafMacros() const; - std::vector getHardMacros() const; + const std::vector& getDbModules() const; + const std::vector& getLeafStdCells() const; + const std::vector& getLeafMacros() const; + const std::vector& getHardMacros() const; void clearDbModules(); void clearLeafStdCells(); void clearLeafMacros(); @@ -211,7 +211,7 @@ class Cluster // Metrics Support void setMetrics(const Metrics& metrics); - const Metrics getMetrics() const; + const Metrics& getMetrics() const; int getNumStdCell() const; int getNumMacro() const; float getArea() const; @@ -225,7 +225,7 @@ class Cluster float getY() const; void setX(float x); void setY(float y); - const std::pair getLocation() const; + std::pair getLocation() const; Rect getBBox() const; // Hierarchy Support @@ -244,7 +244,7 @@ class Cluster // Connection signature support void initConnection(); void addConnection(int cluster_id, float weight); - const std::map getConnection() const; + const std::map& getConnection() const; bool isSameConnSignature(const Cluster& cluster, float net_threshold); bool hasMacroConnectionWith(const Cluster& cluster, float net_threshold); // Get closely-connected cluster if such cluster exists @@ -261,13 +261,13 @@ class Cluster // related to pin access void setPinAccess(int cluster_id, Boundary pin_access, float weight); void addBoundaryConnection(Boundary pin_a, Boundary pin_b, float num_net); - const std::pair getPinAccess(int cluster_id); - const std::map> getPinAccessMap() const; - const std::map> getBoundaryConnection() + const std::pair& getPinAccess(int cluster_id); + const std::map>& getPinAccessMap() const; + const std::map>& getBoundaryConnection() const; // virtual connections - const std::vector> getVirtualConnections() const; + const std::vector>& getVirtualConnections() const; void addVirtualConnection(int src, int target); // Print Basic Information @@ -278,12 +278,12 @@ class Cluster SoftMacro* getSoftMacro() const; void setMacroTilings(const std::vector>& tilings); - const std::vector> getMacroTilings() const; + const std::vector>& getMacroTilings() const; private: // Private Variables - int id_ = -1; // cluster id (a valid cluster id should be nonnegative) - std::string name_ = ""; // cluster name + int id_ = -1; // cluster id (a valid cluster id should be nonnegative) + std::string name_; // cluster name ClusterType type_ = MixedCluster; // cluster type // Instances in the cluster @@ -361,7 +361,7 @@ class HardMacro void setLocation(const std::pair& location); void setX(float x); void setY(float y); - const std::pair getLocation() const; + std::pair getLocation() const; float getX() const { return x_; } float getY() const { return y_; } // The position of pins relative to the lower left of the instance @@ -378,7 +378,7 @@ class HardMacro void setRealLocation(const std::pair& location); void setRealX(float x); void setRealY(float y); - const std::pair getRealLocation() const; + std::pair getRealLocation() const; float getRealX() const; float getRealY() const; float getRealWidth() const; @@ -393,8 +393,8 @@ class HardMacro // Interfaces with OpenDB odb::dbInst* getInst() const; - const std::string getName() const; - const std::string getMasterName() const; + const std::string& getName() const; + std::string getMasterName() const; int getXDBU() const { return block_->micronsToDbu(getX()); } @@ -434,7 +434,7 @@ class HardMacro float halo_height_ = 0.0; // halo height float width_ = 0.0; // width_ = macro_width + 2 * halo_width float height_ = 0.0; // height_ = macro_height + 2 * halo_width - std::string name_ = ""; // macro name + std::string name_; // macro name odb::dbOrientType orientation_ = odb::dbOrientType::R0; // we assume all the pins locate at the center of all pins @@ -492,7 +492,7 @@ class SoftMacro SoftMacro(Cluster* cluster); // name - const std::string getName() const; + const std::string& getName() const; void setX(float x); void setY(float y); @@ -550,12 +550,12 @@ class SoftMacro // We define x_, y_ and orientation_ here // Also enable the multi-threading - float x_ = 0.0; // lower left corner - float y_ = 0.0; // lower left corner - float width_ = 0.0; // width_ - float height_ = 0.0; // height_ - float area_ = 0.0; // area of the standard cell cluster - std::string name_ = ""; // macro name + float x_ = 0.0; // lower left corner + float y_ = 0.0; // lower left corner + float width_ = 0.0; // width_ + float height_ = 0.0; // height_ + float area_ = 0.0; // area of the standard cell cluster + std::string name_; // macro name // variables to describe shape curves (discrete or piecewise curves) std::vector> width_list_; // nondecreasing order std::vector> height_list_; // nonincreasing order diff --git a/src/mpl2/src/rtl_mp.cpp b/src/mpl2/src/rtl_mp.cpp index e13d81bc14b..d996890acd3 100644 --- a/src/mpl2/src/rtl_mp.cpp +++ b/src/mpl2/src/rtl_mp.cpp @@ -39,9 +39,7 @@ #include "odb/db.h" namespace mpl2 { -using odb::dbDatabase; using std::string; -using utl::Logger; using utl::MPL; MacroPlacer2::MacroPlacer2() = default; @@ -51,12 +49,10 @@ class Snapper; void MacroPlacer2::init(sta::dbNetwork* network, odb::dbDatabase* db, - sta::dbSta* sta, utl::Logger* logger, par::PartitionMgr* tritonpart) { - hier_rtlmp_ - = std::make_unique(network, db, sta, logger, tritonpart); + hier_rtlmp_ = std::make_unique(network, db, logger, tritonpart); logger_ = logger; db_ = db; } diff --git a/src/odb/include/odb/array1.h b/src/odb/include/odb/array1.h index a9d3e8909d2..a2085a0dde6 100644 --- a/src/odb/include/odb/array1.h +++ b/src/odb/include/odb/array1.h @@ -39,10 +39,10 @@ namespace odb { template -class Ath__array1D +class Array1D { public: - explicit Ath__array1D(int chunk = 0) + explicit Array1D(int chunk = 0) { chunk_ = chunk; if (chunk_ <= 0) { @@ -59,7 +59,7 @@ class Ath__array1D } iter_cnt_ = 0; } - ~Ath__array1D() + ~Array1D() { if (array_ != nullptr) { ::free(array_); diff --git a/src/odb/include/odb/cdl.h b/src/odb/include/odb/cdl.h index 1a2f38b5e18..f83824e3d00 100644 --- a/src/odb/include/odb/cdl.h +++ b/src/odb/include/odb/cdl.h @@ -35,9 +35,9 @@ #pragma once -#include #include +#include #include #include @@ -53,7 +53,7 @@ class cdl dbBlock* block, const char* outFileName, const std::vector& mastersFileNames, - bool includeFillers = 0); + bool includeFillers = false); }; } // namespace odb diff --git a/src/odb/include/odb/dbTransform.h b/src/odb/include/odb/dbTransform.h index 7c2b5984270..99a2867c3d4 100644 --- a/src/odb/include/odb/dbTransform.h +++ b/src/odb/include/odb/dbTransform.h @@ -59,10 +59,10 @@ class dbTransform dbTransform(const Point offset) : _offset(offset) {} // T = - dbTransform(const dbOrientType orient) : _orient(orient) {} + dbTransform(const dbOrientType& orient) : _orient(orient) {} // T = - dbTransform(const dbOrientType orient, const Point& offset) + dbTransform(const dbOrientType& orient, const Point& offset) : _orient(orient), _offset(offset) { } @@ -74,11 +74,11 @@ class dbTransform bool operator!=(const dbTransform& t) const { return !operator==(t); } - void setOrient(const dbOrientType orient) { _orient = orient; } + void setOrient(const dbOrientType& orient) { _orient = orient; } void setOffset(const Point offset) { _offset = offset; } - void setTransform(const dbOrientType orient, const Point& offset) + void setTransform(const dbOrientType& orient, const Point& offset) { _orient = orient; _offset = offset; diff --git a/src/odb/include/odb/geom_boost.h b/src/odb/include/odb/geom_boost.h index adf30db5377..0b97adfdb43 100644 --- a/src/odb/include/odb/geom_boost.h +++ b/src/odb/include/odb/geom_boost.h @@ -250,7 +250,7 @@ template <> struct exterior_ring { static std::vector get(odb::Oct& o) { return o.getPoints(); } - static const std::vector get(const odb::Oct& o) + static std::vector get(const odb::Oct& o) { return o.getPoints(); } @@ -260,7 +260,7 @@ template <> struct interior_rings { static std::vector> get(odb::Oct& o) { return {}; } - static const std::vector> get(const odb::Oct& o) + static std::vector> get(const odb::Oct& o) { return {}; } @@ -304,7 +304,7 @@ template <> struct exterior_ring { static std::vector get(odb::Polygon& p) { return p.getPoints(); } - static const std::vector get(const odb::Polygon& p) + static std::vector get(const odb::Polygon& p) { return p.getPoints(); } @@ -317,7 +317,7 @@ struct interior_rings { return {}; } - static const std::vector> get(const odb::Polygon& p) + static std::vector> get(const odb::Polygon& p) { return {}; } diff --git a/src/odb/include/odb/lefin.h b/src/odb/include/odb/lefin.h index b5ae6aaf291..a08052e2cbd 100644 --- a/src/odb/include/odb/lefin.h +++ b/src/odb/include/odb/lefin.h @@ -77,8 +77,6 @@ class dbDatabase; class dbTechLayer; class dbSite; -using namespace LefDefParser; - class lefin { dbDatabase* _db; @@ -114,12 +112,14 @@ class lefin bool readLefInner(const char* lef_file); bool readLef(const char* lef_file); - bool addGeoms(dbObject* object, bool is_pin, lefiGeometries* geometry); + bool addGeoms(dbObject* object, + bool is_pin, + LefDefParser::lefiGeometries* geometry); void createLibrary(); void createPolygon(dbObject* object, bool is_pin, dbTechLayer* layer, - lefiGeomPolygon* p, + LefDefParser::lefiGeomPolygon* p, int design_rule_width, double offset_x = 0.0, double offset_y = 0.0); @@ -141,47 +141,47 @@ class lefin void antenna(AntennaType type, double value); void arrayBegin(const char* name); - void array(lefiArray* a); + void array(LefDefParser::lefiArray* a); void arrayEnd(const char* name); int busBitChars(const char* busBit); void caseSense(int caseSense); void clearance(const char* name); void divider(const char* name); void noWireExt(const char* name); - void noiseMargin(lefiNoiseMargin* noise); + void noiseMargin(LefDefParser::lefiNoiseMargin* noise); void edge1(double value); void edge2(double value); void edgeScale(double value); - void noiseTable(lefiNoiseTable* noise); - void correction(lefiCorrectionTable* corr); + void noiseTable(LefDefParser::lefiNoiseTable* noise); + void correction(LefDefParser::lefiCorrectionTable* corr); void dielectric(double dielectric); void irdropBegin(void* ptr); - void irdrop(lefiIRDrop* irdrop); + void irdrop(LefDefParser::lefiIRDrop* irdrop); void irdropEnd(void* ptr); - void layer(lefiLayer* layer); + void layer(LefDefParser::lefiLayer* layer); void macroBegin(const char* macroName); - void macro(lefiMacro* macro); + void macro(LefDefParser::lefiMacro* macro); void macroEnd(const char* macroName); void manufacturing(double num); - void maxStackVia(lefiMaxStackVia* maxStack); - void minFeature(lefiMinFeature* min); - void nonDefault(lefiNonDefault* def); - void obstruction(lefiObstruction* obs); - void pin(lefiPin* pin); + void maxStackVia(LefDefParser::lefiMaxStackVia* maxStack); + void minFeature(LefDefParser::lefiMinFeature* min); + void nonDefault(LefDefParser::lefiNonDefault* def); + void obstruction(LefDefParser::lefiObstruction* obs); + void pin(LefDefParser::lefiPin* pin); void propDefBegin(void* ptr); - void propDef(lefiProp* prop); + void propDef(LefDefParser::lefiProp* prop); void propDefEnd(void* ptr); - void site(lefiSite* site); + void site(LefDefParser::lefiSite* site); void spacingBegin(void* ptr); - void spacing(lefiSpacing* spacing); + void spacing(LefDefParser::lefiSpacing* spacing); void spacingEnd(void* ptr); - void timing(lefiTiming* timing); - void units(lefiUnits* unit); - void useMinSpacing(lefiUseMinSpacing* spacing); + void timing(LefDefParser::lefiTiming* timing); + void units(LefDefParser::lefiUnits* unit); + void useMinSpacing(LefDefParser::lefiUseMinSpacing* spacing); void version(double num); - void via(lefiVia* via, dbTechNonDefaultRule* rule = nullptr); - void viaRule(lefiViaRule* viaRule); - void viaGenerateRule(lefiViaRule* viaRule); + void via(LefDefParser::lefiVia* via, dbTechNonDefaultRule* rule = nullptr); + void viaRule(LefDefParser::lefiViaRule* viaRule); + void viaGenerateRule(LefDefParser::lefiViaRule* viaRule); void done(void* ptr); template inline void warning(int id, std::string msg, const Args&... args) diff --git a/src/odb/include/odb/odbDList.h b/src/odb/include/odb/odbDList.h index efe1926b400..a8764a250c5 100644 --- a/src/odb/include/odb/odbDList.h +++ b/src/odb/include/odb/odbDList.h @@ -65,12 +65,6 @@ class DListIterator public: DListIterator() { _cur = nullptr; } DListIterator(T* cur) { _cur = cur; } - DListIterator(const DListIterator& i) { _cur = i._cur; } - DListIterator& operator=(const DListIterator& i) - { - _cur = i._cur; - return *this; - } bool operator==(const DListIterator& i) const { return _cur == i._cur; } bool operator!=(const DListIterator& i) const { return _cur != i._cur; } diff --git a/src/odb/include/odb/parse.h b/src/odb/include/odb/parse.h index fd4f1b25e5c..722a85b7d83 100644 --- a/src/odb/include/odb/parse.h +++ b/src/odb/include/odb/parse.h @@ -41,11 +41,11 @@ namespace odb { -class Ath__parser +class Parser { public: - Ath__parser(utl::Logger* logger); - ~Ath__parser(); + Parser(utl::Logger* logger); + ~Parser(); void openFile(const char* name = nullptr); void setInputFP(FILE* fp); int mkWords(const char* word, const char* sep = nullptr); @@ -55,8 +55,8 @@ class Ath__parser int getInt(int ii); int getInt(int n, int start); double getDouble(int ii); - void getDoubleArray(Ath__array1D* A, int start, double mult = 1.0); - Ath__array1D* readDoubleArray(const char* keyword, int start); + void getDoubleArray(Array1D* A, int start, double mult = 1.0); + Array1D* readDoubleArray(const char* keyword, int start); void printWords(FILE* fp); int getWordCnt(); diff --git a/src/odb/include/odb/util.h b/src/odb/include/odb/util.h index 7aecf5d8749..138ad5c6d05 100644 --- a/src/odb/include/odb/util.h +++ b/src/odb/include/odb/util.h @@ -32,9 +32,8 @@ #pragma once -#include - #include +#include #include #include @@ -165,7 +164,7 @@ class AthPool AthPool(const int freeAllocSize) { m_heap_ = new AthArray(4096); - free_table_ = new Ath__array1D(freeAllocSize); + free_table_ = new Array1D(freeAllocSize); } ~AthPool() @@ -218,7 +217,7 @@ class AthPool private: AthArray* m_heap_; - Ath__array1D* free_table_; + Array1D* free_table_; }; int makeSiteLoc(int x, double site_width, bool at_left_from_macro, int offset); diff --git a/src/odb/src/db/dbBlock.cpp b/src/odb/src/db/dbBlock.cpp index 59163cb18f5..5365f401a00 100644 --- a/src/odb/src/db/dbBlock.cpp +++ b/src/odb/src/db/dbBlock.cpp @@ -2235,7 +2235,7 @@ bool dbBlock::findSomeMaster(const char* names, std::vector& masters) dbLib* lib = getChip()->getDb()->findLib("lib"); dbMaster* master; - auto parser = std::make_unique(getImpl()->getLogger()); + auto parser = std::make_unique(getImpl()->getLogger()); parser->mkWords(names, nullptr); // uint noid; char* masterName; @@ -2266,7 +2266,7 @@ bool dbBlock::findSomeNet(const char* names, std::vector& nets) } _dbBlock* block = (_dbBlock*) this; dbNet* net; - auto parser = std::make_unique(getImpl()->getLogger()); + auto parser = std::make_unique(getImpl()->getLogger()); parser->mkWords(names, nullptr); uint noid; char* netName; @@ -2293,7 +2293,7 @@ bool dbBlock::findSomeInst(const char* names, std::vector& insts) } _dbBlock* block = (_dbBlock*) this; dbInst* inst; - auto parser = std::make_unique(getImpl()->getLogger()); + auto parser = std::make_unique(getImpl()->getLogger()); parser->mkWords(names, nullptr); uint ioid; char* instName; diff --git a/src/odb/src/db/dbGDSLib.cpp b/src/odb/src/db/dbGDSLib.cpp index 670ebf4481d..f7755b56f4c 100644 --- a/src/odb/src/db/dbGDSLib.cpp +++ b/src/odb/src/db/dbGDSLib.cpp @@ -286,7 +286,7 @@ void dbGDSLib::setUnits(double uu_per_dbu, double dbu_per_meter) std::pair dbGDSLib::getUnits() const { _dbGDSLib* obj = (_dbGDSLib*) this; - return std::make_pair(obj->_uu_per_dbu, obj->_dbu_per_meter); + return {obj->_uu_per_dbu, obj->_dbu_per_meter}; } dbGDSStructure* dbGDSLib::findGDSStructure(const char* name) const diff --git a/src/odb/src/swig/python/dbenums.i b/src/odb/src/swig/python/dbenums.i index 0fc8be86c51..feeea2c429a 100644 --- a/src/odb/src/swig/python/dbenums.i +++ b/src/odb/src/swig/python/dbenums.i @@ -24,25 +24,12 @@ } %typemap(in) odb::dbOrientType, dbOrientType { char *str = PyString_AsString(PyUnicode_AsASCIIString($input)); - if (strcasecmp(str, "R0") == 0) { - $1 = odb::dbOrientType::Value::R0; - } else if (strcasecmp(str, "R90") == 0) { - $1 = odb::dbOrientType::Value::R90; - } else if (strcasecmp(str, "R180") == 0) { - $1 = odb::dbOrientType::Value::R180; - } else if (strcasecmp(str, "R270") == 0) { - $1 = odb::dbOrientType::Value::R270; - } else if (strcasecmp(str, "MY") == 0) { - $1 = odb::dbOrientType::Value::MY; - } else if (strcasecmp(str, "MYR90") == 0) { - $1 = odb::dbOrientType::Value::MYR90; - } else if (strcasecmp(str, "MX") == 0) { - $1 = odb::dbOrientType::Value::MX; - } else if (strcasecmp(str, "MXR90") == 0) { - $1 = odb::dbOrientType::Value::MXR90; - } else { - SWIG_exception(SWIG_ValueError, "Unknown orientation"); - } + $1 = odb::dbOrientType(str); +} +%typemap(in) dbOrientType& (odb::dbOrientType tmp) { + char *str = PyString_AsString(PyUnicode_AsASCIIString($input)); + tmp = odb::dbOrientType(str); + $1 = &tmp; } %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) odb::dbOrientType, dbOrientType { char *str = PyString_AsString(PyUnicode_AsASCIIString($input)); diff --git a/src/odb/src/swig/tcl/dbenums.i b/src/odb/src/swig/tcl/dbenums.i index 65b527f0459..9e183ce8d02 100644 --- a/src/odb/src/swig/tcl/dbenums.i +++ b/src/odb/src/swig/tcl/dbenums.i @@ -32,51 +32,12 @@ } %typemap(in) odb::dbOrientType, dbOrientType { char *str = Tcl_GetStringFromObj($input, 0); - if (strcasecmp(str, "R0") == 0) { - $1 = odb::dbOrientType::Value::R0; - } else if (strcasecmp(str, "R90") == 0) { - $1 = odb::dbOrientType::Value::R90; - } else if (strcasecmp(str, "R180") == 0) { - $1 = odb::dbOrientType::Value::R180; - } else if (strcasecmp(str, "R270") == 0) { - $1 = odb::dbOrientType::Value::R270; - } else if (strcasecmp(str, "MY") == 0) { - $1 = odb::dbOrientType::Value::MY; - } else if (strcasecmp(str, "MYR90") == 0) { - $1 = odb::dbOrientType::Value::MYR90; - } else if (strcasecmp(str, "MX") == 0) { - $1 = odb::dbOrientType::Value::MX; - } else if (strcasecmp(str, "MXR90") == 0) { - $1 = odb::dbOrientType::Value::MXR90; - } -} -%typemap(typecheck) odb::dbOrientType, dbOrientType { + $1 = odb::dbOrientType(str); +} +%typemap(in) dbOrientType& (odb::dbOrientType tmp) { char *str = Tcl_GetStringFromObj($input, 0); - bool found = false; - if (str) { - if (strcasecmp(str, "R0") == 0) { - found = true; - } else if (strcasecmp(str, "R90") == 0) { - found = true; - } else if (strcasecmp(str, "R180") == 0) { - found = true; - } else if (strcasecmp(str, "R270") == 0) { - found = true; - } else if (strcasecmp(str, "MY") == 0) { - found = true; - } else if (strcasecmp(str, "MYR90") == 0) { - found = true; - } else if (strcasecmp(str, "MX") == 0) { - found = true; - } else if (strcasecmp(str, "MXR90") == 0) { - found = true; - } - } - if (found) { - $1 = 1; - } else { - $1 = 0; - } + tmp = odb::dbOrientType(str); + $1 = &tmp; } %typemap(out) odb::dbSigType, dbSigType { Tcl_Obj *obj = nullptr; diff --git a/src/odb/src/zutil/parse.cpp b/src/odb/src/zutil/parse.cpp index bac1ba4e40e..80813be224b 100644 --- a/src/odb/src/zutil/parse.cpp +++ b/src/odb/src/zutil/parse.cpp @@ -70,7 +70,7 @@ static char* ATH__allocCharWord(int n, utl::Logger* logger) return a; } -Ath__parser::Ath__parser(utl::Logger* logger) +Parser::Parser(utl::Logger* logger) { _logger = logger; _lineSize = 10000; @@ -78,7 +78,7 @@ Ath__parser::Ath__parser(utl::Logger* logger) init(); } -Ath__parser::~Ath__parser() +Parser::~Parser() { if (_inFP && strlen(_inputFile) > 4 && !strcmp(_inputFile + strlen(_inputFile) - 3, ".gz")) { @@ -107,7 +107,7 @@ Ath__parser::~Ath__parser() } } -void Ath__parser::init() +void Parser::init() { _line = ATH__allocCharWord(_lineSize, _logger); _tmpLine = ATH__allocCharWord(_lineSize, _logger); @@ -133,34 +133,34 @@ void Ath__parser::init() _progressLineChunk = 1000000; } -int Ath__parser::getLineNum() +int Parser::getLineNum() { return _lineNum; } -void Ath__parser::resetLineNum(int v) +void Parser::resetLineNum(int v) { _lineNum = v; } -bool Ath__parser::isDigit(int ii, int jj) +bool Parser::isDigit(int ii, int jj) { const char C = _wordArray[ii][jj]; return (C >= '0') && (C <= '9'); } -void Ath__parser::resetSeparator(const char* s) +void Parser::resetSeparator(const char* s) { strcpy(_wordSeparators, s); } -void Ath__parser::addSeparator(const char* s) +void Parser::addSeparator(const char* s) { strcat(_wordSeparators, s); } -void Ath__parser::openFile(const char* name) +void Parser::openFile(const char* name) { if (name != nullptr && strlen(name) > 4 && !strcmp(name + strlen(name) - 3, ".gz")) { @@ -191,12 +191,12 @@ void Ath__parser::openFile(const char* name) } } -void Ath__parser::setInputFP(FILE* fp) +void Parser::setInputFP(FILE* fp) { _inFP = fp; } -void Ath__parser::printWords(FILE* fp) +void Parser::printWords(FILE* fp) { if (fp == nullptr) { return; @@ -207,17 +207,17 @@ void Ath__parser::printWords(FILE* fp) fprintf(fp, "\n"); } -int Ath__parser::getWordCnt() +int Parser::getWordCnt() { return _currentWordCnt; } -char Ath__parser::getFirstChar() +char Parser::getFirstChar() { return get(0)[0]; } -char* Ath__parser::get(int ii) +char* Parser::get(int ii) { if ((ii < 0) || (ii >= _currentWordCnt)) { return nullptr; @@ -225,12 +225,12 @@ char* Ath__parser::get(int ii) return _wordArray[ii]; } -int Ath__parser::getInt(int ii) +int Parser::getInt(int ii) { return atoi(get(ii)); } -int Ath__parser::getInt(int n, int start) +int Parser::getInt(int n, int start) { char* word = get(n); char buff[128]; @@ -243,14 +243,12 @@ int Ath__parser::getInt(int n, int start) return atoi(buff); } -double Ath__parser::getDouble(int ii) +double Parser::getDouble(int ii) { return atof(get(ii)); } -void Ath__parser::getDoubleArray(Ath__array1D* A, - int start, - double mult) +void Parser::getDoubleArray(Array1D* A, int start, double mult) { if (mult == 1.0) { for (int ii = start; ii < _currentWordCnt; ii++) { @@ -263,8 +261,7 @@ void Ath__parser::getDoubleArray(Ath__array1D* A, } } -Ath__array1D* Ath__parser::readDoubleArray(const char* keyword, - int start1) +Array1D* Parser::readDoubleArray(const char* keyword, int start1) { if ((keyword != nullptr) && (strcmp(keyword, get(0)) != 0)) { return nullptr; @@ -274,7 +271,7 @@ Ath__array1D* Ath__parser::readDoubleArray(const char* keyword, return nullptr; } - Ath__array1D* A = new Ath__array1D(getWordCnt()); + Array1D* A = new Array1D(getWordCnt()); int start = 0; if (keyword != nullptr) { start = start1; @@ -283,7 +280,7 @@ Ath__array1D* Ath__parser::readDoubleArray(const char* keyword, return A; } -int Ath__parser::mkWords(const char* word, const char* sep) +int Parser::mkWords(const char* word, const char* sep) { if (word == nullptr) { return 0; @@ -305,14 +302,14 @@ int Ath__parser::mkWords(const char* word, const char* sep) return _currentWordCnt; } -bool Ath__parser::mkDir(char* word) +bool Parser::mkDir(char* word) { char command[1024]; sprintf(command, "mkdir -p %s", word); return system(command) == 0; } -int Ath__parser::mkDirTree(const char* word, const char* sep) +int Parser::mkDirTree(const char* word, const char* sep) { mkWords(word, sep); @@ -328,7 +325,7 @@ int Ath__parser::mkDirTree(const char* word, const char* sep) return _currentWordCnt; } -bool Ath__parser::isSeparator(char a) +bool Parser::isSeparator(char a) { int len = strlen(_wordSeparators); for (int k = 0; k < len; k++) { @@ -339,7 +336,7 @@ bool Ath__parser::isSeparator(char a) return false; } -int Ath__parser::mkWords(int jj) +int Parser::mkWords(int jj) { if (_line[0] == _commentChar) { return jj; @@ -381,14 +378,14 @@ int Ath__parser::mkWords(int jj) return jj; } -void Ath__parser::reportProgress() +void Parser::reportProgress() { if (_lineNum % _progressLineChunk == 0) { _logger->report("\t\tRead {} lines", _lineNum); } } -int Ath__parser::readLineAndBreak(int prevWordCnt) +int Parser::readLineAndBreak(int prevWordCnt) { if (fgets(_line, _lineSize, _inFP) == nullptr) { _currentWordCnt = prevWordCnt; @@ -407,12 +404,12 @@ int Ath__parser::readLineAndBreak(int prevWordCnt) return _currentWordCnt; } -void Ath__parser::syntaxError(const char* msg) +void Parser::syntaxError(const char* msg) { _logger->error(utl::ODB, 429, "Syntax Error at line {} ({})", _lineNum, msg); } -int Ath__parser::parseNextLine() +int Parser::parseNextLine() { while (readLineAndBreak() == 0) { ; @@ -421,7 +418,7 @@ int Ath__parser::parseNextLine() return _currentWordCnt; } -bool Ath__parser::isKeyword(int ii, const char* key1) +bool Parser::isKeyword(int ii, const char* key1) { return (get(ii) != nullptr) && (strcmp(get(ii), key1) == 0); } diff --git a/src/odb/test/parseTest.cpp b/src/odb/test/parseTest.cpp index f2e7d900d2d..3543c76c45f 100644 --- a/src/odb/test/parseTest.cpp +++ b/src/odb/test/parseTest.cpp @@ -58,7 +58,7 @@ int notice(int code, const char* msg, ...) BOOST_AUTO_TEST_CASE(parser_init_and_parse_line_with_integers) { utl::Logger logger; - Ath__parser parser(&logger); + Parser parser(&logger); BOOST_TEST(parser.getLineNum() == 0); diff --git a/src/pad/src/ICeWall.cpp b/src/pad/src/ICeWall.cpp index 2946f25b7a4..1eae658d8e3 100644 --- a/src/pad/src/ICeWall.cpp +++ b/src/pad/src/ICeWall.cpp @@ -1203,9 +1203,8 @@ void ICeWall::placeFiller( // sort biggest to smallest if (use_height) { return r_bbox.dy() > l_bbox.dy(); - } else { - return r_bbox.dx() > l_bbox.dx(); } + return r_bbox.dx() > l_bbox.dx(); }); const odb::Rect rowbbox = row->getBBox(); diff --git a/src/pad/src/RDLRoute.cpp b/src/pad/src/RDLRoute.cpp index ebbbb1eb61f..628a7e372bc 100644 --- a/src/pad/src/RDLRoute.cpp +++ b/src/pad/src/RDLRoute.cpp @@ -44,7 +44,6 @@ RDLRoute::RDLRoute(odb::dbITerm* source, const std::vector& dests, const std::map& vertex_point_map) : iterm_(source), - priority_(0), vertex_point_map_(vertex_point_map), terminals_(dests) { diff --git a/src/pad/src/RDLRoute.h b/src/pad/src/RDLRoute.h index 92a6cad13bd..8966f1aa9b7 100644 --- a/src/pad/src/RDLRoute.h +++ b/src/pad/src/RDLRoute.h @@ -105,7 +105,7 @@ class RDLRoute private: odb::dbITerm* iterm_; - int priority_; + int priority_{0}; bool route_pending_; diff --git a/src/pad/src/RDLRouter.cpp b/src/pad/src/RDLRouter.cpp index c186fb54be6..5edddae4059 100644 --- a/src/pad/src/RDLRouter.cpp +++ b/src/pad/src/RDLRouter.cpp @@ -157,8 +157,7 @@ RDLRouter::RDLRouter(utl::Logger* logger, allow45_(allow45), turn_penalty_(turn_penalty), max_router_iterations_(max_iterations), - routing_map_(routing_map), - gui_(nullptr) + routing_map_(routing_map) { if (width_ == 0) { width_ = layer_->getWidth(); diff --git a/src/pad/src/RDLRouter.h b/src/pad/src/RDLRouter.h index e932dca6d4a..a3741daa80f 100644 --- a/src/pad/src/RDLRouter.h +++ b/src/pad/src/RDLRouter.h @@ -246,7 +246,7 @@ class RDLRouter NetRoutingTargetMap routing_targets_; std::vector routes_; - RDLGui* gui_; + RDLGui* gui_{nullptr}; }; } // namespace pad diff --git a/src/rcx/include/rcx/extRCap.h b/src/rcx/include/rcx/extRCap.h index 5512472e71e..cccdf3ccbcf 100644 --- a/src/rcx/include/rcx/extRCap.h +++ b/src/rcx/include/rcx/extRCap.h @@ -52,13 +52,13 @@ namespace rcx { class extMeasure; -using odb::Ath__array1D; +using odb::Array1D; using odb::AthPool; using odb::uint; using utl::Logger; class extSpef; -class Ath__gridTable; +class GridTable; // CoupleOptions seriously needs to be rewriten to use a class with named // members. -cherry 05/09/2021 @@ -93,8 +93,8 @@ class extDistRC Logger* logger); double GetDBcoords(int x, int db_factor); void set(uint d, double cc, double fr, double a, double r); - void readRC(Ath__parser* parser, double dbFactor = 1.0); - void readRC_res2(Ath__parser* parser, double dbFactor = 1.0); + void readRC(Parser* parser, double dbFactor = 1.0); + void readRC_res2(Parser* parser, double dbFactor = 1.0); double getFringe(); double getCoupling(); double getDiag(); @@ -127,7 +127,7 @@ class extDistRCTable ~extDistRCTable(); extDistRC* getRC_99(); - void ScaleRes(double SUB_MULT_RES, Ath__array1D* table); + void ScaleRes(double SUB_MULT_RES, Array1D* table); uint addMeasureRC(extDistRC* rc); void makeComputeTable(uint maxDist, uint distUnit); @@ -139,13 +139,10 @@ class extDistRCTable extDistRC* getComputeRC_res(uint dist1, uint dist2); extDistRC* findIndexed_res(uint dist1, uint dist2); int getComputeRC_maxDist(); - uint writeRules(FILE* fp, - Ath__array1D* table, - double w, - bool bin); + uint writeRules(FILE* fp, Array1D* table, double w, bool bin); uint writeRules(FILE* fp, double w, bool compute, bool bin); uint writeDiagRules(FILE* fp, - Ath__array1D* table, + Array1D* table, double w1, double w2, double s, @@ -156,13 +153,13 @@ class extDistRCTable double s, bool compute, bool bin); - uint readRules(Ath__parser* parser, + uint readRules(Parser* parser, AthPool* rcPool, bool compute, bool bin, bool ignore, double dbFactor = 1.0); - uint readRules_res2(Ath__parser* parser, + uint readRules_res2(Parser* parser, AthPool* rcPool, bool compute, bool bin, @@ -183,10 +180,10 @@ class extDistRCTable void makeCapTableOver(); void makeCapTableUnder(); - Ath__array1D* _measureTable; - Ath__array1D* _computeTable; - Ath__array1D* _measureTableR[16]; - Ath__array1D* _computeTableR[16]; // OPTIMIZE + Array1D* _measureTable; + Array1D* _computeTable; + Array1D* _measureTableR[16]; + Array1D* _computeTableR[16]; // OPTIMIZE int _maxDist; uint _distCnt; uint _unit; @@ -201,14 +198,14 @@ class extDistWidthRCTable uint met, uint layerCnt, uint metCnt, - Ath__array1D* widthTable, + Array1D* widthTable, AthPool* rcPool, double dbFactor = 1.0); extDistWidthRCTable(bool over, uint met, uint layerCnt, uint metCnt, - Ath__array1D* widthTable, + Array1D* widthTable, int diagWidthCnt, int diagDistCnt, AthPool* rcPool, @@ -225,8 +222,8 @@ class extDistWidthRCTable ~extDistWidthRCTable(); void setDiagUnderTables(uint met, - Ath__array1D* diagWidthTable, - Ath__array1D* diagDistTable, + Array1D* diagWidthTable, + Array1D* diagDistTable, double dbFactor = 1.0); uint getWidthIndex(uint w); uint getDiagWidthIndex(uint m, uint w); @@ -244,35 +241,35 @@ class extDistWidthRCTable uint writeRulesDiagUnder2(FILE* fp, bool bin); uint writeRulesOverUnder(FILE* fp, bool bin); uint getMetIndexUnder(uint mOver); - uint readRulesOver(Ath__parser* parser, + uint readRulesOver(Parser* parser, uint widthCnt, bool bin, bool ignore, const char* OVER, double dbFactor = 1.0); - uint readRulesUnder(Ath__parser* parser, + uint readRulesUnder(Parser* parser, uint widthCnt, bool bin, bool ignore, double dbFactor = 1.0); - uint readRulesDiagUnder(Ath__parser* parser, + uint readRulesDiagUnder(Parser* parser, uint widthCnt, uint diagWidthCnt, uint diagDistCnt, bool bin, bool ignore, double dbFactor = 1.0); - uint readRulesDiagUnder(Ath__parser* parser, + uint readRulesDiagUnder(Parser* parser, uint widthCnt, bool bin, bool ignore, double dbFactor = 1.0); - uint readRulesOverUnder(Ath__parser* parser, + uint readRulesOverUnder(Parser* parser, uint widthCnt, bool bin, bool ignore, double dbFactor = 1.0); - uint readMetalHeader(Ath__parser* parser, + uint readMetalHeader(Parser* parser, uint& met, const char* keyword, bool bin, @@ -293,20 +290,20 @@ class extDistWidthRCTable uint _layerCnt; uint _met; - Ath__array1D* _widthTable; - Ath__array1D* _widthMapTable; - Ath__array1D* _diagWidthTable[32]; - Ath__array1D* _diagDistTable[32]; - Ath__array1D* _diagWidthMapTable[32]; - Ath__array1D* _diagDistMapTable[32]; + Array1D* _widthTable; + Array1D* _widthMapTable; + Array1D* _diagWidthTable[32]; + Array1D* _diagDistTable[32]; + Array1D* _diagWidthMapTable[32]; + Array1D* _diagDistMapTable[32]; uint _modulo; int _firstWidth = 0; int _lastWidth = -1; - Ath__array1D* _firstDiagWidth; - Ath__array1D* _lastDiagWidth; - Ath__array1D* _firstDiagDist; - Ath__array1D* _lastDiagDist; + Array1D* _firstDiagWidth; + Array1D* _lastDiagWidth; + Array1D* _firstDiagDist; + Array1D* _lastDiagDist; bool _widthTableAllocFlag; // if false widthtable is pointer extDistRCTable*** _rcDistTable; // per over/under metal, per width @@ -327,30 +324,28 @@ class extMetRCTable bool over, bool under, bool diag = false); - void allocOverTable(uint met, - Ath__array1D* wTable, - double dbFactor = 1.0); + void allocOverTable(uint met, Array1D* wTable, double dbFactor = 1.0); void allocDiagUnderTable(uint met, - Ath__array1D* wTable, + Array1D* wTable, int diagWidthCnt, int diagDistCnt, double dbFactor = 1.0); void allocDiagUnderTable(uint met, - Ath__array1D* wTable, + Array1D* wTable, double dbFactor = 1.0); void allocUnderTable(uint met, - Ath__array1D* wTable, + Array1D* wTable, double dbFactor = 1.0); void allocOverUnderTable(uint met, - Ath__array1D* wTable, + Array1D* wTable, double dbFactor = 1.0); void setDiagUnderTables(uint met, uint overMet, - Ath__array1D* diagWTable, - Ath__array1D* diagSTable, + Array1D* diagWTable, + Array1D* diagSTable, double dbFactor = 1.0); void addRCw(extMeasure* m); - uint readRCstats(Ath__parser* parser); + uint readRCstats(Parser* parser); void mkWidthAndSpaceMappings(); uint addCapOver(uint met, uint metUnder, extDistRC* rc); @@ -388,8 +383,8 @@ class extRCTable bool _over; uint _maxCnt1; - Ath__array1D*** _inTable; // per metal per width - Ath__array1D*** _table; + Array1D*** _inTable; // per metal per width + Array1D*** _table; }; class extMain; @@ -529,8 +524,8 @@ class extRCModel void getDiagTables(extMeasure* m, uint widthCnt, uint spaceCnt); void setDiagUnderTables(extMeasure* m); void getRCtable(uint met, int mUnder, int OverMet, double w, double dRate); - void getRCtable(Ath__array1D* sTable, - Ath__array1D* rcTable, + void getRCtable(Array1D* sTable, + Array1D* rcTable, uint valType, uint met, int mUnder, @@ -548,18 +543,18 @@ class extRCModel uint cornerCnt = 0, const uint* cornerTable = nullptr, double dbFactor = 1.0); - uint readMetalHeader(Ath__parser* parser, + uint readMetalHeader(Parser* parser, uint& met, const char* keyword, bool bin, bool ignore); - Ath__array1D* readHeaderAndWidth(Ath__parser* parser, - uint& met, - const char* ouKey, - const char* wKey, - bool bin, - bool ignore); - uint readRules(Ath__parser* parser, + Array1D* readHeaderAndWidth(Parser* parser, + uint& met, + const char* ouKey, + const char* wKey, + bool bin, + bool ignore); + uint readRules(Parser* parser, uint m, uint ii, const char* ouKey, @@ -612,8 +607,8 @@ class extRCModel int _noVariationIndex; uint _modelCnt; - Ath__array1D* _dataRateTable; - Ath__array1D* _dataRateTableMap; + Array1D* _dataRateTable; + Array1D* _dataRateTableMap; extMetRCTable** _modelTable; uint _tmpDataRate; bool _diag; @@ -634,7 +629,7 @@ class extRCModel char* _wireDirName; char* _topDir; char* _patternName; - Ath__parser* _parser; + Parser* _parser; char* _solverFileName; FILE* _capLogFP; @@ -733,9 +728,9 @@ class extMeasure bool getFirstShape(odb::dbNet* net, odb::dbShape& s); void swap_coords(SEQ* s); - uint swap_coords(uint initCnt, uint endCnt, Ath__array1D* resTable); - uint getOverlapSeq(uint met, SEQ* s, Ath__array1D* resTable); - uint getOverlapSeq(uint met, int* ll, int* ur, Ath__array1D* resTable); + uint swap_coords(uint initCnt, uint endCnt, Array1D* resTable); + uint getOverlapSeq(uint met, SEQ* s, Array1D* resTable); + uint getOverlapSeq(uint met, int* ll, int* ur, Array1D* resTable); bool isConnectedToBterm(odb::dbRSeg* rseg1); uint defineBox(CoupleOptions& options); @@ -791,33 +786,30 @@ class extMeasure void updateForBench(extMainOptions* opt, extMain* extMain); uint measureOverUnderCap(); uint measureOverUnderCap_orig(gs* pixelTable, uint** ouPixelTableIndexMap); - uint getSeqOverOrUnder(Ath__array1D* seqTable, + uint getSeqOverOrUnder(Array1D* seqTable, gs* pixelTable, uint met, - Ath__array1D* resTable); - uint computeOverOrUnderSeq(Ath__array1D* seqTable, + Array1D* resTable); + uint computeOverOrUnderSeq(Array1D* seqTable, uint met, - Ath__array1D* resTable, + Array1D* resTable, bool over); - uint computeOverUnder(int* ll, int* ur, Ath__array1D* resTable); + uint computeOverUnder(int* ll, int* ur, Array1D* resTable); - void release(Ath__array1D* seqTable, gs* pixelTable = nullptr); - void addSeq(Ath__array1D* seqTable, gs* pixelTable); + void release(Array1D* seqTable, gs* pixelTable = nullptr); + void addSeq(Array1D* seqTable, gs* pixelTable); void addSeq(const int* ll, const int* ur, - Ath__array1D* seqTable, + Array1D* seqTable, gs* pixelTable = nullptr); SEQ* addSeq(const int* ll, const int* ur); - void copySeq(SEQ* t, Ath__array1D* seqTable, gs* pixelTable); - void tableCopyP(Ath__array1D* src, Ath__array1D* dst); - void tableCopy(Ath__array1D* src, - Ath__array1D* dst, - gs* pixelTable); + void copySeq(SEQ* t, Array1D* seqTable, gs* pixelTable); + void tableCopyP(Array1D* src, Array1D* dst); + void tableCopy(Array1D* src, Array1D* dst, gs* pixelTable); uint measureDiagFullOU(); - uint ouFlowStep(Ath__array1D* overTable); - int underFlowStep(Ath__array1D* srcTable, - Ath__array1D* overTable); + uint ouFlowStep(Array1D* overTable); + int underFlowStep(Array1D* srcTable, Array1D* overTable); void measureRC(CoupleOptions& options); int computeAndStoreRC(odb::dbRSeg* rseg1, odb::dbRSeg* rseg2, int srcCovered); @@ -834,8 +826,8 @@ class extMeasure int diagCovered, int srcCovered); - void copySeqUsingPool(SEQ* t, Ath__array1D* seqTable); - void seq_release(Ath__array1D* table); + void copySeqUsingPool(SEQ* t, Array1D* seqTable); + void seq_release(Array1D* table); void calcOU(uint len); void calcRC(odb::dbRSeg* rseg1, odb::dbRSeg* rseg2, uint totLenCovered); int getMaxDist(int tgtMet, uint modelIndex); @@ -850,18 +842,18 @@ class extMeasure uint dir, uint planeIndex, uint trackn, - Ath__array1D* residueSeq); + Array1D* residueSeq); int computeResDist(SEQ* s, uint trackMin, uint trackMax, uint targetMet, - Ath__array1D* diagTable); + Array1D* diagTable); uint computeDiag(SEQ* s, uint targetMet, uint dir, uint planeIndex, uint trackn, - Ath__array1D* residueSeq); + Array1D* residueSeq); odb::dbCCSeg* makeCcap(odb::dbRSeg* rseg1, odb::dbRSeg* rseg2, double ccCap); void addCCcap(odb::dbCCSeg* ccap, double v, uint model); @@ -882,7 +874,7 @@ class extMeasure uint getOverUnderIndex(); uint getLength(SEQ* s, int dir); - uint blackCount(uint start, Ath__array1D* resTable); + uint blackCount(uint start, Array1D* resTable); extDistRC* computeR(uint len, double* valTable); extDistRC* computeOverFringe(uint overMet, uint overWidth, @@ -914,44 +906,43 @@ class extMeasure extDistRC* getFringe(uint len, double* valTable); - void tableCopyP(Ath__array1D* src, Ath__array1D* dst); + void tableCopyP(Array1D* src, Array1D* dst); void getMinWidth(odb::dbTech* tech); uint measureOverUnderCapCJ(); - uint computeOverUnder(int xy1, int xy2, Ath__array1D* resTable); - uint computeOUwith2planes(int* ll, int* ur, Ath__array1D* resTable); + uint computeOverUnder(int xy1, int xy2, Array1D* resTable); + uint computeOUwith2planes(int* ll, int* ur, Array1D* resTable); uint intersectContextArray(int pmin, int pmax, uint met1, uint met2, - Ath__array1D* tgtContext); - uint computeOverOrUnderSeq(Ath__array1D* seqTable, + Array1D* tgtContext); + uint computeOverOrUnderSeq(Array1D* seqTable, uint met, - Ath__array1D* resTable, + Array1D* resTable, bool over); bool updateLengthAndExit(int& remainder, int& totCovered, int len); - int compute_Diag_Over_Under(Ath__array1D* seqTable, - Ath__array1D* resTable); - int compute_Diag_OverOrUnder(Ath__array1D* seqTable, + int compute_Diag_Over_Under(Array1D* seqTable, Array1D* resTable); + int compute_Diag_OverOrUnder(Array1D* seqTable, bool over, uint met, - Ath__array1D* resTable); + Array1D* resTable); uint measureUnderOnly(bool diagFlag); uint measureOverOnly(bool diagFlag); uint measureDiagOU(uint ouLevelLimit, uint diagLevelLimit); - uint mergeContextArray(Ath__array1D* srcContext, + uint mergeContextArray(Array1D* srcContext, int minS, - Ath__array1D* tgtContext); - uint mergeContextArray(Ath__array1D* srcContext, + Array1D* tgtContext); + uint mergeContextArray(Array1D* srcContext, int minS, int pmin, int pmax, - Ath__array1D* tgtContext); - uint intersectContextArray(Ath__array1D* s1Context, - Ath__array1D* s2Context, + Array1D* tgtContext); + uint intersectContextArray(Array1D* s1Context, + Array1D* s2Context, int minS1, int minS2, - Ath__array1D* tgtContext); + Array1D* tgtContext); extDistRC* addRC(extDistRC* rcUnit, uint len, uint jj); @@ -977,25 +968,25 @@ class extMeasure int trackDist, int& loTrack, int& hiTrack); - int computeDiagOU(SEQ* s, uint targetMet, Ath__array1D* residueSeq); + int computeDiagOU(SEQ* s, uint targetMet, Array1D* residueSeq); int computeDiagOU(SEQ* s, uint trackMin, uint trackMax, uint targetMet, - Ath__array1D* diagTable); + Array1D* diagTable); void printDgContext(); void initTargetSeq(); void getDgOverlap(CoupleOptions& options); void getDgOverlap(SEQ* sseq, uint dir, - Ath__array1D* dgContext, - Ath__array1D* overlapSeq, - Ath__array1D* residueSeq); + Array1D* dgContext, + Array1D* overlapSeq, + Array1D* residueSeq); void getDgOverlap_res(SEQ* sseq, uint dir, - Ath__array1D* dgContext, - Ath__array1D* overlapSeq, - Ath__array1D* residueSeq); + Array1D* dgContext, + Array1D* overlapSeq, + Array1D* residueSeq); uint getRSeg(odb::dbNet* net, uint shapeId); @@ -1056,35 +1047,35 @@ class extMeasure extDistRC* _rc[20]; extDistRC* _tmpRC; extRCTable* _capTable; - Ath__array1D _widthTable; - Ath__array1D _spaceTable; - Ath__array1D _dataTable; - Ath__array1D _pTable; - Ath__array1D _widthTable0; - Ath__array1D _spaceTable0; - Ath__array1D _diagSpaceTable0; - Ath__array1D _diagWidthTable0; - - Ath__array1D*** _dgContextArray; // array - uint* _dgContextDepth; // not array - uint* _dgContextPlanes; // not array - uint* _dgContextTracks; // not array - uint* _dgContextBaseLvl; // not array - int* _dgContextLowLvl; // not array - int* _dgContextHiLvl; // not array - uint* _dgContextBaseTrack; // array - int* _dgContextLowTrack; // array - int* _dgContextHiTrack; // array - int** _dgContextTrackBase; // array + Array1D _widthTable; + Array1D _spaceTable; + Array1D _dataTable; + Array1D _pTable; + Array1D _widthTable0; + Array1D _spaceTable0; + Array1D _diagSpaceTable0; + Array1D _diagWidthTable0; + + Array1D*** _dgContextArray; // array + uint* _dgContextDepth; // not array + uint* _dgContextPlanes; // not array + uint* _dgContextTracks; // not array + uint* _dgContextBaseLvl; // not array + int* _dgContextLowLvl; // not array + int* _dgContextHiLvl; // not array + uint* _dgContextBaseTrack; // array + int* _dgContextLowTrack; // array + int* _dgContextHiTrack; // array + int** _dgContextTrackBase; // array FILE* _dgContextFile; uint _dgContextCnt; - Ath__array1D** _ccContextArray; + Array1D** _ccContextArray; - Ath__array1D + Array1D _2dBoxTable[2][20]; // assume 20 layers; 0=main net; 1=context AthPool* _2dBoxPool; - Ath__array1D** _ccMergedContextArray; + Array1D** _ccMergedContextArray; int _ll[2]; int _ur[2]; @@ -1103,7 +1094,7 @@ class extMeasure extMain* _extMain; extRCModel* _currentModel; - Ath__array1D _metRCTable; + Array1D _metRCTable; uint _minModelIndex; uint _maxModelIndex; @@ -1122,13 +1113,13 @@ class extMeasure gs* _pixelTable; - Ath__array1D* _diagTable; - Ath__array1D* _tmpSrcTable; - Ath__array1D* _tmpDstTable; - Ath__array1D* _tmpTable; - Ath__array1D* _underTable; - Ath__array1D* _ouTable; - Ath__array1D* _overTable; + Array1D* _diagTable; + Array1D* _tmpSrcTable; + Array1D* _tmpDstTable; + Array1D* _tmpTable; + Array1D* _underTable; + Array1D* _ouTable; + Array1D* _overTable; int _diagLen; uint _netId; @@ -1141,7 +1132,7 @@ class extMeasure AthPool* _seqPool; AthPool* _lenOUPool; - Ath__array1D* _lenOUtable; + Array1D* _lenOUtable; bool _diagFlow; bool _toHi; @@ -1199,11 +1190,11 @@ class extMainOptions odb::dbTech* _tech; odb::dbBlock* _block; - Ath__array1D _widthTable; - Ath__array1D _spaceTable; - Ath__array1D _densityTable; - Ath__array1D _thicknessTable; - Ath__array1D _gridTable; + Array1D _widthTable; + Array1D _spaceTable; + Array1D _densityTable; + Array1D _thicknessTable; + Array1D _gridTable; int _ll[2]; int _ur[2]; @@ -1318,14 +1309,14 @@ class extMain int* bb_ur, uint wtype, uint ptype, - Ath__array1D* sdbSignalTable); + Array1D* sdbSignalTable); uint addNetOnTable(uint netId, uint dir, odb::Rect* maxRect, uint* nm_step, int* bb_ll, int* bb_ur, - Ath__array1D*** wireTable); + Array1D*** wireTable); void getNetShapes(odb::dbNet* net, odb::Rect** maxRectSdb, odb::Rect& maxRectGs, @@ -1617,7 +1608,7 @@ class extMain uint getNetBbox(odb::dbNet* net, odb::Rect& maxRect); - void resetNetSpefFlag(Ath__array1D* tmpNetIdTable); + void resetNetSpefFlag(Array1D* tmpNetIdTable); uint sBoxCounter(odb::dbNet* net, uint& maxWidth); uint powerWireCounter(uint& maxWidth); @@ -1658,7 +1649,7 @@ class extMain int* bb_ll, int* bb_ur, uint bucketSize, - Ath__array1D*** wireBinTable, + Array1D*** wireBinTable, dbCreateNetUtil* createDbNet); uint getNetBbox(odb::dbNet* net, odb::Rect* maxRect[2]); @@ -1878,7 +1869,7 @@ class extMain void initMappingTables(); void allocMappingTables(int n1, int n2, int n3); uint addSboxesOnSearch(odb::dbNet* net); - odb::Rect* getRect_SBox(Ath__array1D* table, + odb::Rect* getRect_SBox(Array1D* table, uint ii, bool filter, uint dir, @@ -1998,12 +1989,12 @@ class extMain Logger* logger_; bool _batchScaleExt = true; - Ath__array1D* _processCornerTable = nullptr; - Ath__array1D* _scaledCornerTable = nullptr; + Array1D* _processCornerTable = nullptr; + Array1D* _scaledCornerTable = nullptr; - Ath__array1D* _modelTable; - Ath__array1D _modelMap; // TO_TEST - Ath__array1D _metRCTable; + Array1D* _modelTable; + Array1D _modelMap; // TO_TEST + Array1D _metRCTable; double _resistanceTable[20][20]; double _capacitanceTable[20][20]; // 20 layers by 20 rc models double _minWidthTable[20]; @@ -2064,9 +2055,9 @@ class extMain bool _useDbSdb; - Ath__array1D* _nodeTable = nullptr; // junction id -> cap node id - Ath__array1D* _btermTable = nullptr; // bterm id -> cap node id - Ath__array1D* _itermTable = nullptr; // iterm id -> cap node id + Array1D* _nodeTable = nullptr; // junction id -> cap node id + Array1D* _btermTable = nullptr; // bterm id -> cap node id + Array1D* _itermTable = nullptr; // iterm id -> cap node id uint _dbPowerId = 1; uint _dbSignalId = 2; @@ -2098,7 +2089,7 @@ class extMain AthPool* _seqPool = nullptr; - Ath__array1D*** _dgContextArray = nullptr; + Array1D*** _dgContextArray = nullptr; uint _dgContextDepth; uint _dgContextPlanes; uint _dgContextTracks; @@ -2110,8 +2101,8 @@ class extMain int* _dgContextHiTrack = nullptr; int** _dgContextTrackBase = nullptr; - Ath__array1D** _ccContextArray = nullptr; - Ath__array1D** _ccMergedContextArray = nullptr; + Array1D** _ccContextArray = nullptr; + Array1D** _ccMergedContextArray = nullptr; uint _extRun = 0; odb::dbExtControl* _prevControl = nullptr; @@ -2127,7 +2118,7 @@ class extMain std::vector _connectedBTerm; std::vector _connectedITerm; - Ath__gridTable* _search = nullptr; + GridTable* _search = nullptr; int _noVariationIndex; @@ -2163,7 +2154,7 @@ class extMain FILE* _viaStackGlobVDD = nullptr; FILE* _viaStackGlobGND = nullptr; - Ath__array1D* _junct2viaMap = nullptr; + Array1D* _junct2viaMap = nullptr; bool _dbgPowerFlow; dbCreateNetUtil* _netUtil = nullptr; @@ -2176,14 +2167,14 @@ class extMain uint _stackedViaResCnt; uint _totViaResCnt; - Ath__array1D* _via2JunctionMap = nullptr; + Array1D* _via2JunctionMap = nullptr; std::map _via_map; std::map _via_id_map; std::map _capNode_map; std::vector _powerMacroTable; std::vector _viaUpperTable[2]; - Ath__array1D** _supplyViaMap[2]{nullptr, nullptr}; - Ath__array1D** _supplyViaTable[2]{nullptr, nullptr}; + Array1D** _supplyViaMap[2]{nullptr, nullptr}; + Array1D** _supplyViaTable[2]{nullptr, nullptr}; char* _power_source_file = nullptr; std::vector _powerSourceTable[2]; FILE* _coordsFP = nullptr; @@ -2199,7 +2190,7 @@ class extMain char _node_blk_dir[1024]; char _node_blk_prefix[1024]; char _node_inst_prefix[1024]; - Ath__array1D* _junct2iterm = nullptr; + Array1D* _junct2iterm = nullptr; std::map _sbox_id_map; uint _powerWireCnt; diff --git a/src/rcx/include/rcx/extSpef.h b/src/rcx/include/rcx/extSpef.h index 3841ab600c6..8c32bdf40dd 100644 --- a/src/rcx/include/rcx/extSpef.h +++ b/src/rcx/include/rcx/extSpef.h @@ -47,7 +47,7 @@ class Logger; namespace rcx { -using odb::Ath__array1D; +using odb::Array1D; using odb::uint; using utl::Logger; @@ -193,9 +193,9 @@ class extSpef uint getITermMapping(uint b); void resetTermTables(); void resetCapTables(uint maxNode); - void initCapTable(Ath__array1D* table); - void deleteTableCap(Ath__array1D* table); - void reinitCapTable(Ath__array1D* table, uint n); + void initCapTable(Array1D* table); + void deleteTableCap(Array1D* table); + void reinitCapTable(Array1D* table, uint n); void addCap(const double* cap, double* totCap, uint n); void addHalfCap(double* totCap, const double* cap, uint n = 0); void getCaps(odb::dbNet* net, double* totCap); @@ -343,10 +343,10 @@ class extSpef char _outFile[1024]; FILE* _outFP = nullptr; - Ath__parser* _parser = nullptr; + Parser* _parser = nullptr; - Ath__parser* _nodeParser = nullptr; - Ath__parser* _nodeCoordParser = nullptr; + Parser* _nodeParser = nullptr; + Parser* _nodeCoordParser = nullptr; uint _tmpNetSpefId = 0; odb::dbTech* _tech; @@ -376,17 +376,17 @@ class extSpef bool _extracted = false; - Ath__array1D* _nodeTable = nullptr; - Ath__array1D* _btermTable = nullptr; - Ath__array1D* _itermTable = nullptr; - Ath__array1D* _nodeCapTable = nullptr; - Ath__array1D* _btermCapTable = nullptr; - Ath__array1D* _itermCapTable = nullptr; + Array1D* _nodeTable = nullptr; + Array1D* _btermTable = nullptr; + Array1D* _itermTable = nullptr; + Array1D* _nodeCapTable = nullptr; + Array1D* _btermCapTable = nullptr; + Array1D* _itermCapTable = nullptr; const char* _spefName; uint _maxMapId; - Ath__array1D* _idMapTable; - Ath__array1D* _nameMapTable = nullptr; + Array1D* _idMapTable; + Array1D* _nameMapTable = nullptr; uint _lastNameMapIndex = 0; uint _cCnt; @@ -471,7 +471,7 @@ class extSpef uint _cc_merge_cnt = 0; uint _cc_app_print_limit = 0; int _appcnt[16]; - Ath__array1D* _ccidmap = nullptr; + Array1D* _ccidmap = nullptr; uint _dbCorner; const char* _tmpNetName = nullptr; @@ -483,15 +483,15 @@ class extSpef std::vector _netV1; - Ath__array1D* _capNodeTable = nullptr; - Ath__array1D* _xCoordTable = nullptr; - Ath__array1D* _yCoordTable = nullptr; - Ath__array1D* _x1CoordTable = nullptr; - Ath__array1D* _y1CoordTable = nullptr; - Ath__array1D* _x2CoordTable = nullptr; - Ath__array1D* _y2CoordTable = nullptr; - Ath__array1D* _levelTable = nullptr; - Ath__array1D* _idTable = nullptr; + Array1D* _capNodeTable = nullptr; + Array1D* _xCoordTable = nullptr; + Array1D* _yCoordTable = nullptr; + Array1D* _x1CoordTable = nullptr; + Array1D* _y1CoordTable = nullptr; + Array1D* _x2CoordTable = nullptr; + Array1D* _y2CoordTable = nullptr; + Array1D* _levelTable = nullptr; + Array1D* _idTable = nullptr; double _lengthUnit; double _nodeCoordFactor; bool _doSortRSeg = true; @@ -505,9 +505,9 @@ class extSpef uint _bigLoop; uint _multipleLoop; uint _srii; - Ath__array1D* _srsegi; - Ath__array1D* _nrseg; - Ath__array1D*>* _hcnrc; + Array1D* _srsegi; + Array1D* _nrseg; + Array1D*>* _hcnrc; uint _rsegCnt; bool _readAllCorners = false; diff --git a/src/rcx/include/rcx/extprocess.h b/src/rcx/include/rcx/extprocess.h index 11a764affdf..36d2ad36cd2 100644 --- a/src/rcx/include/rcx/extprocess.h +++ b/src/rcx/include/rcx/extprocess.h @@ -42,8 +42,8 @@ class Logger; namespace rcx { -using odb::Ath__array1D; -using odb::Ath__parser; +using odb::Array1D; +using odb::Parser; using odb::uint; using utl::Logger; @@ -179,22 +179,21 @@ class extVarTable extVarTable(uint rowCnt); ~extVarTable(); - Ath__array1D* readDoubleArray(Ath__parser* parser, - const char* keyword); + Array1D* readDoubleArray(Parser* parser, const char* keyword); void printOneLine(FILE* fp, - Ath__array1D* A, + Array1D* A, const char* header, const char* trail); void printTable(FILE* fp, const char* valKey); double getVal(uint ii, uint jj) { return _vTable[ii]->get(jj); }; private: - Ath__array1D* _width; - Ath__array1D* _space; - Ath__array1D* _density; - Ath__array1D* _p; + Array1D* _width; + Array1D* _space; + Array1D* _density; + Array1D* _p; uint _rowCnt; - Ath__array1D** _vTable; + Array1D** _vTable; friend class extVariation; }; @@ -203,10 +202,10 @@ class extVariation { public: void printVariation(FILE* fp, uint n); - Ath__array1D* getWidthTable(); - Ath__array1D* getSpaceTable(); - Ath__array1D* getDataRateTable(); - Ath__array1D* getPTable(); + Array1D* getWidthTable(); + Array1D* getSpaceTable(); + Array1D* getDataRateTable(); + Array1D* getPTable(); double getTopWidth(uint ii, uint jj); double getTopWidthR(uint ii, uint jj); double getBottomWidth(double w, uint dIndex); @@ -214,9 +213,7 @@ class extVariation double getThickness(double w, uint dIndex); double getThicknessR(double w, uint dIndex); double getP(double w); - double interpolate(double w, - Ath__array1D* X, - Ath__array1D* Y); + double interpolate(double w, Array1D* X, Array1D* Y); void setLogger(Logger* logger) { logger_ = logger; } private: @@ -277,10 +274,10 @@ class extProcess bool diag = false); extVariation* getVariation(uint met); - Ath__array1D* getWidthTable(uint met); - Ath__array1D* getSpaceTable(uint met); - Ath__array1D* getDiagSpaceTable(uint met); - Ath__array1D* getDataRateTable(uint met); + Array1D* getWidthTable(uint met); + Array1D* getSpaceTable(uint met); + Array1D* getDiagSpaceTable(uint met); + Array1D* getDataRateTable(uint met); double adjustMasterLayersForHeight(uint met, double thickness); double adjustMasterDielectricsForHeight(uint met, double dth); bool getMaxMinFlag(); @@ -293,12 +290,12 @@ class extProcess uint _dielectricCnt; bool _maxMinFlag; bool _thickVarFlag; - Ath__array1D* _condTable; - Ath__array1D* _dielTable; - Ath__array1D* _masterConductorTable; - Ath__array1D* _masterDielectricTable; - Ath__array1D* _varTable; - Ath__array1D* _dataRateTable; + Array1D* _condTable; + Array1D* _dielTable; + Array1D* _masterConductorTable; + Array1D* _masterDielectricTable; + Array1D* _varTable; + Array1D* _dataRateTable; }; } // namespace rcx diff --git a/src/rcx/include/rcx/gseq.h b/src/rcx/include/rcx/gseq.h index 5236000b8b6..59a2bc8ba66 100644 --- a/src/rcx/include/rcx/gseq.h +++ b/src/rcx/include/rcx/gseq.h @@ -68,7 +68,7 @@ class gs int* ur, uint order, uint plane, - odb::Ath__array1D* array); + odb::Array1D* array); void release(SEQ* s); diff --git a/src/rcx/src/box.h b/src/rcx/src/box.h index 3d0cbf04622..991402450a2 100644 --- a/src/rcx/src/box.h +++ b/src/rcx/src/box.h @@ -41,11 +41,9 @@ namespace rcx { using uint = unsigned int; -bool Ath__intersect(int X1, int DX, int x1, int dx, int* ix1, int* ix2); - // TODO center line with width and length and direction -class Ath__box +class Box { public: uint _layer : 4; @@ -57,23 +55,23 @@ class Ath__box int _ylo; int _xhi; int _yhi; - Ath__box* _next; + Box* _next; public: - Ath__box(); + Box(); uint getDir(); int getYhi(int bound); int getXhi(int bound); int getXlo(int bound); int getYlo(int bound); uint getWidth(uint* dir); - Ath__box(int x1, int y1, int x2, int y2, uint units = 1); + Box(int x1, int y1, int x2, int y2, uint units = 1); void set(int x1, int y1, int x2, int y2, uint units = 1); uint getDX(); uint getDY(); uint getLength(); void invalidateBox(); - void set(Ath__box* bb); + void set(Box* bb); bool outside(int x1, int y1, int x2, int y2); uint getOwner(); }; diff --git a/src/rcx/src/dbUtil.cpp b/src/rcx/src/dbUtil.cpp index 100c59c53f2..9349663e982 100644 --- a/src/rcx/src/dbUtil.cpp +++ b/src/rcx/src/dbUtil.cpp @@ -32,7 +32,6 @@ #include "rcx/dbUtil.h" -#include "odb/array1.h" #include "odb/db.h" #include "odb/dbShape.h" #include "odb/dbWireCodec.h" @@ -40,7 +39,6 @@ namespace rcx { -using odb::Ath__array1D; using odb::dbBPin; using odb::dbIntProperty; using odb::dbIoType; diff --git a/src/rcx/src/ext.cpp b/src/rcx/src/ext.cpp index eb4f1f389c2..96001c1f8f5 100644 --- a/src/rcx/src/ext.cpp +++ b/src/rcx/src/ext.cpp @@ -113,7 +113,7 @@ void Ext::bench_wires(const BenchWiresOptions& bwo) opt._underMet = 0; } - Ath__parser parser(logger_); + Parser parser(logger_); std::string th_list(bwo.th_list); std::string w_list(bwo.w_list); @@ -315,7 +315,7 @@ void Ext::read_spef(ReadSpefOpts& opt) bool stampWire = opt.stamp_wire; uint testParsing = opt.test_parsing; - Ath__parser parser(logger_); + Parser parser(logger_); char* filename = (char*) opt.file; if (!filename || !filename[0]) { logger_->error(RCX, 2, "Filename is not defined!"); @@ -370,7 +370,7 @@ void Ext::diff_spef(const DiffOptions& opt) } logger_->info(RCX, 19, "diffing spef {}", opt.file); - Ath__parser parser(logger_); + Parser parser(logger_); parser.mkWords(opt.file); _ext->readSPEF(parser.get(0), @@ -422,7 +422,7 @@ void Ext::calibrate(const std::string& spef_file, "filename using -spef_file"); } logger_->info(RCX, 21, "calibrate on spef file {}", spef_file.c_str()); - Ath__parser parser(logger_); + Parser parser(logger_); parser.mkWords((char*) spef_file.c_str()); _ext->calibrate(parser.get(0), m_map, diff --git a/src/rcx/src/extBench.cpp b/src/rcx/src/extBench.cpp index 5dc45ef6345..bb9ecf2c905 100644 --- a/src/rcx/src/extBench.cpp +++ b/src/rcx/src/extBench.cpp @@ -140,10 +140,10 @@ uint extRCModel::benchWithVar_density(extMainOptions* opt, extMeasure* measure) uint extRCModel::benchWithVar_lists(extMainOptions* opt, extMeasure* measure) { - Ath__array1D* wTable = &opt->_widthTable; - Ath__array1D* sTable = &opt->_spaceTable; - Ath__array1D* thTable = &opt->_thicknessTable; - Ath__array1D* gTable = &opt->_gridTable; + Array1D* wTable = &opt->_widthTable; + Array1D* sTable = &opt->_spaceTable; + Array1D* thTable = &opt->_thicknessTable; + Array1D* gTable = &opt->_gridTable; uint cnt = 0; int met = measure->_met; diff --git a/src/rcx/src/extBenchDB.cpp b/src/rcx/src/extBenchDB.cpp index f490bd6c7ba..9f8b3f9625d 100644 --- a/src/rcx/src/extBenchDB.cpp +++ b/src/rcx/src/extBenchDB.cpp @@ -87,8 +87,8 @@ uint extMain::genExtRules(const char* rulesFileName, int pattern) sprintf(buff, "%s.log", rulesFileName); FILE* logFP = fopen(buff, "w"); - Ath__parser* p = new Ath__parser(logger_); - Ath__parser* w = new Ath__parser(logger_); + Parser* p = new Parser(logger_); + Parser* w = new Parser(logger_); int prev_sep = 0; int prev_width = 0; @@ -386,11 +386,11 @@ uint extMain::benchVerilog_assign(FILE* fp) uint extRCModel::benchDB_WS(extMainOptions* opt, extMeasure* measure) { - Ath__array1D* widthTable = new Ath__array1D(4); - Ath__array1D* spaceTable = new Ath__array1D(4); - Ath__array1D* wTable = &opt->_widthTable; - Ath__array1D* sTable = &opt->_spaceTable; - Ath__array1D* gTable = &opt->_gridTable; + Array1D* widthTable = new Array1D(4); + Array1D* spaceTable = new Array1D(4); + Array1D* wTable = &opt->_widthTable; + Array1D* sTable = &opt->_spaceTable; + Array1D* gTable = &opt->_gridTable; uint cnt = 0; int met = measure->_met; diff --git a/src/rcx/src/extCC.cpp b/src/rcx/src/extCC.cpp index 9c21ef1974e..a7d64472ed1 100644 --- a/src/rcx/src/extCC.cpp +++ b/src/rcx/src/extCC.cpp @@ -43,14 +43,14 @@ namespace rcx { static uint ttttGetDgOverlap; -uint Ath__track::trackContextOn(int orig, - int end, - int base, - int width, - uint firstContextTrack, - Ath__array1D* context) +uint Track::trackContextOn(int orig, + int end, + int base, + int width, + uint firstContextTrack, + Array1D* context) { - Ath__wire* swire = getTargetWire(); + Wire* swire = getTargetWire(); if (!swire) { return 0; } @@ -72,15 +72,15 @@ uint Ath__track::trackContextOn(int orig, return p2 - p1; } -void Ath__grid::gridContextOn(int orig, int len, int base, int width) +void Grid::gridContextOn(int orig, int len, int base, int width) { - Ath__array1D* context = _gridtable->contextArray()[_level]; + Array1D* context = _gridtable->contextArray()[_level]; context->resetCnt(0); context->add(orig); int end = orig + len; uint lowTrack = getMinMaxTrackNum(orig); uint hiTrack = getMinMaxTrackNum(orig + len); - Ath__track *track, *btrack; + Track *track, *btrack; uint jj; uint firstContextTrack = 1; bool tohi = _gridtable->targetHighTracks() > 0 ? true : false; @@ -98,7 +98,7 @@ void Ath__grid::gridContextOn(int orig, int len, int base, int width) context->add(end); } -void Ath__grid::contextsOn(int orig, int len, int base, int width) +void Grid::contextsOn(int orig, int len, int base, int width) { uint sdepth = _gridtable->contextDepth(); if (sdepth == 0) { @@ -116,19 +116,19 @@ void Ath__grid::contextsOn(int orig, int len, int base, int width) // Extraction Coupling Caps -uint Ath__track::findOverlap(Ath__wire* origWire, - uint ccThreshold, - Ath__array1D* wTable, - Ath__array1D* nwTable, - Ath__grid* ccGrid, - Ath__array1D* ccTable, - uint met, - rcx::CoupleAndCompute coupleAndCompute, - void* compPtr) +uint Track::findOverlap(Wire* origWire, + uint ccThreshold, + Array1D* wTable, + Array1D* nwTable, + Grid* ccGrid, + Array1D* ccTable, + uint met, + rcx::CoupleAndCompute coupleAndCompute, + void* compPtr) { rcx::CoupleOptions coupleOptions{}; - AthPool* wirePool = _grid->getWirePoolPtr(); + AthPool* wirePool = _grid->getWirePoolPtr(); uint NoPowerTarget = _grid->getGridTable()->noPowerTarget(); bool srcMarked = origWire->getNet()->isMarked(); @@ -137,7 +137,7 @@ uint Ath__track::findOverlap(Ath__wire* origWire, bool needMarkedNetW2 = !allNet && TargetHighMarkedNet && !srcMarked; int TTTnoInNetCC = 0; int len1, len2, len3, rc; - Ath__wire* w2 = getTargetWire(); + Wire* w2 = getTargetWire(); bool targetHiTrack = _grid->getGridTable()->targetHighTracks() > 0 ? true : false; bool targetReversed = _grid->getGridTable()->targetTrackReversed(); @@ -148,7 +148,7 @@ uint Ath__track::findOverlap(Ath__wire* origWire, bool notExtractedW2; int exid; for (uint ii = 0; ii < last; ii++) { - Ath__wire* w1 = wTable->get(ii); + Wire* w1 = wTable->get(ii); if (w2 == nullptr) { nwTable->add(w1); @@ -180,10 +180,10 @@ uint Ath__track::findOverlap(Ath__wire* origWire, if (inThreshold == true && rc == 0) { if (len1 > 0) { // create empty wire and ADD on emptyTable! - Ath__wire* newEmptyWire = origWire->makeWire(wirePool, w1->_xy, len1); + Wire* newEmptyWire = origWire->makeWire(wirePool, w1->_xy, len1); nwTable->add(newEmptyWire); } - Ath__wire* wtwo = w2->_srcId ? _grid->getWirePtr(w2->_srcId) : w2; + Wire* wtwo = w2->_srcId ? _grid->getWirePtr(w2->_srcId) : w2; // create cc and ADD on ccTable if (!notExtractedW2 && len2 > 0 && !skipCCgen && (!TTTnoInNetCC || wtwo->isPower() || origWire->isPower() @@ -191,13 +191,12 @@ uint Ath__track::findOverlap(Ath__wire* origWire, && (!targetReversed || wtwo->isPower() || !wtwo->getNet()->isMarked())) { if (coupleAndCompute == nullptr) { - Ath__wire* ovWire - = origWire->makeCoupleWire(ccGrid->getWirePoolPtr(), - targetHiTrack, - wtwo, - w1->_xy + len1, - len2, - ccGrid->defaultWireType()); + Wire* ovWire = origWire->makeCoupleWire(ccGrid->getWirePoolPtr(), + targetHiTrack, + wtwo, + w1->_xy + len1, + len2, + ccGrid->defaultWireType()); if (ovWire == nullptr) { _grid->getGridTable()->incrCCshorts(); @@ -207,8 +206,8 @@ uint Ath__track::findOverlap(Ath__wire* origWire, ovWire->_flags = ccGrid->defaultWireType(); } } else { - Ath__wire* topwire = targetHiTrack ? wtwo : origWire; - Ath__wire* botwire = targetHiTrack ? origWire : wtwo; + Wire* topwire = targetHiTrack ? wtwo : origWire; + Wire* botwire = targetHiTrack ? origWire : wtwo; int dist = topwire->_base - (botwire->_base + botwire->_width); if (dist > 0) { @@ -292,13 +291,13 @@ uint Ath__track::findOverlap(Ath__wire* origWire, return nwTable->getCnt(); } -uint Ath__track::initTargetTracks(uint srcTrack, uint trackDist, bool tohi) +uint Track::initTargetTracks(uint srcTrack, uint trackDist, bool tohi) { uint delt = 0; uint trackFound = 0; bool noPowerTarget = _grid->getGridTable()->noPowerTarget() > 0 ? true : false; - Ath__track* tstrack = this; + Track* tstrack = this; while (nextSubTrackInRange(tstrack, delt, trackDist, srcTrack, tohi)) { tstrack->initTargetWire(noPowerTarget); trackFound = 1; @@ -306,12 +305,12 @@ uint Ath__track::initTargetTracks(uint srcTrack, uint trackDist, bool tohi) return trackFound; } -Ath__track* Ath__track::nextTrackInRange(uint& delt, - uint trackDist, - uint srcTrack, - bool tohi) +Track* Track::nextTrackInRange(uint& delt, + uint trackDist, + uint srcTrack, + bool tohi) { - Ath__track* ttrack = nullptr; + Track* ttrack = nullptr; uint tgtTnum; while (ttrack == nullptr) { delt++; @@ -327,17 +326,17 @@ Ath__track* Ath__track::nextTrackInRange(uint& delt, return ttrack; } -int Ath__track::nextSubTrackInRange(Ath__track*& tstrack, - uint& delt, - uint trackDist, - uint srcTrack, - bool tohi) +int Track::nextSubTrackInRange(Track*& tstrack, + uint& delt, + uint trackDist, + uint srcTrack, + bool tohi) { tstrack = getNextSubTrack(tstrack, tohi); if (tstrack) { return 1; } - Ath__track* ttrack = nextTrackInRange(delt, trackDist, srcTrack, tohi); + Track* ttrack = nextTrackInRange(delt, trackDist, srcTrack, tohi); if (ttrack == nullptr) { return 0; } @@ -345,34 +344,34 @@ int Ath__track::nextSubTrackInRange(Ath__track*& tstrack, return 1; } -uint Ath__track::couplingCaps(Ath__grid* ccGrid, - uint srcTrack, - uint trackDist, - uint ccThreshold, - Ath__array1D* ccIdTable, - uint met, - CoupleAndCompute coupleAndCompute, - void* compPtr) +uint Track::couplingCaps(Grid* ccGrid, + uint srcTrack, + uint trackDist, + uint ccThreshold, + Array1D* ccIdTable, + uint met, + CoupleAndCompute coupleAndCompute, + void* compPtr) { - Ath__track* tstrack; + Track* tstrack; bool tohi = _grid->getGridTable()->targetHighTracks() > 0 ? true : false; initTargetTracks(srcTrack, trackDist, tohi); uint dir = _grid->getDir(); rcx::CoupleOptions coupleOptions{}; - Ath__array1D w1Table; - Ath__array1D w2Table; - Ath__array1D*wTable, *nwTable, *twTable; - Ath__array1D ccTable; + Array1D w1Table; + Array1D w2Table; + Array1D*wTable, *nwTable, *twTable; + Array1D ccTable; bool useDbSdb = _grid->getGridTable()->usingDbSdb(); int noPowerSource = _grid->getGridTable()->noPowerSource(); uint TargetHighMarkedNet = _grid->getGridTable()->targetHighMarkedNet(); bool allNet = _grid->getGridTable()->allNet(); - AthPool* wirePool = _grid->getWirePoolPtr(); + AthPool* wirePool = _grid->getWirePoolPtr(); uint wireCnt = 0; - Ath__wire* origWire = nullptr; + Wire* origWire = nullptr; uint delt; int exid; @@ -383,9 +382,9 @@ uint Ath__track::couplingCaps(Ath__grid* ccGrid, coupleAndCompute(coupleOptions, compPtr); } int nexy, nelen; - Ath__wire* wire = nullptr; - Ath__wire* pwire = nullptr; - Ath__wire* nwire = getNextWire(wire); + Wire* wire = nullptr; + Wire* pwire = nullptr; + Wire* nwire = getNextWire(wire); for (wire = nwire; wire; pwire = wire, wire = nwire) { nwire = getNextWire(wire); if (!wire->isPower() && nwire && nwire->isPower() @@ -445,7 +444,7 @@ uint Ath__track::couplingCaps(Ath__grid* ccGrid, if (nelen <= 0) { // or nelen < wire->_width continue; } - Ath__wire* newEmptyWire = wire->makeWire(wirePool, nexy, nelen); + Wire* newEmptyWire = wire->makeWire(wirePool, nexy, nelen); wTable->add(newEmptyWire); delt = 0; @@ -477,7 +476,7 @@ uint Ath__track::couplingCaps(Ath__grid* ccGrid, int wBoxId = 0; for (uint kk = 0; kk < wTable->getCnt(); kk++) { - Ath__wire* empty = wTable->get(kk); + Wire* empty = wTable->get(kk); coupleOptions[0] = met; @@ -530,18 +529,18 @@ uint Ath__track::couplingCaps(Ath__grid* ccGrid, } if (coupleAndCompute == nullptr) { for (uint kk = 0; kk < ccTable.getCnt(); kk++) { - Ath__wire* v = ccTable.get(kk); + Wire* v = ccTable.get(kk); ccIdTable->add(v->_id); } } return wireCnt; } -uint Ath__grid::couplingCaps(Ath__grid* resGrid, - uint couplingDist, - Ath__array1D* ccTable, - rcx::CoupleAndCompute coupleAndCompute, - void* compPtr) +uint Grid::couplingCaps(Grid* resGrid, + uint couplingDist, + Array1D* ccTable, + rcx::CoupleAndCompute coupleAndCompute, + void* compPtr) { uint coupleTrackNum = couplingDist; // EXT-OPTIMIZE uint ccThreshold = coupleTrackNum * _pitch; @@ -553,7 +552,7 @@ uint Ath__grid::couplingCaps(Ath__grid* resGrid, setSearchDomain(domainAdjust); uint cnt = 0; for (uint ii = _searchLowTrack; ii <= _searchHiTrack; ii++) { - Ath__track* btrack = _trackTable[ii]; + Track* btrack = _trackTable[ii]; if (btrack == nullptr) { continue; } @@ -564,7 +563,7 @@ uint Ath__grid::couplingCaps(Ath__grid* resGrid, coupleAndCompute(rcx::coupleOptionsNull, compPtr); // try print dgContext } - Ath__track* track = nullptr; + Track* track = nullptr; bool tohi = true; while ((track = btrack->getNextSubTrack(track, tohi))) { _gridtable->setHandleEmptyOnly(false); @@ -597,7 +596,7 @@ uint Ath__grid::couplingCaps(Ath__grid* resGrid, return cnt; } -void Ath__gridTable::setDefaultWireType(uint v) +void GridTable::setDefaultWireType(uint v) { for (uint ii = 0; ii < _rowCnt; ii++) { for (uint jj = 0; jj < _colCnt; jj++) { @@ -610,11 +609,11 @@ void Ath__gridTable::setDefaultWireType(uint v) } } -void Ath__track::getTrackWires(std::vector& ctxwire) +void Track::getTrackWires(std::vector& ctxwire) { uint midx; - Ath__wire* wire; - Ath__wire* srcwire; + Wire* wire; + Wire* srcwire; for (midx = 0; midx < _markerCnt; midx++) { wire = _marker[midx]; while (wire) { @@ -631,20 +630,20 @@ void Ath__track::getTrackWires(std::vector& ctxwire) class compareAthWire { public: - bool operator()(Ath__wire* wire1, Ath__wire* wire2) + bool operator()(Wire* wire1, Wire* wire2) { return (wire1->getXY() < wire2->getXY() ? true : false); } }; // FIXME MATT -void Ath__track::buildDgContext(Ath__array1D* dgContext, - Ath__wire**& allWire, - int& awcnt, - int& awsize) +void Track::buildDgContext(Array1D* dgContext, + Wire**& allWire, + int& awcnt, + int& awsize) { - std::vector ctxwire; - Ath__track* track = nullptr; + std::vector ctxwire; + Track* track = nullptr; bool tohi = true; uint tcnt = 0; while ((track = getNextSubTrack(track, tohi))) { @@ -659,7 +658,7 @@ void Ath__track::buildDgContext(Ath__array1D* dgContext, std::sort(ctxwire.begin(), ctxwire.end(), compareAthWire()); } uint jj; - Ath__wire* nwire; + Wire* nwire; uint xidx = 0; uint yidx = 1; uint lidx, bidx; @@ -669,7 +668,7 @@ void Ath__track::buildDgContext(Ath__array1D* dgContext, for (jj = 0; jj < ctxsize; jj++) { if (awcnt == awsize) { awsize += 1024; - allWire = (Ath__wire**) realloc(allWire, sizeof(Ath__wire*) * awsize); + allWire = (Wire**) realloc(allWire, sizeof(Wire*) * awsize); } nwire = ctxwire[jj]; allWire[awcnt++] = nwire; @@ -692,13 +691,13 @@ void Ath__track::buildDgContext(Ath__array1D* dgContext, } } -void Ath__grid::buildDgContext(int gridn, int base) +void Grid::buildDgContext(int gridn, int base) { - static Ath__wire** allCtxwire = nullptr; + static Wire** allCtxwire = nullptr; static int awcnt; static int awsize; if (allCtxwire == nullptr) { - allCtxwire = (Ath__wire**) calloc(sizeof(Ath__wire*), 4096); + allCtxwire = (Wire**) calloc(sizeof(Wire*), 4096); awsize = 4096; } awcnt = 0; @@ -714,9 +713,9 @@ void Ath__grid::buildDgContext(int gridn, int base) _gridtable->dgContextHiTrack()[gridn] = hitrack; int tt; for (tt = lowtrack; tt <= hitrack; tt++) { - Ath__array1D* dgContext + Array1D* dgContext = _gridtable->renewDgContext(gridn, dgContextTrackRange + tt); - Ath__track* ttrack = _trackTable[btrackN + tt]; + Track* ttrack = _trackTable[btrackN + tt]; if (!ttrack) { continue; } @@ -730,9 +729,9 @@ void Ath__grid::buildDgContext(int gridn, int base) } } -Ath__array1D* Ath__gridTable::renewDgContext(uint gridn, uint trackn) +Array1D* GridTable::renewDgContext(uint gridn, uint trackn) { - Ath__array1D* dgContext = _dgContextArray[gridn][trackn]; + Array1D* dgContext = _dgContextArray[gridn][trackn]; for (uint ii = 0; ii < dgContext->getCnt(); ii++) { _seqPool->free(dgContext->get(ii)); } @@ -746,7 +745,7 @@ Ath__array1D* Ath__gridTable::renewDgContext(uint gridn, uint trackn) return dgContext; } -void Ath__gridTable::buildDgContext(int base, uint level, uint dir) +void GridTable::buildDgContext(int base, uint level, uint dir) { *_dgContextBaseLvl = level; *_dgContextLowLvl = (int) level - (int) *_dgContextDepth >= 1 @@ -775,11 +774,11 @@ void Ath__gridTable::buildDgContext(int base, uint level, uint dir) } } -uint Ath__gridTable::couplingCaps(Ath__gridTable* resGridTable, - uint couplingDist, - Ath__array1D* ccTable, - rcx::CoupleAndCompute coupleAndCompute, - void* compPtr) +uint GridTable::couplingCaps(GridTable* resGridTable, + uint couplingDist, + Array1D* ccTable, + rcx::CoupleAndCompute coupleAndCompute, + void* compPtr) { ttttGetDgOverlap = 1; setCCFlag(couplingDist); @@ -787,12 +786,12 @@ uint Ath__gridTable::couplingCaps(Ath__gridTable* resGridTable, uint cnt = 0; for (uint jj = 0; jj < _colCnt; jj++) { for (int ii = _rowCnt - 1; ii >= 0; ii--) { - Ath__grid* resGrid = nullptr; + Grid* resGrid = nullptr; if (resGridTable != nullptr) { resGrid = resGridTable->getGrid(ii, jj); } - Ath__grid* netGrid = _gridTable[ii][jj]; + Grid* netGrid = _gridTable[ii][jj]; if (netGrid == nullptr) { continue; } @@ -804,20 +803,20 @@ uint Ath__gridTable::couplingCaps(Ath__gridTable* resGridTable, return cnt; } -uint Ath__gridTable::couplingCaps(uint row, - uint col, - Ath__grid* resGrid, - uint couplingDist) +uint GridTable::couplingCaps(uint row, + uint col, + Grid* resGrid, + uint couplingDist) { return 0; } -int Ath__grid::couplingCaps(int hiXY, - uint couplingDist, - uint& wireCnt, - rcx::CoupleAndCompute coupleAndCompute, - void* compPtr, - int* limitArray) +int Grid::couplingCaps(int hiXY, + uint couplingDist, + uint& wireCnt, + rcx::CoupleAndCompute coupleAndCompute, + void* compPtr, + int* limitArray) { uint coupleTrackNum = couplingDist; // EXT-OPTIMIZE uint ccThreshold = coupleTrackNum * _pitch; @@ -850,7 +849,7 @@ int Ath__grid::couplingCaps(int hiXY, return baseXY; } - Ath__track* btrack = _trackTable[ii]; + Track* btrack = _trackTable[ii]; if (btrack == nullptr) { continue; } @@ -861,7 +860,7 @@ int Ath__grid::couplingCaps(int hiXY, coupleAndCompute(rcx::coupleOptionsNull, compPtr); // try print dgContext } - Ath__track* track = nullptr; + Track* track = nullptr; bool tohi = true; while ((track = btrack->getNextSubTrack(track, tohi))) { _gridtable->setHandleEmptyOnly(false); @@ -895,7 +894,7 @@ int Ath__grid::couplingCaps(int hiXY, return hiXY; } -int Ath__grid::dealloc(int hiXY) +int Grid::dealloc(int hiXY) { for (uint ii = _lastFreeTrack; ii <= _searchHiTrack; ii++) { int baseXY = _base + _pitch * ii; // TO_VERIFY for continuation of track @@ -904,12 +903,12 @@ int Ath__grid::dealloc(int hiXY) return baseXY; } - Ath__track* btrack = _trackTable[ii]; + Track* btrack = _trackTable[ii]; if (btrack == nullptr) { continue; } - Ath__track* track = nullptr; + Track* track = nullptr; bool tohi = true; while ((track = btrack->getNextSubTrack(track, tohi))) { track->dealloc(_wirePoolPtr); @@ -921,10 +920,10 @@ int Ath__grid::dealloc(int hiXY) return hiXY; } -int Ath__gridTable::dealloc(uint dir, int hiXY) +int GridTable::dealloc(uint dir, int hiXY) { for (uint jj = 1; jj < _colCnt; jj++) { - Ath__grid* netGrid = _gridTable[dir][jj]; + Grid* netGrid = _gridTable[dir][jj]; if (netGrid == nullptr) { continue; } @@ -934,11 +933,11 @@ int Ath__gridTable::dealloc(uint dir, int hiXY) return hiXY; } -int Ath__track::getBandWires(Ath__array1D* bandWire) +int Track::getBandWires(Array1D* bandWire) { uint midx; - Ath__wire* wire; - Ath__wire* srcwire; + Wire* wire; + Wire* srcwire; int cnt = 0; for (midx = 0; midx < _markerCnt; midx++) { wire = _marker[midx]; @@ -955,11 +954,11 @@ int Ath__track::getBandWires(Ath__array1D* bandWire) return cnt; } -int Ath__grid::getBandWires(int hiXY, - uint couplingDist, - uint& wireCnt, - Ath__array1D* bandWire, - int* limitArray) +int Grid::getBandWires(int hiXY, + uint couplingDist, + uint& wireCnt, + Array1D* bandWire, + int* limitArray) { uint coupleTrackNum = couplingDist; // EXT-OPTIMIZE uint ccThreshold = coupleTrackNum * _pitch; @@ -991,8 +990,8 @@ int Ath__grid::getBandWires(int hiXY, } int jj; bool tohi = true; - Ath__track* ttrack; - Ath__track* strack; + Track* ttrack; + Track* strack; bandWire->resetCnt(0); limitArray[0] = _lastFreeTrack; @@ -1019,21 +1018,21 @@ int Ath__grid::getBandWires(int hiXY, return baseXY; } -int Ath__gridTable::couplingCaps(int hiXY, - uint couplingDist, - uint dir, - uint& wireCnt, - rcx::CoupleAndCompute coupleAndCompute, - void* compPtr, - bool getBandWire, - int** limitArray) +int GridTable::couplingCaps(int hiXY, + uint couplingDist, + uint dir, + uint& wireCnt, + rcx::CoupleAndCompute coupleAndCompute, + void* compPtr, + bool getBandWire, + int** limitArray) { ttttGetDgOverlap = 1; setCCFlag(couplingDist); if (getBandWire) { if (_bandWire == nullptr) { - _bandWire = new Ath__array1D(4096); + _bandWire = new Array1D(4096); } } else { if (_bandWire) { @@ -1043,7 +1042,7 @@ int Ath__gridTable::couplingCaps(int hiXY, } int minExtracted = hiXY; for (uint jj = 1; jj < _colCnt; jj++) { - Ath__grid* netGrid = _gridTable[dir][jj]; + Grid* netGrid = _gridTable[dir][jj]; if (netGrid == nullptr) { continue; } @@ -1068,11 +1067,11 @@ int Ath__gridTable::couplingCaps(int hiXY, return minExtracted; } -int Ath__grid::initCouplingCapLoops(uint couplingDist, - rcx::CoupleAndCompute coupleAndCompute, - void* compPtr, - bool startSearchTrack, - int startXY) +int Grid::initCouplingCapLoops(uint couplingDist, + rcx::CoupleAndCompute coupleAndCompute, + void* compPtr, + bool startSearchTrack, + int startXY) { uint TargetHighMarkedNet = _gridtable->targetHighMarkedNet(); bool allNet = _gridtable->allNet(); @@ -1091,18 +1090,17 @@ int Ath__grid::initCouplingCapLoops(uint couplingDist, return _base + _pitch * _searchHiTrack; } -void Ath__gridTable::initCouplingCapLoops( - uint dir, - uint couplingDist, - rcx::CoupleAndCompute coupleAndCompute, - void* compPtr, - int* startXY) +void GridTable::initCouplingCapLoops(uint dir, + uint couplingDist, + rcx::CoupleAndCompute coupleAndCompute, + void* compPtr, + int* startXY) { ttttGetDgOverlap = 1; setCCFlag(couplingDist); for (uint jj = 1; jj < _colCnt; jj++) { - Ath__grid* netGrid = _gridTable[dir][jj]; + Grid* netGrid = _gridTable[dir][jj]; if (netGrid == nullptr) { continue; } diff --git a/src/rcx/src/extCoords.cpp b/src/rcx/src/extCoords.cpp index fba99a8b4e3..deaab1a01bb 100644 --- a/src/rcx/src/extCoords.cpp +++ b/src/rcx/src/extCoords.cpp @@ -39,15 +39,15 @@ namespace rcx { void extSpef::initNodeCoordTables(uint memChunk) { - _capNodeTable = new Ath__array1D(memChunk); - _xCoordTable = new Ath__array1D(memChunk); - _yCoordTable = new Ath__array1D(memChunk); - _x1CoordTable = new Ath__array1D(memChunk); - _x2CoordTable = new Ath__array1D(memChunk); - _y1CoordTable = new Ath__array1D(memChunk); - _y2CoordTable = new Ath__array1D(memChunk); - _levelTable = new Ath__array1D(memChunk); - _idTable = new Ath__array1D(16); + _capNodeTable = new Array1D(memChunk); + _xCoordTable = new Array1D(memChunk); + _yCoordTable = new Array1D(memChunk); + _x1CoordTable = new Array1D(memChunk); + _x2CoordTable = new Array1D(memChunk); + _y1CoordTable = new Array1D(memChunk); + _y2CoordTable = new Array1D(memChunk); + _levelTable = new Array1D(memChunk); + _idTable = new Array1D(16); } void extSpef::resetNodeCoordTables() @@ -140,15 +140,15 @@ int extSpef::findNodeIndexFromNodeCoords(uint targetCapNodeId) // TO OPTIMIZE namespace rcx { -void Ath__grid::dealloc() +void Grid::dealloc() { for (uint ii = 0; ii <= _searchHiTrack; ii++) { - Ath__track* btrack = _trackTable[ii]; + Track* btrack = _trackTable[ii]; if (btrack == nullptr) { continue; } - Ath__track* track = nullptr; + Track* track = nullptr; bool tohi = true; while ((track = btrack->getNextSubTrack(track, tohi))) { track->dealloc(_wirePoolPtr); @@ -158,11 +158,11 @@ void Ath__grid::dealloc() } } -void Ath__gridTable::dealloc() +void GridTable::dealloc() { for (uint dir = 0; dir < _rowCnt; dir++) { for (uint jj = 1; jj < _colCnt; jj++) { - Ath__grid* netGrid = _gridTable[dir][jj]; + Grid* netGrid = _gridTable[dir][jj]; if (netGrid == nullptr) { continue; } diff --git a/src/rcx/src/extFlow.cpp b/src/rcx/src/extFlow.cpp index e9bae029f25..1d7190790cb 100644 --- a/src/rcx/src/extFlow.cpp +++ b/src/rcx/src/extFlow.cpp @@ -80,7 +80,7 @@ uint extMain::addNetOnTable(uint netId, uint* nm_step, int* bb_ll, int* bb_ur, - Ath__array1D*** wireTable) + Array1D*** wireTable) { uint cnt = 0; int ll[2] = {maxRect->xMin(), maxRect->yMin()}; @@ -91,7 +91,7 @@ uint extMain::addNetOnTable(uint netId, for (uint ii = lo_bound; ii <= hi_bound; ii++) { if (wireTable[dir][ii] == nullptr) { - wireTable[dir][ii] = new Ath__array1D(8000); + wireTable[dir][ii] = new Array1D(8000); } wireTable[dir][ii]->add(netId); @@ -378,7 +378,7 @@ uint extMain::initSearchForNets(int* X1, } uint layerCnt = n + 1; - _search = new Ath__gridTable(&maxRect, 2, layerCnt, W, pitchTable, S, X1, Y1); + _search = new GridTable(&maxRect, 2, layerCnt, W, pitchTable, S, X1, Y1); _search->setBlock(_block); return layerCnt; } @@ -828,7 +828,7 @@ uint extMain::addSignalNets(uint dir, return cnt; } -void extMain::resetNetSpefFlag(Ath__array1D* tmpNetIdTable) +void extMain::resetNetSpefFlag(Array1D* tmpNetIdTable) { for (uint ii = 0; ii < tmpNetIdTable->getCnt(); ii++) { uint netId = tmpNetIdTable->get(ii); @@ -843,7 +843,7 @@ uint extMain::addInsts(uint dir, int* bb_ll, int* bb_ur, uint bucketSize, - Ath__array1D*** wireBinTable, + Array1D*** wireBinTable, dbCreateNetUtil* createDbNet) { uint lo_index = getBucketNum(bb_ll[dir], bb_ur[dir], bucketSize, lo_gs[dir]); @@ -892,7 +892,7 @@ uint extMain::addNets(uint dir, int* bb_ur, uint wtype, uint ptype, - Ath__array1D* sdbSignalTable) + Array1D* sdbSignalTable) { if (sdbSignalTable == nullptr) { return 0; @@ -1198,7 +1198,7 @@ uint extMain::couplingFlow(Rect& extRect, int lo_sdb[2]; int hi_sdb[2]; - Ath__overlapAdjust overlapAdj = Z_noAdjust; + OverlapAdjust overlapAdj = Z_noAdjust; _useDbSdb = true; _search->setExtControl(_block, _useDbSdb, @@ -1242,8 +1242,8 @@ uint extMain::couplingFlow(Rect& extRect, step_nm[0] = ur[0] - ll[0]; } // _use_signal_tables - Ath__array1D sdbPowerTable; - Ath__array1D tmpNetIdTable(64000); + Array1D sdbPowerTable; + Array1D tmpNetIdTable(64000); uint totalWiresExtracted = 0; diff --git a/src/rcx/src/extRCmodel.cpp b/src/rcx/src/extRCmodel.cpp index 8cc5bf43422..386e70043a7 100644 --- a/src/rcx/src/extRCmodel.cpp +++ b/src/rcx/src/extRCmodel.cpp @@ -107,7 +107,7 @@ void extDistRC::set(uint d, double cc, double fr, double a, double r) _res = r; } -void extDistRC::readRC(Ath__parser* parser, double dbFactor) +void extDistRC::readRC(Parser* parser, double dbFactor) { _sep = lround(dbFactor * 1000 * parser->getDouble(0)); _coupling = parser->getDouble(1) / dbFactor; @@ -115,7 +115,7 @@ void extDistRC::readRC(Ath__parser* parser, double dbFactor) _res = parser->getDouble(3) / dbFactor; } -void extDistRC::readRC_res2(Ath__parser* parser, double dbFactor) +void extDistRC::readRC_res2(Parser* parser, double dbFactor) { _sep = lround(dbFactor * 1000 * parser->getDouble(1)); _coupling = lround(dbFactor * 1000 * parser->getDouble(0)); @@ -165,12 +165,12 @@ void extRCTable::makeCapTableOver() _over = true; for (uint jj = 1; jj < _maxCnt1; jj++) { - _inTable[jj] = new Ath__array1D*[jj]; - _table[jj] = new Ath__array1D*[jj]; + _inTable[jj] = new Array1D*[jj]; + _table[jj] = new Array1D*[jj]; for (uint kk = 0; kk < jj; kk++) { - _inTable[jj][kk] = new Ath__array1D(32); - _table[jj][kk] = new Ath__array1D(512); + _inTable[jj][kk] = new Array1D(32); + _table[jj][kk] = new Array1D(512); } } } @@ -179,16 +179,16 @@ void extRCTable::makeCapTableUnder() { _over = false; for (uint jj = 1; jj < _maxCnt1; jj++) { - _inTable[jj] = new Ath__array1D*[_maxCnt1]; - _table[jj] = new Ath__array1D*[_maxCnt1]; + _inTable[jj] = new Array1D*[_maxCnt1]; + _table[jj] = new Array1D*[_maxCnt1]; for (uint ii = 0; ii < jj; ii++) { _inTable[jj][ii] = nullptr; _table[jj][ii] = nullptr; } for (uint kk = jj + 1; kk < _maxCnt1; kk++) { - _inTable[jj][kk] = new Ath__array1D(32); - _table[jj][kk] = new Ath__array1D(512); + _inTable[jj][kk] = new Array1D(32); + _table[jj][kk] = new Array1D(512); } } } @@ -196,7 +196,7 @@ void extRCTable::makeCapTableUnder() extDistRCTable::extDistRCTable(uint distCnt) { uint n = 16 * (distCnt / 16 + 1); - _measureTable = new Ath__array1D(n); + _measureTable = new Array1D(n); _computeTable = nullptr; } @@ -310,7 +310,7 @@ uint extDistRCTable::interpolate(uint distUnit, } uint extDistRCTable::writeRules(FILE* fp, - Ath__array1D* table, + Array1D* table, double w, bool bin) { @@ -333,7 +333,7 @@ uint extDistRCTable::writeRules(FILE* fp, } uint extDistRCTable::writeDiagRules(FILE* fp, - Ath__array1D* table, + Array1D* table, double w1, double w2, double s, @@ -376,7 +376,7 @@ uint extDistRCTable::writeDiagRules(FILE* fp, return writeDiagRules(fp, _measureTable, w1, w2, s, bin); } -uint extMetRCTable::readRCstats(Ath__parser* parser) +uint extMetRCTable::readRCstats(Parser* parser) { uint cnt = 0; @@ -458,7 +458,7 @@ uint extMetRCTable::readRCstats(Ath__parser* parser) return cnt; } -uint extDistRCTable::readRules_res2(Ath__parser* parser, +uint extDistRCTable::readRules_res2(Parser* parser, AthPool* rcPool, bool compute, bool bin, @@ -471,12 +471,12 @@ uint extDistRCTable::readRules_res2(Ath__parser* parser, cnt = 32; } - Ath__array1D* table = nullptr; + Array1D* table = nullptr; if (!ignore) { - table = new Ath__array1D(cnt); + table = new Array1D(cnt); } - Ath__array1D* table0 = new Ath__array1D(8); + Array1D* table0 = new Array1D(8); int cnt1 = 0; int kk = 0; extDistRC* rc0 = nullptr; @@ -501,7 +501,7 @@ uint extDistRCTable::readRules_res2(Ath__parser* parser, _measureTableR[kk] = table0; kk++; - table0 = new Ath__array1D(cnt1); + table0 = new Array1D(cnt1); cnt1 = 0; _maxDist = rc0->_sep; @@ -523,7 +523,7 @@ uint extDistRCTable::readRules_res2(Ath__parser* parser, return cnt; } -uint extDistRCTable::readRules(Ath__parser* parser, +uint extDistRCTable::readRules(Parser* parser, AthPool* rcPool, bool compute, bool bin, @@ -536,9 +536,9 @@ uint extDistRCTable::readRules(Ath__parser* parser, cnt = 32; } - Ath__array1D* table = nullptr; + Array1D* table = nullptr; if (!ignore) { - table = new Ath__array1D(cnt); + table = new Array1D(cnt); } while (parser->parseNextLine() > 0) { @@ -567,8 +567,7 @@ uint extDistRCTable::readRules(Ath__parser* parser, return cnt; } -void extDistRCTable::ScaleRes(double SUB_MULT_RES, - Ath__array1D* table) +void extDistRCTable::ScaleRes(double SUB_MULT_RES, Array1D* table) { uint cnt = table->getCnt(); if (cnt == 0) { @@ -597,7 +596,7 @@ void extDistRCTable::makeComputeTable(uint maxDist, uint distUnit) uint n = maxDist / distUnit; n = distUnit * (n / distUnit + 1); - _computeTable = new Ath__array1D(n + 1); + _computeTable = new Array1D(n + 1); } uint extDistRCTable::addMeasureRC(extDistRC* rc) @@ -756,7 +755,7 @@ extDistWidthRCTable::extDistWidthRCTable(bool over, _layerCnt = layerCnt; _met = met; - _widthTable = new Ath__array1D(maxWidthCnt); + _widthTable = new Array1D(maxWidthCnt); _firstWidth = 0; _lastWidth = std::numeric_limits::max(); @@ -804,7 +803,7 @@ void extDistWidthRCTable::createWidthMap() _modulo = 4; _widthTableAllocFlag = true; - _widthMapTable = new Ath__array1D(10 * widthCnt); + _widthMapTable = new Array1D(10 * widthCnt); uint jj; for (jj = 0; jj < widthCnt - 1; jj++) { @@ -850,7 +849,7 @@ extDistWidthRCTable::extDistWidthRCTable(bool dummy, _met = met; _layerCnt = layerCnt; - _widthTable = new Ath__array1D(widthCnt); + _widthTable = new Array1D(widthCnt); for (uint ii = 0; ii < widthCnt; ii++) { _widthTable->add(0); } @@ -886,7 +885,7 @@ extDistWidthRCTable::extDistWidthRCTable(bool over, uint met, uint layerCnt, uint metCnt, - Ath__array1D* widthTable, + Array1D* widthTable, AthPool* rcPool, double dbFactor) { @@ -900,7 +899,7 @@ extDistWidthRCTable::extDistWidthRCTable(bool over, } int widthCnt = widthTable->getCnt(); - _widthTable = new Ath__array1D(widthCnt); + _widthTable = new Array1D(widthCnt); for (uint ii = 0; ii < widthCnt; ii++) { int w = lround(dbFactor * 1000 * widthTable->get(ii)); _widthTable->add(w); @@ -913,7 +912,7 @@ extDistWidthRCTable::extDistWidthRCTable(bool over, _modulo = 4; _widthTableAllocFlag = true; - _widthMapTable = new Ath__array1D(10 * widthCnt); + _widthMapTable = new Array1D(10 * widthCnt); uint jj; for (jj = 0; jj < widthCnt - 1; jj++) { @@ -967,7 +966,7 @@ extDistWidthRCTable::extDistWidthRCTable(bool over, uint met, uint layerCnt, uint metCnt, - Ath__array1D* widthTable, + Array1D* widthTable, int diagWidthCnt, int diagDistCnt, AthPool* rcPool, @@ -979,29 +978,29 @@ extDistWidthRCTable::extDistWidthRCTable(bool over, _met = met; uint widthCnt = widthTable->getCnt(); - _widthTable = new Ath__array1D(widthCnt); + _widthTable = new Array1D(widthCnt); for (uint ii = 0; ii < widthCnt; ii++) { int w = lround(dbFactor * 1000 * widthTable->get(ii)); _widthTable->add(w); } for (uint i = 0; i < layerCnt; i++) { - _diagWidthTable[i] = new Ath__array1D(diagWidthCnt); - _diagDistTable[i] = new Ath__array1D(diagDistCnt); - _diagWidthMapTable[i] = new Ath__array1D(10 * diagWidthCnt); - _diagDistMapTable[i] = new Ath__array1D(10 * diagDistCnt); + _diagWidthTable[i] = new Array1D(diagWidthCnt); + _diagDistTable[i] = new Array1D(diagDistCnt); + _diagWidthMapTable[i] = new Array1D(10 * diagWidthCnt); + _diagDistMapTable[i] = new Array1D(10 * diagDistCnt); } _firstWidth = _widthTable->get(0); _lastWidth = _widthTable->get(widthCnt - 1); - _firstDiagWidth = new Ath__array1D(layerCnt); - _lastDiagWidth = new Ath__array1D(layerCnt); - _firstDiagDist = new Ath__array1D(layerCnt); - _lastDiagDist = new Ath__array1D(layerCnt); + _firstDiagWidth = new Array1D(layerCnt); + _lastDiagWidth = new Array1D(layerCnt); + _firstDiagDist = new Array1D(layerCnt); + _lastDiagDist = new Array1D(layerCnt); _modulo = 4; _widthTableAllocFlag = true; - _widthMapTable = new Ath__array1D(10 * widthCnt); + _widthMapTable = new Array1D(10 * widthCnt); uint jj; for (jj = 0; jj < widthCnt - 1; jj++) { double v1 = _widthTable->get(jj); @@ -1045,11 +1044,10 @@ extDistWidthRCTable::extDistWidthRCTable(bool over, _rc31 = rcPool->alloc(); } -void extDistWidthRCTable::setDiagUnderTables( - uint met, - Ath__array1D* diagWidthTable, - Ath__array1D* diagDistTable, - double dbFactor) +void extDistWidthRCTable::setDiagUnderTables(uint met, + Array1D* diagWidthTable, + Array1D* diagDistTable, + double dbFactor) { uint diagWidthCnt = diagWidthTable->getCnt(); _diagWidthTable[met]->resetCnt(); @@ -1254,7 +1252,7 @@ uint extDistWidthRCTable::writeRulesOver_res(FILE* fp, bool bin) return cnt; } -uint extDistWidthRCTable::readMetalHeader(Ath__parser* parser, +uint extDistWidthRCTable::readMetalHeader(Parser* parser, uint& met, const char* keyword, bool bin, @@ -1272,7 +1270,7 @@ uint extDistWidthRCTable::readMetalHeader(Ath__parser* parser, return 0; } -uint extDistWidthRCTable::readRulesOver(Ath__parser* parser, +uint extDistWidthRCTable::readRulesOver(Parser* parser, uint widthCnt, bool bin, bool ignore, @@ -1312,7 +1310,7 @@ uint extDistWidthRCTable::readRulesOver(Ath__parser* parser, return cnt; } -uint extDistWidthRCTable::readRulesUnder(Ath__parser* parser, +uint extDistWidthRCTable::readRulesUnder(Parser* parser, uint widthCnt, bool bin, bool ignore, @@ -1340,7 +1338,7 @@ uint extDistWidthRCTable::readRulesUnder(Ath__parser* parser, return cnt; } -uint extDistWidthRCTable::readRulesDiagUnder(Ath__parser* parser, +uint extDistWidthRCTable::readRulesDiagUnder(Parser* parser, uint widthCnt, uint diagWidthCnt, uint diagDistCnt, @@ -1354,8 +1352,8 @@ uint extDistWidthRCTable::readRulesDiagUnder(Ath__parser* parser, if (readMetalHeader(parser, met, "DIAGUNDER", bin, ignore) <= 0) { return 0; } - Ath__array1D* dwTable = nullptr; - Ath__array1D* ddTable = nullptr; + Array1D* dwTable = nullptr; + Array1D* ddTable = nullptr; parser->parseNextLine(); dwTable = parser->readDoubleArray("DIAG_WIDTH", 4); parser->parseNextLine(); @@ -1389,7 +1387,7 @@ uint extDistWidthRCTable::readRulesDiagUnder(Ath__parser* parser, return cnt; } -uint extDistWidthRCTable::readRulesDiagUnder(Ath__parser* parser, +uint extDistWidthRCTable::readRulesDiagUnder(Parser* parser, uint widthCnt, bool bin, bool ignore, @@ -1413,7 +1411,7 @@ uint extDistWidthRCTable::readRulesDiagUnder(Ath__parser* parser, return cnt; } -uint extDistWidthRCTable::readRulesOverUnder(Ath__parser* parser, +uint extDistWidthRCTable::readRulesOverUnder(Parser* parser, uint widthCnt, bool bin, bool ignore, @@ -1607,7 +1605,7 @@ extMetRCTable::~extMetRCTable() } void extMetRCTable::allocOverTable(uint met, - Ath__array1D* wTable, + Array1D* wTable, double dbFactor) { _capOver[met] = new extDistWidthRCTable( @@ -1617,7 +1615,7 @@ void extMetRCTable::allocOverTable(uint met, } void extMetRCTable::allocDiagUnderTable(uint met, - Ath__array1D* wTable, + Array1D* wTable, int diagWidthCnt, int diagDistCnt, double dbFactor) @@ -1635,8 +1633,8 @@ void extMetRCTable::allocDiagUnderTable(uint met, void extMetRCTable::setDiagUnderTables(uint met, uint overMet, - Ath__array1D* diagWTable, - Ath__array1D* diagSTable, + Array1D* diagWTable, + Array1D* diagSTable, double dbFactor) { _capDiagUnder[met]->setDiagUnderTables( @@ -1644,7 +1642,7 @@ void extMetRCTable::setDiagUnderTables(uint met, } void extMetRCTable::allocDiagUnderTable(uint met, - Ath__array1D* wTable, + Array1D* wTable, double dbFactor) { _capDiagUnder[met] = new extDistWidthRCTable( @@ -1652,7 +1650,7 @@ void extMetRCTable::allocDiagUnderTable(uint met, } void extMetRCTable::allocUnderTable(uint met, - Ath__array1D* wTable, + Array1D* wTable, double dbFactor) { _capUnder[met] = new extDistWidthRCTable( @@ -1660,7 +1658,7 @@ void extMetRCTable::allocUnderTable(uint met, } void extMetRCTable::allocOverUnderTable(uint met, - Ath__array1D* wTable, + Array1D* wTable, double dbFactor) { if (met < 2) { @@ -1675,8 +1673,8 @@ void extMetRCTable::allocOverUnderTable(uint met, extRCTable::extRCTable(bool over, uint layerCnt) { _maxCnt1 = layerCnt + 1; - _inTable = new Ath__array1D**[_maxCnt1]; - _table = new Ath__array1D**[_maxCnt1]; + _inTable = new Array1D**[_maxCnt1]; + _table = new Array1D**[_maxCnt1]; if (over) { makeCapTableOver(); @@ -2162,7 +2160,7 @@ extRCModel::extRCModel(uint layerCnt, const char* name, Logger* logger) _wireDirName = new char[2048]; _topDir = new char[1024]; _patternName = new char[1024]; - _parser = new Ath__parser(logger_); + _parser = new Parser(logger_); _solverFileName = new char[1024]; _wireFileName = new char[1024]; _capLogFP = nullptr; @@ -2199,7 +2197,7 @@ extRCModel::extRCModel(const char* name, Logger* logger) _wireDirName = new char[2048]; _topDir = new char[1024]; _patternName = new char[1024]; - _parser = new Ath__parser(logger_); + _parser = new Parser(logger_); _solverFileName = new char[1024]; _wireFileName = new char[1024]; _capLogFP = nullptr; @@ -2267,7 +2265,7 @@ void extRCModel::createModelTable(uint n, uint layerCnt) _layerCnt = layerCnt; _modelCnt = n; - _dataRateTable = new Ath__array1D(_modelCnt); + _dataRateTable = new Array1D(_modelCnt); _modelTable = new extMetRCTable*[_modelCnt]; for (uint jj = 0; jj < _modelCnt; jj++) { _modelTable[jj] = new extMetRCTable(_layerCnt, _rcPoolPtr, logger_); @@ -2284,7 +2282,7 @@ void extRCModel::setDataRateTable(uint met) extVariation* xvar = _process->getVariation(met); if (xvar != nullptr) { - Ath__array1D* dTable = xvar->getDataRateTable(); + Array1D* dTable = xvar->getDataRateTable(); createModelTable(dTable->getCnt() + 1, _layerCnt); @@ -2299,7 +2297,7 @@ void extRCModel::setDataRateTable(uint met) _dataRateTable->add(i); } } else if (thickVarFlag) { - Ath__array1D* dTable = _process->getDataRateTable(1); + Array1D* dTable = _process->getDataRateTable(1); createModelTable(dTable->getCnt(), _layerCnt); for (uint ii = 0; ii < dTable->getCnt(); ii++) { _dataRateTable->add(dTable->get(ii)); @@ -2398,13 +2396,13 @@ extMeasure::extMeasure(utl::Logger* logger) _totSignalSegCnt = 0; _totSegCnt = 0; - _tmpDstTable = new Ath__array1D(32); - _tmpSrcTable = new Ath__array1D(32); - _diagTable = new Ath__array1D(32); - _tmpTable = new Ath__array1D(32); - _ouTable = new Ath__array1D(32); - _overTable = new Ath__array1D(32); - _underTable = new Ath__array1D(32); + _tmpDstTable = new Array1D(32); + _tmpSrcTable = new Array1D(32); + _diagTable = new Array1D(32); + _tmpTable = new Array1D(32); + _ouTable = new Array1D(32); + _overTable = new Array1D(32); + _underTable = new Array1D(32); _seqPool = new AthPool(1024); @@ -2417,7 +2415,7 @@ extMeasure::extMeasure(utl::Logger* logger) void extMeasure::allocOUpool() { _lenOUPool = new AthPool(128); - _lenOUtable = new Ath__array1D(128); + _lenOUtable = new Array1D(128); } extMeasure::~extMeasure() @@ -2794,7 +2792,7 @@ uint extRCModel::readCapacitanceBench(bool readCapLog, extMeasure* m) _parser->setInputFP(solverFP); } - Ath__parser wParser(logger_); + Parser wParser(logger_); bool matrixFlag = false; /* @@ -2884,7 +2882,7 @@ uint extRCModel::readCapacitanceBenchDiag(bool readCapLog, extMeasure* m) _parser->setInputFP(solverFP); } - Ath__parser wParser(logger_); + Parser wParser(logger_); bool matrixFlag = false; uint cnt = 0; @@ -3691,7 +3689,7 @@ void extRCModel::writeRules(char* name, bool binary) fclose(fp); } -uint extRCModel::readMetalHeader(Ath__parser* parser, +uint extRCModel::readMetalHeader(Parser* parser, uint& met, const char* keyword, bool bin, @@ -3743,12 +3741,12 @@ void extMetRCTable::allocateInitialTables(uint layerCnt, } } -Ath__array1D* extRCModel::readHeaderAndWidth(Ath__parser* parser, - uint& met, - const char* ouKey, - const char* wKey, - bool bin, - bool ignore) +Array1D* extRCModel::readHeaderAndWidth(Parser* parser, + uint& met, + const char* ouKey, + const char* wKey, + bool bin, + bool ignore) { if (readMetalHeader(parser, met, ouKey, bin, ignore) <= 0) { return nullptr; @@ -3761,7 +3759,7 @@ Ath__array1D* extRCModel::readHeaderAndWidth(Ath__parser* parser, return parser->readDoubleArray("WIDTH", 4); } -uint extRCModel::readRules(Ath__parser* parser, +uint extRCModel::readRules(Parser* parser, uint m, uint ii, const char* ouKey, @@ -3775,7 +3773,7 @@ uint extRCModel::readRules(Ath__parser* parser, { uint cnt = 0; uint met = 0; - Ath__array1D* wTable + Array1D* wTable = readHeaderAndWidth(parser, met, ouKey, wKey, bin, false); if (wTable == nullptr) { @@ -3878,7 +3876,7 @@ bool extRCModel::readRules(char* name, OUREVERSEORDER = false; diag = false; _ruleFileName = strdup(name); - Ath__parser parser(logger_); + Parser parser(logger_); parser.addSeparator("\r"); parser.openFile(name); while (parser.parseNextLine() > 0) { @@ -4212,8 +4210,8 @@ void extRCModel::printCommentLine(char commentChar, extMeasure* m) void extRCModel::getDiagTables(extMeasure* m, uint widthCnt, uint spaceCnt) { - Ath__array1D* diagSTable0 = nullptr; - Ath__array1D* diagWTable0 = nullptr; + Array1D* diagSTable0 = nullptr; + Array1D* diagWTable0 = nullptr; diagSTable0 = _process->getDiagSpaceTable(m->_overMet); diagWTable0 = _process->getWidthTable(m->_overMet); m->_diagWidthTable0.resetCnt(); @@ -4249,14 +4247,14 @@ void extRCModel::computeTables(extMeasure* m, m->_thickVarFlag = _process->getThickVarFlag(); - Ath__array1D* wTable = nullptr; - Ath__array1D* sTable = nullptr; - Ath__array1D* dTable = nullptr; - Ath__array1D* pTable = nullptr; - Ath__array1D* wTable0 = nullptr; - Ath__array1D* sTable0 = nullptr; - Ath__array1D* diagSTable0 = nullptr; - Ath__array1D* diagWTable0 = nullptr; + Array1D* wTable = nullptr; + Array1D* sTable = nullptr; + Array1D* dTable = nullptr; + Array1D* pTable = nullptr; + Array1D* wTable0 = nullptr; + Array1D* sTable0 = nullptr; + Array1D* diagSTable0 = nullptr; + Array1D* diagWTable0 = nullptr; if (xvar != nullptr) { wTable = xvar->getWidthTable(); sTable = xvar->getSpaceTable(); diff --git a/src/rcx/src/extSpef.cpp b/src/rcx/src/extSpef.cpp index 384841b4e8d..3b1e70aeaed 100644 --- a/src/rcx/src/extSpef.cpp +++ b/src/rcx/src/extSpef.cpp @@ -73,13 +73,13 @@ extSpef::extSpef(odb::dbTech* tech, _design[0] = '\0'; // for ABNORMAL and sparse map numbers should be a hash table - _idMapTable = new Ath__array1D(128000); + _idMapTable = new Array1D(128000); - _srsegi = new Ath__array1D(1024); - _nrseg = new Ath__array1D(1024); - _hcnrc = new Ath__array1D*>(1024); + _srsegi = new Array1D(1024); + _nrseg = new Array1D(1024); + _hcnrc = new Array1D*>(1024); for (uint ii = 0; ii < 1024; ii++) { - Ath__array1D* n1d = new Ath__array1D(4); + Array1D* n1d = new Array1D(4); _hcnrc->set(ii, n1d); } @@ -140,7 +140,7 @@ void extSpef::setupMappingForWrite(uint btermCnt, uint itermCnt) if (_btermTable) { resetTermTables(); if (!_nodeCapTable) { - _nodeCapTable = new Ath__array1D(16000); + _nodeCapTable = new Array1D(16000); initCapTable(_nodeCapTable); } return; @@ -156,15 +156,15 @@ void extSpef::setupMappingForWrite(uint btermCnt, uint itermCnt) itermCnt = 64000; } - _btermTable = new Ath__array1D(btermCnt); - _itermTable = new Ath__array1D(itermCnt); + _btermTable = new Array1D(btermCnt); + _itermTable = new Array1D(itermCnt); _btermTable->add(0); _itermTable->add(0); - _btermCapTable = new Ath__array1D(btermCnt); - _itermCapTable = new Ath__array1D(itermCnt); - _nodeCapTable = new Ath__array1D(16000); + _btermCapTable = new Array1D(btermCnt); + _itermCapTable = new Array1D(itermCnt); + _nodeCapTable = new Array1D(16000); initCapTable(_btermCapTable); initCapTable(_itermCapTable); @@ -229,7 +229,7 @@ void extSpef::resetCapTables(const uint maxNode) reinitCapTable(_btermCapTable, _btermTable->getCnt() + 1); } -void extSpef::initCapTable(Ath__array1D* table) +void extSpef::initCapTable(Array1D* table) { for (uint ii = 0; ii < table->getSize(); ii++) { double* a = new double[_cornerCnt]; @@ -237,7 +237,7 @@ void extSpef::initCapTable(Ath__array1D* table) } } -void extSpef::deleteTableCap(Ath__array1D* table) +void extSpef::deleteTableCap(Array1D* table) { for (uint ii = 0; ii < table->getSize(); ii++) { double* a = table->geti(ii); @@ -245,7 +245,7 @@ void extSpef::deleteTableCap(Ath__array1D* table) } } -void extSpef::reinitCapTable(Ath__array1D* table, const uint n) +void extSpef::reinitCapTable(Array1D* table, const uint n) { if (n > table->getSize()) { const uint prevCnt = table->getSize(); @@ -1223,8 +1223,8 @@ bool extSpef::setInSpef(const char* filename, const bool onlyOpen) strcpy(_inFile, filename); if (!onlyOpen) { - _nodeParser = new Ath__parser(logger_); - _parser = new Ath__parser(logger_); + _nodeParser = new Parser(logger_); + _parser = new Parser(logger_); } _parser->openFile(filename); diff --git a/src/rcx/src/extSpefIn.cpp b/src/rcx/src/extSpefIn.cpp index 31b3817939d..03828edd0d8 100644 --- a/src/rcx/src/extSpefIn.cpp +++ b/src/rcx/src/extSpefIn.cpp @@ -1519,7 +1519,7 @@ uint extSpef::sortRSegs() _hcnrc->resize(ncsz); ncsz = _hcnrc->getSize(); for (int ii = ocsz; ii < ncsz; ii++) { - Ath__array1D* n1d = new Ath__array1D(4); + Array1D* n1d = new Array1D(4); _hcnrc->set(ii, n1d); } } @@ -1550,7 +1550,7 @@ uint extSpef::sortRSegs() _d_corner_net->setRCDisconnected(true); return 0; } - Ath__array1D* tcnrc; + Array1D* tcnrc; int hcnii; int cntTcn; int scns[2000]; @@ -2132,14 +2132,14 @@ void extSpef::setupMapping(uint itermCnt) btermCnt = 512; itermCnt = 64000; } - _btermTable = new Ath__array1D(btermCnt); - _itermTable = new Ath__array1D(itermCnt); - _nodeTable = new Ath__array1D(16000); + _btermTable = new Array1D(btermCnt); + _itermTable = new Array1D(itermCnt); + _nodeTable = new Array1D(16000); } void extSpef::resetNameTable(const uint n) { - _nameMapTable = new Ath__array1D(128000); + _nameMapTable = new Array1D(128000); _nameMapTable->resize(n); _lastNameMapIndex = 0; } @@ -2339,7 +2339,7 @@ uint extSpef::readBlock(const uint debug, } _readingNodeCoordsInput = _readingNodeCoords; if (_readingNodeCoords != C_NONE && _nodeCoordParser == nullptr) { - _nodeCoordParser = new Ath__parser(logger_); + _nodeCoordParser = new Parser(logger_); } if (capStatsFile != nullptr) { _capStatsFP = fopen(capStatsFile, "w"); @@ -2515,7 +2515,7 @@ uint extSpef::readBlock(const uint debug, _cc_app_print_limit = app_print_limit; if (_cc_app_print_limit) { - _ccidmap = new Ath__array1D(8000000); + _ccidmap = new Array1D(8000000); } uint cnt = 0; bool rc; diff --git a/src/rcx/src/extmain.cpp b/src/rcx/src/extmain.cpp index 01d189d4105..b954c19821f 100644 --- a/src/rcx/src/extmain.cpp +++ b/src/rcx/src/extmain.cpp @@ -125,14 +125,14 @@ void extMain::setupMapping(uint itermCnt) btermCnt = 512; itermCnt = 64000; } - _btermTable = new Ath__array1D(btermCnt); - _itermTable = new Ath__array1D(itermCnt); - _nodeTable = new Ath__array1D(16000); + _btermTable = new Array1D(btermCnt); + _itermTable = new Array1D(itermCnt); + _nodeTable = new Array1D(16000); } extMain::extMain() { - _modelTable = new Ath__array1D(8); + _modelTable = new Array1D(8); } extMain::~extMain() @@ -144,7 +144,7 @@ void extMain::initDgContextArray() { _dgContextDepth = 3; _dgContextPlanes = _dgContextDepth * 2 + 1; - _dgContextArray = new Ath__array1D**[_dgContextPlanes]; + _dgContextArray = new Array1D**[_dgContextPlanes]; _dgContextBaseTrack = new uint[_dgContextPlanes]; _dgContextLowTrack = new int[_dgContextPlanes]; _dgContextHiTrack = new int[_dgContextPlanes]; @@ -156,9 +156,9 @@ void extMain::initDgContextArray() } for (uint jj = 0; jj < _dgContextPlanes; jj++) { _dgContextTrackBase[jj] = new int[1024]; - _dgContextArray[jj] = new Ath__array1D*[_dgContextTracks]; + _dgContextArray[jj] = new Array1D*[_dgContextTracks]; for (uint tt = 0; tt < _dgContextTracks; tt++) { - _dgContextArray[jj][tt] = new Ath__array1D(1024); + _dgContextArray[jj][tt] = new Array1D(1024); } } } @@ -189,16 +189,16 @@ void extMain::initContextArray() return; } uint layerCnt = getExtLayerCnt(_tech); - _ccContextArray = new Ath__array1D*[layerCnt + 1]; + _ccContextArray = new Array1D*[layerCnt + 1]; _ccContextArray[0] = nullptr; uint ii; for (ii = 1; ii <= layerCnt; ii++) { - _ccContextArray[ii] = new Ath__array1D(1024); + _ccContextArray[ii] = new Array1D(1024); } - _ccMergedContextArray = new Ath__array1D*[layerCnt + 1]; + _ccMergedContextArray = new Array1D*[layerCnt + 1]; _ccMergedContextArray[0] = nullptr; for (ii = 1; ii <= layerCnt; ii++) { - _ccMergedContextArray[ii] = new Ath__array1D(1024); + _ccMergedContextArray[ii] = new Array1D(1024); } } diff --git a/src/rcx/src/extmeasure.cpp b/src/rcx/src/extmeasure.cpp index 05b1c7112ce..c330513b35e 100644 --- a/src/rcx/src/extmeasure.cpp +++ b/src/rcx/src/extmeasure.cpp @@ -512,22 +512,22 @@ uint extMeasure::defineBox(CoupleOptions& options) return _len; } -void extMeasure::tableCopyP(Ath__array1D* src, Ath__array1D* dst) +void extMeasure::tableCopyP(Array1D* src, Array1D* dst) { for (uint ii = 0; ii < src->getCnt(); ii++) { dst->add(src->get(ii)); } } -void extMeasure::tableCopyP(Ath__array1D* src, Ath__array1D* dst) +void extMeasure::tableCopyP(Array1D* src, Array1D* dst) { for (uint ii = 0; ii < src->getCnt(); ii++) { dst->add(src->get(ii)); } } -void extMeasure::tableCopy(Ath__array1D* src, - Ath__array1D* dst, +void extMeasure::tableCopy(Array1D* src, + Array1D* dst, gs* pixelTable) { for (uint ii = 0; ii < src->getCnt(); ii++) { @@ -535,7 +535,7 @@ void extMeasure::tableCopy(Ath__array1D* src, } } -void extMeasure::release(Ath__array1D* seqTable, gs* pixelTable) +void extMeasure::release(Array1D* seqTable, gs* pixelTable) { if (pixelTable == nullptr) { pixelTable = _pixelTable; @@ -575,7 +575,7 @@ SEQ* extMeasure::addSeq(const int* ll, const int* ur) void extMeasure::addSeq(const int* ll, const int* ur, - Ath__array1D* seqTable, + Array1D* seqTable, gs* pixelTable) { if (pixelTable == nullptr) { @@ -593,7 +593,7 @@ void extMeasure::addSeq(const int* ll, } } -void extMeasure::addSeq(Ath__array1D* seqTable, gs* pixelTable) +void extMeasure::addSeq(Array1D* seqTable, gs* pixelTable) { SEQ* s = pixelTable->salloc(); for (uint ii = 0; ii < 2; ii++) { @@ -605,7 +605,7 @@ void extMeasure::addSeq(Ath__array1D* seqTable, gs* pixelTable) seqTable->add(s); } -void extMeasure::copySeq(SEQ* t, Ath__array1D* seqTable, gs* pixelTable) +void extMeasure::copySeq(SEQ* t, Array1D* seqTable, gs* pixelTable) { SEQ* s = pixelTable->salloc(); for (uint ii = 0; ii < 2; ii++) { @@ -617,7 +617,7 @@ void extMeasure::copySeq(SEQ* t, Ath__array1D* seqTable, gs* pixelTable) seqTable->add(s); } -void extMeasure::copySeqUsingPool(SEQ* t, Ath__array1D* seqTable) +void extMeasure::copySeqUsingPool(SEQ* t, Array1D* seqTable) { SEQ* s = _seqPool->alloc(); for (uint ii = 0; ii < 2; ii++) { @@ -700,7 +700,7 @@ uint extMeasure::getLength(SEQ* s, int dir) return s->_ur[dir] - s->_ll[dir]; } -uint extMeasure::blackCount(uint start, Ath__array1D* resTable) +uint extMeasure::blackCount(uint start, Array1D* resTable) { uint cnt = 0; for (uint jj = start; jj < resTable->getCnt(); jj++) { @@ -778,7 +778,7 @@ void extMeasure::swap_coords(SEQ* s) uint extMeasure::swap_coords(uint initCnt, uint endCnt, - Ath__array1D* resTable) + Array1D* resTable) { for (uint ii = initCnt; ii < endCnt; ii++) { swap_coords(resTable->get(ii)); @@ -787,7 +787,7 @@ uint extMeasure::swap_coords(uint initCnt, return endCnt - initCnt; } -uint extMeasure::getOverlapSeq(uint met, SEQ* s, Ath__array1D* resTable) +uint extMeasure::getOverlapSeq(uint met, SEQ* s, Array1D* resTable) { uint len1 = 0; @@ -822,7 +822,7 @@ uint extMeasure::getOverlapSeq(uint met, SEQ* s, Ath__array1D* resTable) uint extMeasure::getOverlapSeq(uint met, int* ll, int* ur, - Ath__array1D* resTable) + Array1D* resTable) { uint len1 = 0; @@ -854,9 +854,9 @@ uint extMeasure::getOverlapSeq(uint met, return 0; } -uint extMeasure::computeOverOrUnderSeq(Ath__array1D* seqTable, +uint extMeasure::computeOverOrUnderSeq(Array1D* seqTable, uint met, - Ath__array1D* resTable, + Array1D* resTable, bool over) { uint len = 0; @@ -919,9 +919,9 @@ uint extMeasure::computeOverOrUnderSeq(Ath__array1D* seqTable, uint extMeasure::computeOUwith2planes(int* ll, int* ur, - Ath__array1D* resTable) + Array1D* resTable) { - Ath__array1D met1Table(16); + Array1D met1Table(16); uint met1 = _underMet; uint met2 = _overMet; @@ -952,7 +952,7 @@ void extMeasure::calcOU(uint len) uint extMeasure::computeOverUnder(int* ll, int* ur, - Ath__array1D* resTable) + Array1D* resTable) { uint ouLen = computeOUwith2planes(ll, ur, resTable); @@ -971,9 +971,9 @@ uint extMeasure::computeOverUnder(int* ll, return ouLen; } -uint extMeasure::computeOverOrUnderSeq(Ath__array1D* seqTable, +uint extMeasure::computeOverOrUnderSeq(Array1D* seqTable, uint met, - Ath__array1D* resTable, + Array1D* resTable, bool over) { if (seqTable->getCnt() <= 0) { @@ -1021,7 +1021,7 @@ uint extMeasure::computeOverOrUnderSeq(Ath__array1D* seqTable, return len; } -uint extMeasure::computeOverUnder(int xy1, int xy2, Ath__array1D* resTable) +uint extMeasure::computeOverUnder(int xy1, int xy2, Array1D* resTable) { uint ouLen = intersectContextArray(xy1, xy2, _underMet, _overMet, resTable); @@ -1040,9 +1040,9 @@ uint extMeasure::computeOverUnder(int xy1, int xy2, Ath__array1D* resTable) return ouLen; } -uint extMeasure::mergeContextArray(Ath__array1D* srcContext, +uint extMeasure::mergeContextArray(Array1D* srcContext, int minS, - Ath__array1D* tgtContext) + Array1D* tgtContext) { tgtContext->resetCnt(0); uint ssize = srcContext->getCnt(); @@ -1075,11 +1075,11 @@ uint extMeasure::mergeContextArray(Ath__array1D* srcContext, return contextLength; } -uint extMeasure::mergeContextArray(Ath__array1D* srcContext, +uint extMeasure::mergeContextArray(Array1D* srcContext, int minS, int pmin, int pmax, - Ath__array1D* tgtContext) + Array1D* tgtContext) { tgtContext->resetCnt(0); uint ssize = srcContext->getCnt(); @@ -1137,14 +1137,14 @@ uint extMeasure::intersectContextArray(int pmin, int pmax, uint met1, uint met2, - Ath__array1D* tgtContext) + Array1D* tgtContext) { int minS1 = _minSpaceTable[met1]; int minS2 = _minSpaceTable[met2]; - Ath__array1D t1Context(1024); + Array1D t1Context(1024); mergeContextArray(_ccContextArray[met1], minS1, pmin, pmax, &t1Context); - Ath__array1D t2Context(1024); + Array1D t2Context(1024); mergeContextArray(_ccContextArray[met2], minS2, pmin, pmax, &t2Context); tgtContext->resetCnt(0); @@ -1323,7 +1323,7 @@ int extMeasure::getDgPlaneAndTrackIndex(uint tgt_met, // _dgContextLowTrack[planeIndex]; int hiTrack = _dgContextHiTrack[planeIndex] // > 2 ? 2 : _dgContextHiTrack[planeIndex]; // -void extMeasure::seq_release(Ath__array1D* table) +void extMeasure::seq_release(Array1D* table) { for (uint jj = 0; jj < table->getCnt(); jj++) { SEQ* s = table->get(jj); @@ -1337,14 +1337,14 @@ uint extMeasure::computeDiag(SEQ* s, uint dir, uint planeIndex, uint trackn, - Ath__array1D* residueSeq) + Array1D* residueSeq) { - Ath__array1D* dgContext = _dgContextArray[planeIndex][trackn]; + Array1D* dgContext = _dgContextArray[planeIndex][trackn]; if (dgContext->getCnt() <= 1) { return 0; } - Ath__array1D overlapSeq(16); + Array1D overlapSeq(16); getDgOverlap(s, _dir, dgContext, &overlapSeq, residueSeq); uint len = 0; @@ -1399,7 +1399,7 @@ int extMeasure::computeDiagOU(SEQ* s, uint trackMin, uint trackMax, uint targetMet, - Ath__array1D* diagTable) + Array1D* diagTable) { int trackDist = 2; int loTrack; @@ -1412,10 +1412,10 @@ int extMeasure::computeDiagOU(SEQ* s, uint len = 0; - Ath__array1D tmpTable(16); + Array1D tmpTable(16); copySeqUsingPool(s, &tmpTable); - Ath__array1D residueTable(16); + Array1D residueTable(16); int trackTable[200]; uint cnt = 0; @@ -1469,8 +1469,8 @@ int extMeasure::computeDiagOU(SEQ* s, return len; } -int extMeasure::compute_Diag_Over_Under(Ath__array1D* seqTable, - Ath__array1D* resTable) +int extMeasure::compute_Diag_Over_Under(Array1D* seqTable, + Array1D* resTable) { bool overUnder = true; int met1 = _underMet; @@ -1522,10 +1522,10 @@ int extMeasure::compute_Diag_Over_Under(Ath__array1D* seqTable, return totCovered; } -int extMeasure::compute_Diag_OverOrUnder(Ath__array1D* seqTable, +int extMeasure::compute_Diag_OverOrUnder(Array1D* seqTable, bool over, uint met, - Ath__array1D* resTable) + Array1D* resTable) { int totCovered = 0; int diagTotLen = 0; @@ -1609,9 +1609,9 @@ uint extMeasure::measureOverOnly(bool diagFlag) return totCovered; } -uint extMeasure::ouFlowStep(Ath__array1D* overTable) +uint extMeasure::ouFlowStep(Array1D* overTable) { - Ath__array1D tmpTable(32); + Array1D tmpTable(32); uint len = 0; for (uint ii = 0; ii < overTable->getCnt(); ii++) { SEQ* s = overTable->get(ii); @@ -1637,14 +1637,14 @@ uint extMeasure::ouFlowStep(Ath__array1D* overTable) return len; } -int extMeasure::underFlowStep(Ath__array1D* srcTable, - Ath__array1D* overTable) +int extMeasure::underFlowStep(Array1D* srcTable, + Array1D* overTable) { int totLen = 0; - Ath__array1D whiteTable(32); - Ath__array1D table1(32); - Ath__array1D diagTable(32); + Array1D whiteTable(32); + Array1D table1(32); + Array1D diagTable(32); for (uint ii = 0; ii < srcTable->getCnt(); ii++) { SEQ* s1 = srcTable->get(ii); @@ -2690,9 +2690,9 @@ void extMeasure::measureRC(CoupleOptions& options) void extMeasure::getDgOverlap(SEQ* sseq, uint dir, - Ath__array1D* dgContext, - Ath__array1D* overlapSeq, - Ath__array1D* residueSeq) + Array1D* dgContext, + Array1D* overlapSeq, + Array1D* residueSeq) { int idx = dgContext->get(0)->_ll[0]; uint lp = dir ? 0 : 1; @@ -2802,9 +2802,9 @@ void extMeasure::getDgOverlap(CoupleOptions& options) met, dir); } - Ath__array1D overlapSeq(16); - Ath__array1D residueSeq(16); - Ath__array1D* dgContext = nullptr; + Array1D overlapSeq(16); + Array1D residueSeq(16); + Array1D* dgContext = nullptr; for (int jj = 1; jj <= *_dgContextHiLvl; jj++) { int gridn = *_dgContextDepth + jj; for (int kk = 0; kk <= _dgContextHiTrack[gridn]; kk++) { @@ -2852,7 +2852,7 @@ void extMeasure::getDgOverlap(CoupleOptions& options) void extMeasure::initTargetSeq() { - Ath__array1D* dgContext = nullptr; + Array1D* dgContext = nullptr; SEQ* seq; for (int jj = 1; jj <= *_dgContextHiLvl; jj++) { int gridn = *_dgContextDepth + jj; @@ -2877,7 +2877,7 @@ void extMeasure::printDgContext() "diagonalContext %d: baseLevel %d\n", _dgContextCnt, *_dgContextBaseLvl); - Ath__array1D* dgContext = nullptr; + Array1D* dgContext = nullptr; SEQ* seq = nullptr; for (int jj = *_dgContextLowLvl; jj <= *_dgContextHiLvl; jj++) { int gridn = *_dgContextDepth + jj; diff --git a/src/rcx/src/extmeasure_res.cpp b/src/rcx/src/extmeasure_res.cpp index 1ca3a0b7d76..0bc744fac91 100644 --- a/src/rcx/src/extmeasure_res.cpp +++ b/src/rcx/src/extmeasure_res.cpp @@ -40,7 +40,7 @@ int extMeasure::computeResDist(SEQ* s, uint trackMin, uint trackMax, uint targetMet, - Ath__array1D* diagTable) + Array1D* diagTable) { int trackDist = 4; int loTrack; @@ -53,10 +53,10 @@ int extMeasure::computeResDist(SEQ* s, uint len = 0; - Ath__array1D tmpTable(16); + Array1D tmpTable(16); copySeqUsingPool(s, &tmpTable); - Ath__array1D residueTable(16); + Array1D residueTable(16); int trackTable[200]; uint cnt = 0; @@ -76,7 +76,7 @@ int extMeasure::computeResDist(SEQ* s, } // Check for same track bool same_track = false; - Ath__array1D* dTable = _dgContextArray[planeIndex][trackn]; + Array1D* dTable = _dgContextArray[planeIndex][trackn]; int cnt = (int) dTable->getCnt(); for (uint idx = 1; idx < (int) cnt; idx++) { SEQ* tseq = dTable->get(idx); @@ -120,14 +120,14 @@ uint extMeasure::computeRes(SEQ* s, uint dir, uint planeIndex, uint trackn, - Ath__array1D* residueSeq) + Array1D* residueSeq) { - Ath__array1D* dgContext = _dgContextArray[planeIndex][trackn]; + Array1D* dgContext = _dgContextArray[planeIndex][trackn]; if (dgContext->getCnt() <= 1) { return 0; } - Ath__array1D overlapSeq(16); + Array1D overlapSeq(16); getDgOverlap_res(s, _dir, dgContext, &overlapSeq, residueSeq); uint len = 0; @@ -382,9 +382,9 @@ extDistRCTable* extDistWidthRCTable::getRuleTable(uint mou, uint w) void extMeasure::getDgOverlap_res(SEQ* sseq, uint dir, - Ath__array1D* dgContext, - Ath__array1D* overlapSeq, - Ath__array1D* residueSeq) + Array1D* dgContext, + Array1D* overlapSeq, + Array1D* residueSeq) { int idx = 1; uint lp = dir ? 0 : 1; diff --git a/src/rcx/src/extprocess.cpp b/src/rcx/src/extprocess.cpp index 19cc6ad9f37..9762954e3c5 100644 --- a/src/rcx/src/extprocess.cpp +++ b/src/rcx/src/extprocess.cpp @@ -617,13 +617,13 @@ extDielectric* extProcess::getDielectric(uint ii) return _dielTable->get(ii); } -Ath__array1D* extProcess::getWidthTable(uint met) +Array1D* extProcess::getWidthTable(uint met) { double min_width = getConductor(met)->_min_width; const double wTable[8] = {1.0, 1.5, 2.0, 2.5, 3, 4, 5, 10}; - Ath__array1D* A = new Ath__array1D(11); + Array1D* A = new Array1D(11); for (uint ii = 0; ii < 8; ii++) { double w = wTable[ii] * min_width; A->add(w); @@ -632,13 +632,13 @@ Ath__array1D* extProcess::getWidthTable(uint met) return A; } -Ath__array1D* extProcess::getSpaceTable(uint met) +Array1D* extProcess::getSpaceTable(uint met) { double min_spacing = getConductor(met)->_min_spacing; const double sTable[8] = {1.0, 1.5, 2.0, 2.5, 3, 4, 5, 10}; - Ath__array1D* A = new Ath__array1D(8); + Array1D* A = new Array1D(8); for (uint ii = 0; ii < 8; ii++) { double s = sTable[ii] * min_spacing; A->add(s); @@ -647,7 +647,7 @@ Ath__array1D* extProcess::getSpaceTable(uint met) return A; } -Ath__array1D* extProcess::getDiagSpaceTable(uint met) +Array1D* extProcess::getDiagSpaceTable(uint met) { double min_spacing = getConductor(met)->_min_spacing; double min_width = getConductor(met)->_min_width; @@ -655,7 +655,7 @@ Ath__array1D* extProcess::getDiagSpaceTable(uint met) const double sTable[7] = {0, 0.2, 0.5, 0.7, 1.0, 2.0, 3}; - Ath__array1D* A = new Ath__array1D(8); + Array1D* A = new Array1D(8); for (uint ii = 0; ii < 7; ii++) { double s = sTable[ii] * p; A->add(s); @@ -664,12 +664,12 @@ Ath__array1D* extProcess::getDiagSpaceTable(uint met) return A; } -Ath__array1D* extProcess::getDataRateTable(uint met) +Array1D* extProcess::getDataRateTable(uint met) { if (_dataRateTable) { return _dataRateTable; } - Ath__array1D* A = new Ath__array1D(8); + Array1D* A = new Array1D(8); A->add(0.0); return A; } @@ -715,8 +715,8 @@ extVariation* extProcess::getVariation(uint met) } double extVariation::interpolate(double w, - Ath__array1D* X, - Ath__array1D* Y) + Array1D* X, + Array1D* Y) { if (X->getCnt() < 2) { return w; @@ -773,22 +773,22 @@ double extVariation::getTopWidthR(uint ii, uint jj) return _hiWidthR->getVal(ii, jj); } -Ath__array1D* extVariation::getWidthTable() +Array1D* extVariation::getWidthTable() { return _hiWidthC->_width; } -Ath__array1D* extVariation::getSpaceTable() +Array1D* extVariation::getSpaceTable() { return _hiWidthC->_space; } -Ath__array1D* extVariation::getDataRateTable() +Array1D* extVariation::getDataRateTable() { return _loWidthC->_density; } -Ath__array1D* extVariation::getPTable() +Array1D* extVariation::getPTable() { if (_p == nullptr) { return nullptr; @@ -804,8 +804,8 @@ double extVariation::getP(double w) return interpolate(w, _p->_width, _p->_p); } -Ath__array1D* extVarTable::readDoubleArray(Ath__parser* parser, - const char* keyword) +Array1D* extVarTable::readDoubleArray(Parser* parser, + const char* keyword) { if ((keyword != nullptr) && (strcmp(keyword, parser->get(0)) != 0)) { return nullptr; @@ -815,7 +815,7 @@ Ath__array1D* extVarTable::readDoubleArray(Ath__parser* parser, return nullptr; } - Ath__array1D* A = new Ath__array1D(parser->getWordCnt()); + Array1D* A = new Array1D(parser->getWordCnt()); uint start = 0; if (keyword != nullptr) { start = 1; @@ -825,7 +825,7 @@ Ath__array1D* extVarTable::readDoubleArray(Ath__parser* parser, } void extVarTable::printOneLine(FILE* fp, - Ath__array1D* A, + Array1D* A, const char* header, const char* trail) { @@ -885,17 +885,17 @@ void extVariation::printVariation(FILE* fp, uint n) extProcess::extProcess(uint condCnt, uint dielCnt, Logger* logger) { logger_ = logger; - _condTable = new Ath__array1D(condCnt); + _condTable = new Array1D(condCnt); _condTable->add(nullptr); _maxMinFlag = false; - _dielTable = new Ath__array1D(dielCnt); + _dielTable = new Array1D(dielCnt); _dielTable->add(nullptr); - _masterConductorTable = new Ath__array1D(condCnt); + _masterConductorTable = new Array1D(condCnt); _masterConductorTable->add(nullptr); - _masterDielectricTable = new Ath__array1D(dielCnt); + _masterDielectricTable = new Array1D(dielCnt); _masterDielectricTable->add(nullptr); - _varTable = new Ath__array1D(condCnt); + _varTable = new Array1D(condCnt); _varTable->add(nullptr); _dataRateTable = nullptr; _thickVarFlag = false; @@ -904,7 +904,7 @@ extProcess::extProcess(uint condCnt, uint dielCnt, Logger* logger) extVarTable::extVarTable(uint rowCnt) { _rowCnt = rowCnt; - _vTable = new Ath__array1D*[rowCnt]; + _vTable = new Array1D*[rowCnt]; _density = nullptr; _space = nullptr; _width = nullptr; diff --git a/src/rcx/src/grids.cpp b/src/rcx/src/grids.cpp index 6c046374a22..f0ee6a3435b 100644 --- a/src/rcx/src/grids.cpp +++ b/src/rcx/src/grids.cpp @@ -36,46 +36,48 @@ namespace rcx { -Ath__box::Ath__box() +Box::Box() { set(0, 0, 0, 0); + _layer = 0; + _next = nullptr; } -int Ath__box::getXlo(int bound) +int Box::getXlo(int bound) { if (_xlo < bound) { return bound; } return _xlo; } -int Ath__box::getYlo(int bound) +int Box::getYlo(int bound) { if (_ylo < bound) { return bound; } return _ylo; } -int Ath__box::getXhi(int bound) +int Box::getXhi(int bound) { if (_xhi > bound) { return bound; } return _xhi; } -int Ath__box::getYhi(int bound) +int Box::getYhi(int bound) { if (_yhi > bound) { return bound; } return _yhi; } -uint Ath__box::getDir() +uint Box::getDir() { uint dx = getDX(); uint dy = getDY(); return (dx < dy) ? 0 : 1; } -uint Ath__box::getWidth(uint* dir) +uint Box::getWidth(uint* dir) { uint dx = getDX(); uint dy = getDY(); @@ -87,11 +89,11 @@ uint Ath__box::getWidth(uint* dir) return dy; } -Ath__box::Ath__box(int x1, int y1, int x2, int y2, uint units) +Box::Box(int x1, int y1, int x2, int y2, uint units) { set(x1, y1, x2, y2, units); } -void Ath__box::set(int x1, int y1, int x2, int y2, uint units) +void Box::set(int x1, int y1, int x2, int y2, uint units) { _xlo = x1 * units; _ylo = y1 * units; @@ -100,19 +102,19 @@ void Ath__box::set(int x1, int y1, int x2, int y2, uint units) _valid = 1; _id = 0; } -uint Ath__box::getOwner() +uint Box::getOwner() { return 0; } -uint Ath__box::getDX() +uint Box::getDX() { return _xhi - _xlo; } -uint Ath__box::getDY() +uint Box::getDY() { return _yhi - _ylo; } -uint Ath__box::getLength() +uint Box::getLength() { uint dx = _xhi - _xlo; uint dy = _yhi - _ylo; @@ -121,11 +123,11 @@ uint Ath__box::getLength() } return dx; } -void Ath__box::invalidateBox() +void Box::invalidateBox() { _valid = 0; } -void Ath__box::set(Ath__box* bb) +void Box::set(Box* bb) { _xlo = bb->_xlo; _ylo = bb->_ylo; @@ -133,7 +135,7 @@ void Ath__box::set(Ath__box* bb) _yhi = bb->_yhi; } -bool Ath__box::outside(int x1, int y1, int x2, int y2) +bool Box::outside(int x1, int y1, int x2, int y2) { if (_valid == 0) { return false; @@ -156,7 +158,7 @@ bool Ath__box::outside(int x1, int y1, int x2, int y2) return false; } -void Ath__searchBox::set(int x1, int y1, int x2, int y2, uint l, int dir) +void SearchBox::set(int x1, int y1, int x2, int y2, uint l, int dir) { _ll[0] = x1; _ll[1] = y1; @@ -168,22 +170,21 @@ void Ath__searchBox::set(int x1, int y1, int x2, int y2, uint l, int dir) _otherId = 0; _type = 0; } -Ath__searchBox::Ath__searchBox() -{ -} -Ath__searchBox::Ath__searchBox(Ath__box* bb, uint l, int dir) +SearchBox::SearchBox() = default; + +SearchBox::SearchBox(Box* bb, uint l, int dir) { set(bb->_xlo, bb->_ylo, bb->_xhi, bb->_yhi, l, dir); } -Ath__searchBox::Ath__searchBox(Ath__searchBox* bb, uint l, int dir) +SearchBox::SearchBox(SearchBox* bb, uint l, int dir) { set(bb->_ll[0], bb->_ll[1], bb->_ur[0], bb->_ur[1], l, dir); } -Ath__searchBox::Ath__searchBox(int x1, int y1, int x2, int y2, uint l, int dir) +SearchBox::SearchBox(int x1, int y1, int x2, int y2, uint l, int dir) { set(x1, y1, x2, y2, l, dir); } -void Ath__searchBox::setMidPointSearch() +void SearchBox::setMidPointSearch() { for (uint i = 0; i < 2; i++) { _ll[i] = (_ll[i] + _ur[i]) / 2; @@ -191,66 +192,66 @@ void Ath__searchBox::setMidPointSearch() } } -void Ath__searchBox::setLo(uint d, int xy) +void SearchBox::setLo(uint d, int xy) { _ll[d] = xy; } -void Ath__searchBox::setHi(uint d, int xy) +void SearchBox::setHi(uint d, int xy) { _ur[d] = xy; } -int Ath__searchBox::loXY(uint d) +int SearchBox::loXY(uint d) { return _ll[d]; } -int Ath__searchBox::hiXY(uint d) +int SearchBox::hiXY(uint d) { return _ur[d]; } -int Ath__searchBox::loXY(uint d, int loBound) +int SearchBox::loXY(uint d, int loBound) { if (_ll[d] < loBound) { return loBound; } return _ll[d]; } -int Ath__searchBox::hiXY(uint d, int hiBound) +int SearchBox::hiXY(uint d, int hiBound) { if (_ur[d] > hiBound) { return hiBound; } return _ur[d]; } -uint Ath__searchBox::getDir() +uint SearchBox::getDir() { return _dir; } -uint Ath__searchBox::getLevel() +uint SearchBox::getLevel() { return _level; } -uint Ath__searchBox::getOwnerId() +uint SearchBox::getOwnerId() { return _ownId; } -uint Ath__searchBox::getOtherId() +uint SearchBox::getOtherId() { return _otherId; } -uint Ath__searchBox::getType() +uint SearchBox::getType() { return _type; } -void Ath__searchBox::setOwnerId(uint v, uint other) +void SearchBox::setOwnerId(uint v, uint other) { _ownId = v; _otherId = other; } -void Ath__searchBox::setType(uint v) +void SearchBox::setType(uint v) { _type = v; } -void Ath__searchBox::setDir(int dir) +void SearchBox::setDir(int dir) { if (dir >= 0) { _dir = dir; @@ -262,19 +263,19 @@ void Ath__searchBox::setDir(int dir) } } } -uint Ath__searchBox::getLength() +uint SearchBox::getLength() { if (_dir > 0) { return _ur[0] - _ll[0]; } return _ur[1] - _ll[1]; } -void Ath__searchBox::setLevel(uint v) +void SearchBox::setLevel(uint v) { _level = v; } -void Ath__wire::reset() +void Wire::reset() { _boxId = 0; _srcId = 0; @@ -293,21 +294,21 @@ void Ath__wire::reset() _ext = 0; _ouLen = 0; } -bool Ath__wire::isTilePin() +bool Wire::isTilePin() { if (_flags == 1) { return true; } return false; } -bool Ath__wire::isTileBus() +bool Wire::isTileBus() { if (_flags == 2) { return true; } return false; } -bool Ath__wire::isPower() +bool Wire::isPower() { uint power_wire_id = 11; // see db/dbSearch.cpp if (_flags == power_wire_id) { @@ -315,7 +316,7 @@ bool Ath__wire::isPower() } return false; } -bool Ath__wire::isVia() +bool Wire::isVia() { uint via_wire_id = 5; // see db/dbSearch.cpp if (_flags == via_wire_id) { @@ -323,11 +324,11 @@ bool Ath__wire::isVia() } return false; } -void Ath__wire::setOtherId(uint id) +void Wire::setOtherId(uint id) { _otherId = id; } -int Ath__wire::getRsegId() +int Wire::getRsegId() { int wBoxId = _boxId; if (!(_otherId > 0)) { @@ -341,7 +342,7 @@ int Ath__wire::getRsegId() } return wBoxId; } -int Ath__wire::getShapeProperty(int id) +int Wire::getShapeProperty(int id) { dbNet* net = getNet(); if (net == nullptr) { @@ -356,9 +357,9 @@ int Ath__wire::getShapeProperty(int id) int rcid = p->getValue(); return rcid; } -dbNet* Ath__wire::getNet() +dbNet* Wire::getNet() { - Ath__gridTable* gtb = _track->getGrid()->getGridTable(); + GridTable* gtb = _track->getGrid()->getGridTable(); dbBlock* block = gtb->getBlock(); if (_otherId == 0) { return (odb::dbSBox::getSBox(block, _boxId)->getSWire()->getNet()); @@ -368,19 +369,19 @@ dbNet* Ath__wire::getNet() } return (odb::dbRSeg::getRSeg(block, _boxId)->getNet()); } -uint Ath__wire::getBoxId() +uint Wire::getBoxId() { return _boxId; } -uint Ath__wire::getOtherId() +uint Wire::getOtherId() { return _otherId; } -uint Ath__wire::getSrcId() +uint Wire::getSrcId() { return _srcId; } -void Ath__wire::set(uint dir, const int* ll, const int* ur) +void Wire::set(uint dir, const int* ll, const int* ur) { _boxId = 0; _srcId = 0; @@ -405,11 +406,11 @@ void Ath__wire::set(uint dir, const int* ll, const int* ur) _visited = 0; _ouLen = 0; } -Ath__wire* Ath__track::getTargetWire() +Wire* Track::getTargetWire() { return _targetWire; } -void Ath__track::initTargetWire(int noPowerWire) +void Track::initTargetWire(int noPowerWire) { _targetWire = nullptr; for (_targetMarker = 0; _targetMarker < _markerCnt; _targetMarker++) { @@ -425,7 +426,7 @@ void Ath__track::initTargetWire(int noPowerWire) } } } -Ath__wire* Ath__track::nextTargetWire(int noPowerWire) +Wire* Track::nextTargetWire(int noPowerWire) { if (_targetWire) { _targetWire = _targetWire->_next; @@ -454,7 +455,7 @@ Ath__wire* Ath__track::nextTargetWire(int noPowerWire) return _targetWire; } -int Ath__wire::wireOverlap(Ath__wire* w, int* len1, int* len2, int* len3) +int Wire::wireOverlap(Wire* w, int* len1, int* len2, int* len3) { // _xy, _len : reference rect @@ -503,7 +504,7 @@ int Ath__wire::wireOverlap(Ath__wire* w, int* len1, int* len2, int* len3) } return 0; } -void Ath__wire::getCoords(int* x1, int* y1, int* x2, int* y2, uint* dir) +void Wire::getCoords(int* x1, int* y1, int* x2, int* y2, uint* dir) { if (_dir > 0) // horizontal { @@ -519,7 +520,7 @@ void Ath__wire::getCoords(int* x1, int* y1, int* x2, int* y2, uint* dir) } *dir = _dir; } -void Ath__wire::getCoords(Ath__searchBox* box) +void Wire::getCoords(SearchBox* box) { uint level = _track->getGrid()->getLevel(); if (_dir > 0) // horizontal @@ -531,7 +532,7 @@ void Ath__wire::getCoords(Ath__searchBox* box) box->setType(_flags); } -Ath__track* Ath__track::getNextSubTrack(Ath__track* subt, bool tohi) +Track* Track::getNextSubTrack(Track* subt, bool tohi) { if (!subt) { return tohi ? this : this->getLowTrack(); @@ -542,31 +543,31 @@ Ath__track* Ath__track::getNextSubTrack(Ath__track* subt, bool tohi) return subt->_lowest ? nullptr : subt->getLowTrack(); } -void Ath__track::setHiTrack(Ath__track* hitrack) +void Track::setHiTrack(Track* hitrack) { _hiTrack = hitrack; } -void Ath__track::setLowTrack(Ath__track* lowtrack) +void Track::setLowTrack(Track* lowtrack) { _lowTrack = lowtrack; } -Ath__track* Ath__track::getHiTrack() +Track* Track::getHiTrack() { return _hiTrack; } -Ath__track* Ath__track::getLowTrack() +Track* Track::getLowTrack() { return _lowTrack; } -void Ath__track::set(Ath__grid* g, - int x, - int y, - uint n, - uint width, - uint markerLen, - uint markerCnt, - int base) +void Track::set(Grid* g, + int x, + int y, + uint n, + uint width, + uint markerLen, + uint markerCnt, + int base) { _grid = g; _x = x; @@ -576,12 +577,12 @@ void Ath__track::set(Ath__grid* g, if (markerCnt <= 4) { _markerCnt = markerCnt; - _marker = new Ath__wire*[4]; - _eMarker = new Ath__wire*[4]; + _marker = new Wire*[4]; + _eMarker = new Wire*[4]; } else { _markerCnt = markerCnt; - _marker = new Ath__wire*[_markerCnt]; - _eMarker = new Ath__wire*[_markerCnt]; + _marker = new Wire*[_markerCnt]; + _eMarker = new Wire*[_markerCnt]; } for (uint ii = 0; ii < _markerCnt; ii++) { _marker[ii] = nullptr; @@ -596,26 +597,26 @@ void Ath__track::set(Ath__grid* g, _lowest = 0; _base = base; } -void Ath__track::freeWires(AthPool* pool) +void Track::freeWires(AthPool* pool) { for (uint ii = 0; ii < _markerCnt; ii++) { - Ath__wire* w = _marker[ii]; + Wire* w = _marker[ii]; while (w != nullptr) { - Ath__wire* a = w->getNext(); + Wire* a = w->getNext(); pool->free(w); w = a; } } } -void Ath__track::dealloc(AthPool* pool) +void Track::dealloc(AthPool* pool) { freeWires(pool); delete[] _marker; delete[] _eMarker; } -uint Ath__grid::getAbsTrackNum(int xy) +uint Grid::getAbsTrackNum(int xy) { int dist = xy - _base; @@ -627,7 +628,7 @@ uint Ath__grid::getAbsTrackNum(int xy) return n; } -uint Ath__grid::getMinMaxTrackNum(int xy) +uint Grid::getMinMaxTrackNum(int xy) { int dist = xy - _base; @@ -644,10 +645,10 @@ uint Ath__grid::getMinMaxTrackNum(int xy) return n; } -void Ath__grid::initContextTracks() +void Grid::initContextTracks() { setSearchDomain(1); - Ath__track *track, *btrack; + Track *track, *btrack; uint ii; bool noPowerTarget = _gridtable->noPowerTarget() > 0 ? true : false; for (ii = _searchLowTrack; ii <= _searchHiTrack; ii++) { @@ -663,7 +664,7 @@ void Ath__grid::initContextTracks() } } -void Ath__grid::initContextGrids() +void Grid::initContextGrids() { uint sdepth = _gridtable->contextDepth(); if (sdepth == 0) { @@ -679,7 +680,7 @@ void Ath__grid::initContextGrids() } } -void Ath__grid::setSearchDomain(uint domainAdjust) +void Grid::setSearchDomain(uint domainAdjust) { if (_gridtable->allNet()) { _searchLowTrack = 0; @@ -688,7 +689,7 @@ void Ath__grid::setSearchDomain(uint domainAdjust) _searchHiMarker = _markerCnt - 1; return; } - Ath__box* searchBox = _gridtable->maxSearchBox(); + Box* searchBox = _gridtable->maxSearchBox(); int lo = _dir ? searchBox->_ylo : searchBox->_xlo; int hi = _dir ? searchBox->_yhi : searchBox->_xhi; int ltrack = (int) getMinMaxTrackNum(lo) - (int) domainAdjust; @@ -703,18 +704,18 @@ void Ath__grid::setSearchDomain(uint domainAdjust) _searchHiMarker = getBucketNum(mhi); } -Ath__track* Ath__grid::addTrack(uint ii, uint markerCnt, int base) +Track* Grid::addTrack(uint ii, uint markerCnt, int base) { - Ath__track* track = _trackPoolPtr->alloc(); + Track* track = _trackPoolPtr->alloc(); track->set(this, _start, _end, ii, _width, _markerLen, markerCnt, base); return track; } -Ath__track* Ath__grid::addTrack(uint ii, uint markerCnt) +Track* Grid::addTrack(uint ii, uint markerCnt) { int trackBase = _base + _pitch * ii; return addTrack(ii, markerCnt, trackBase); } -Ath__track* Ath__grid::getTrackPtr(uint ii, uint markerCnt, int base) +Track* Grid::getTrackPtr(uint ii, uint markerCnt, int base) { if (ii >= _trackCnt) { return nullptr; @@ -724,8 +725,8 @@ Ath__track* Ath__grid::getTrackPtr(uint ii, uint markerCnt, int base) return nullptr; } - Ath__track* ntrack; - Ath__track* ttrack = _trackTable[ii]; + Track* ntrack; + Track* ttrack = _trackTable[ii]; while (ttrack) { if (ttrack->getBase() == base) { break; @@ -764,12 +765,12 @@ Ath__track* Ath__grid::getTrackPtr(uint ii, uint markerCnt, int base) } return ttrack; } -Ath__track* Ath__grid::getTrackPtr(uint ii, uint markerCnt) +Track* Grid::getTrackPtr(uint ii, uint markerCnt) { int trackBase = _base + _pitch * ii; return getTrackPtr(ii, markerCnt, trackBase); } -bool Ath__track::place(Ath__wire* w, int markIndex1, int markIndex2) +bool Track::place(Wire* w, int markIndex1, int markIndex2) { assert(markIndex1 >= 0); assert(markIndex2 >= 0); @@ -783,7 +784,7 @@ bool Ath__track::place(Ath__wire* w, int markIndex1, int markIndex2) return true; } - Ath__wire* a = _marker[markIndex1]; + Wire* a = _marker[markIndex1]; if (w->_xy < a->_xy) { if (w->_xy + w->_len >= a->_xy) { fprintf(stdout, "overlap %d %d \n", w->_xy, a->_xy); @@ -794,7 +795,7 @@ bool Ath__track::place(Ath__wire* w, int markIndex1, int markIndex2) return true; } - Ath__wire* e = _marker[markIndex1]; + Wire* e = _marker[markIndex1]; for (; e != nullptr; e = e->_next) { if (w->_xy < e->_xy) { continue; @@ -808,9 +809,9 @@ bool Ath__track::place(Ath__wire* w, int markIndex1, int markIndex2) } return false; } -void Ath__wire::search(int xy1, int xy2, uint& cnt, Ath__array1D* idTable) +void Wire::search(int xy1, int xy2, uint& cnt, Array1D* idTable) { - Ath__wire* e = this; + Wire* e = this; for (; e != nullptr; e = e->_next) { if (xy2 <= e->_xy) { break; @@ -825,12 +826,9 @@ void Ath__wire::search(int xy1, int xy2, uint& cnt, Ath__array1D* idTable) } } } -void Ath__wire::search1(int xy1, - int xy2, - uint& cnt, - Ath__array1D* idTable) +void Wire::search1(int xy1, int xy2, uint& cnt, Array1D* idTable) { - Ath__wire* e = this; + Wire* e = this; for (; e != nullptr; e = e->_next) { if (xy2 <= e->_xy) { break; @@ -845,11 +843,11 @@ void Ath__wire::search1(int xy1, } } } -uint Ath__track::search(int xy1, - int xy2, - uint markIndex1, - uint markIndex2, - Ath__array1D* idTable) +uint Track::search(int xy1, + int xy2, + uint markIndex1, + uint markIndex2, + Array1D* idTable) { uint cnt = 0; if (_eMarker[markIndex1]) { @@ -863,19 +861,19 @@ uint Ath__track::search(int xy1, } return cnt; } -void Ath__track::resetExtFlag(uint markerCnt) +void Track::resetExtFlag(uint markerCnt) { for (uint ii = 0; ii < markerCnt; ii++) { - Ath__wire* e = _marker[ii]; + Wire* e = _marker[ii]; for (; e != nullptr; e = e->_next) { e->_ext = 0; } } } -uint Ath__track::getAllWires(Ath__array1D* boxTable, uint markerCnt) +uint Track::getAllWires(Array1D* boxTable, uint markerCnt) { for (uint ii = 0; ii < markerCnt; ii++) { - Ath__wire* e = _marker[ii]; + Wire* e = _marker[ii]; for (; e != nullptr; e = e->_next) { if (e->_ext > 0) { continue; @@ -888,11 +886,11 @@ uint Ath__track::getAllWires(Ath__array1D* boxTable, uint markerCnt) resetExtFlag(markerCnt); return boxTable->getCnt(); } -uint Ath__track::search1(int xy1, - int xy2, - uint markIndex1, - uint markIndex2, - Ath__array1D* idTable) +uint Track::search1(int xy1, + int xy2, + uint markIndex1, + uint markIndex2, + Array1D* idTable) { if (!_ordered) { markIndex1 = 0; @@ -910,7 +908,7 @@ uint Ath__track::search1(int xy1, } return cnt; } -uint Ath__track::setExtrusionMarker(int markerCnt, int start, uint markerLen) +uint Track::setExtrusionMarker(int markerCnt, int start, uint markerLen) { _ordered = true; @@ -921,7 +919,7 @@ uint Ath__track::setExtrusionMarker(int markerCnt, int start, uint markerLen) _eMarker[ii] = nullptr; } for (ii = 0; ii < markerCnt - 1; ii++) { - for (Ath__wire* e = _marker[ii]; e != nullptr; e = e->_next) { + for (Wire* e = _marker[ii]; e != nullptr; e = e->_next) { int tailMark = (e->_xy + e->_len - start) / markerLen; if (tailMark == ii) { continue; @@ -943,7 +941,7 @@ uint Ath__track::setExtrusionMarker(int markerCnt, int start, uint markerLen) } return cnt; } -bool Ath__track::placeTrail(Ath__wire* w, uint m1, uint m2) +bool Track::placeTrail(Wire* w, uint m1, uint m2) { for (uint ii = m1 + 1; ii <= m2; ii++) { if (_marker[ii] == nullptr) { @@ -960,7 +958,7 @@ bool Ath__track::placeTrail(Ath__wire* w, uint m1, uint m2) } return true; } -bool Ath__track::checkAndplacerOnMarker(Ath__wire* w, int markIndex) +bool Track::checkAndplacerOnMarker(Wire* w, int markIndex) { if (_marker[markIndex] == nullptr) { _marker[markIndex] = w; @@ -968,21 +966,21 @@ bool Ath__track::checkAndplacerOnMarker(Ath__wire* w, int markIndex) } return false; } -bool Ath__track::checkMarker(int markIndex) +bool Track::checkMarker(int markIndex) { if (_marker[markIndex] == nullptr) { return true; } return false; } -bool Ath__track::checkAndplace(Ath__wire* w, int markIndex1) +bool Track::checkAndplace(Wire* w, int markIndex1) { if (_marker[markIndex1] == nullptr) { _marker[markIndex1] = w; return true; } - Ath__wire* a = _marker[markIndex1]; + Wire* a = _marker[markIndex1]; if (w->_xy <= a->_xy) { if (w->_xy + w->_len > a->_xy) { return false; @@ -993,8 +991,8 @@ bool Ath__track::checkAndplace(Ath__wire* w, int markIndex1) return true; } - Ath__wire* prev = _marker[markIndex1]; - Ath__wire* e = _marker[markIndex1]; + Wire* prev = _marker[markIndex1]; + Wire* e = _marker[markIndex1]; for (; e != nullptr; e = e->_next) { if (w->_xy <= e->_xy) { if (w->_xy + w->_len > e->_xy) { @@ -1014,7 +1012,7 @@ bool Ath__track::checkAndplace(Ath__wire* w, int markIndex1) prev->setNext(w); return true; } -void Ath__track::insertWire(Ath__wire* w, int mark1, int mark2) +void Track::insertWire(Wire* w, int mark1, int mark2) { w->_track = this; for (int ii = mark1; ii < mark2; ii++) { @@ -1026,7 +1024,7 @@ void Ath__track::insertWire(Ath__wire* w, int mark1, int mark2) } } -bool Ath__track::place2(Ath__wire* w, int mark1, int mark2) +bool Track::place2(Wire* w, int mark1, int mark2) { assert(mark1 >= 0); @@ -1037,7 +1035,7 @@ bool Ath__track::place2(Ath__wire* w, int mark1, int mark2) } bool status = true; - Ath__wire* a = _marker[mark1]; + Wire* a = _marker[mark1]; if (w->_xy <= a->_xy) { w->setNext(a); _marker[mark1] = w; @@ -1046,8 +1044,8 @@ bool Ath__track::place2(Ath__wire* w, int mark1, int mark2) return true; } - Ath__wire* prev = _marker[mark1]; - Ath__wire* e = _marker[mark1]; + Wire* prev = _marker[mark1]; + Wire* e = _marker[mark1]; for (; e != nullptr; e = e->_next) { if (w->_xy <= e->_xy) { w->setNext(e); @@ -1071,10 +1069,9 @@ bool Ath__track::place2(Ath__wire* w, int mark1, int mark2) return status; } int SdbPlaceWireNoTouchCheckForOverlap = 0; -void Ath__track::linkWire(Ath__wire*& w1, Ath__wire*& w2) +void Track::linkWire(Wire*& w1, Wire*& w2) { - Ath__overlapAdjust adj - = (Ath__overlapAdjust) _grid->getGridTable()->getOverlapAdjust(); + OverlapAdjust adj = (OverlapAdjust) _grid->getGridTable()->getOverlapAdjust(); int nend, oend, tend; nend = w1->_xy + w1->_len; oend = w2->_xy + w2->_len; @@ -1115,7 +1112,7 @@ void Ath__track::linkWire(Ath__wire*& w1, Ath__wire*& w2) } } -bool Ath__track::place(Ath__wire* w, int markIndex1) +bool Track::place(Wire* w, int markIndex1) { assert(markIndex1 >= 0); @@ -1125,11 +1122,10 @@ bool Ath__track::place(Ath__wire* w, int markIndex1) _marker[markIndex1] = w; return true; } - Ath__overlapAdjust adj - = (Ath__overlapAdjust) _grid->getGridTable()->getOverlapAdjust(); + OverlapAdjust adj = (OverlapAdjust) _grid->getGridTable()->getOverlapAdjust(); bool status = true; - Ath__wire* a = _marker[markIndex1]; + Wire* a = _marker[markIndex1]; if (w->_xy <= a->_xy) { if (adj != Z_noAdjust && w->_xy + w->_len > a->_xy + a->_len && w->_base <= a->_base @@ -1143,8 +1139,8 @@ bool Ath__track::place(Ath__wire* w, int markIndex1) return true; } - Ath__wire* prev = _marker[markIndex1]; - Ath__wire* e = _marker[markIndex1]; + Wire* prev = _marker[markIndex1]; + Wire* e = _marker[markIndex1]; for (; e != nullptr; e = e->_next) { if (w->_xy <= e->_xy) { if (adj != Z_noAdjust && w->_xy + w->_len >= e->_xy + e->_len @@ -1175,9 +1171,9 @@ bool Ath__track::place(Ath__wire* w, int markIndex1) return status; } -Ath__wire* Ath__track::getNextWire(Ath__wire* wire) +Wire* Track::getNextWire(Wire* wire) { - Ath__wire* nwire; + Wire* nwire; if (!wire) { _searchMarkerIndex = _grid->searchLowMarker(); nwire = _marker[_searchMarkerIndex]; @@ -1197,10 +1193,10 @@ Ath__wire* Ath__track::getNextWire(Ath__wire* wire) return nullptr; } -Ath__wire* Ath__track::getWire_Linear(uint markerCnt, uint id) +Wire* Track::getWire_Linear(uint markerCnt, uint id) { for (uint ii = 0; ii < markerCnt; ii++) { - Ath__wire* e = _marker[ii]; + Wire* e = _marker[ii]; for (; e != nullptr; e = e->_next) { if (e->_id == id) { return e; @@ -1209,13 +1205,11 @@ Ath__wire* Ath__track::getWire_Linear(uint markerCnt, uint id) } return nullptr; } -void Ath__track::adjustOverlapMakerEnd(uint markerCnt, - int start, - uint markerLen) +void Track::adjustOverlapMakerEnd(uint markerCnt, int start, uint markerLen) { _ordered = true; - Ath__wire* e; + Wire* e; uint tailMark; uint jj; for (uint ii = 0; ii < markerCnt - 1; ii++) { @@ -1247,9 +1241,9 @@ void Ath__track::adjustOverlapMakerEnd(uint markerCnt, ii = jj - 1; } } -void Ath__track::adjustOverlapMakerEnd(uint markerCnt) +void Track::adjustOverlapMakerEnd(uint markerCnt) { - Ath__wire* e; + Wire* e; uint jj; for (uint ii = 0; ii < markerCnt - 1; ii++) { e = _marker[ii]; @@ -1272,13 +1266,13 @@ void Ath__track::adjustOverlapMakerEnd(uint markerCnt) } } -bool Ath__track::isAscendingOrdered(uint markerCnt, uint* wCnt) +bool Track::isAscendingOrdered(uint markerCnt, uint* wCnt) { uint cnt = 0; for (uint ii = 0; ii < markerCnt; ii++) { - Ath__wire* e = _marker[ii]; + Wire* e = _marker[ii]; for (; e != nullptr; e = e->_next) { - Ath__wire* w = e->_next; + Wire* w = e->_next; cnt++; if (w == nullptr) { @@ -1294,13 +1288,11 @@ bool Ath__track::isAscendingOrdered(uint markerCnt, uint* wCnt) *wCnt += cnt; return true; } -bool Ath__track::overlapCheck(Ath__wire* w, - int markIndex1, - int /* unused: markIndex2 */) +bool Track::overlapCheck(Wire* w, int markIndex1, int /* unused: markIndex2 */) { assert(markIndex1 >= 0); - Ath__wire* e = _marker[markIndex1]; + Wire* e = _marker[markIndex1]; for (; e != nullptr; e = e->_next) { if (w->_xy + w->_len >= e->_xy) { return true; @@ -1308,7 +1300,7 @@ bool Ath__track::overlapCheck(Ath__wire* w, } return false; } -void Ath__grid::makeTrackTable(uint width, uint pitch, uint space) +void Grid::makeTrackTable(uint width, uint pitch, uint space) { if (width > 0) { _width = width; @@ -1325,7 +1317,7 @@ void Ath__grid::makeTrackTable(uint width, uint pitch, uint space) _trackCnt = _max; // for LINUX assert _trackCnt = getAbsTrackNum(_max) + 1; _subTrackCnt = (uint*) calloc(sizeof(uint), _trackCnt); - _trackTable = new Ath__track*[_trackCnt]; + _trackTable = new Track*[_trackCnt]; _blockedTrackTable = new uint[_trackCnt]; for (uint ii = 0; ii < _trackCnt; ii++) { @@ -1334,7 +1326,7 @@ void Ath__grid::makeTrackTable(uint width, uint pitch, uint space) } } -void Ath__grid::setBoundaries(uint dir, int xlo, int ylo, int xhi, int yhi) +void Grid::setBoundaries(uint dir, int xlo, int ylo, int xhi, int yhi) { _lo[0] = xlo; _lo[1] = ylo; @@ -1354,12 +1346,12 @@ void Ath__grid::setBoundaries(uint dir, int xlo, int ylo, int xhi, int yhi) _end = xhi; } } -Ath__grid::Ath__grid(Ath__gridTable* gt, - AthPool* trackPool, - AthPool* wirePool, - uint level, - uint num, - uint markerCnt) +Grid::Grid(GridTable* gt, + AthPool* trackPool, + AthPool* wirePool, + uint level, + uint num, + uint markerCnt) { _gridtable = gt; _trackPoolPtr = trackPool; @@ -1370,14 +1362,14 @@ Ath__grid::Ath__grid(Ath__gridTable* gt, _schema = 0; } -void Ath__grid::setTracks(uint dir, - uint width, - uint pitch, - int xlo, - int ylo, - int xhi, - int yhi, - uint markerLen) +void Grid::setTracks(uint dir, + uint width, + uint pitch, + int xlo, + int ylo, + int xhi, + int yhi, + uint markerLen) { setBoundaries(dir, xlo, ylo, xhi, yhi); makeTrackTable(width, pitch); @@ -1390,20 +1382,20 @@ void Ath__grid::setTracks(uint dir, } } } -void Ath__grid::setSchema(uint v) +void Grid::setSchema(uint v) { _schema = v; } -Ath__grid::Ath__grid(Ath__gridTable* gt, - AthPool* trackPool, - AthPool* wirePool, - Ath__box* bb, - uint level, - uint dir, - uint num, - uint width, - uint pitch, - uint markerCnt) +Grid::Grid(GridTable* gt, + AthPool* trackPool, + AthPool* wirePool, + Box* bb, + uint level, + uint dir, + uint num, + uint width, + uint pitch, + uint markerCnt) { _gridtable = gt; _trackPoolPtr = trackPool; @@ -1417,7 +1409,7 @@ Ath__grid::Ath__grid(Ath__gridTable* gt, makeTrackTable(width, pitch); _schema = 0; } -void Ath__grid::getBbox(Ath__searchBox* bb) +void Grid::getBbox(SearchBox* bb) { if (_dir == 0) { // vertical bb->set(_base, _start, _max, _end, _level, _dir); @@ -1425,7 +1417,7 @@ void Ath__grid::getBbox(Ath__searchBox* bb) bb->set(_start, _base, _end, _max, _level, _dir); } } -void Ath__grid::getBbox(Ath__box* bb) +void Grid::getBbox(Box* bb) { if (_dir == 0) { // vertical bb->_xlo = _base; @@ -1440,35 +1432,35 @@ void Ath__grid::getBbox(Ath__box* bb) } } -void Ath__grid::freeTracksAndTables() +void Grid::freeTracksAndTables() { delete[] _trackTable; delete[] _blockedTrackTable; } -Ath__grid::~Ath__grid() +Grid::~Grid() { freeTracksAndTables(); } -uint Ath__grid::getLevel() +uint Grid::getLevel() { return _level; } -uint Ath__grid::getDir() +uint Grid::getDir() { return _dir; } -int Ath__grid::getTrackHeight(uint track) +int Grid::getTrackHeight(uint track) { return _base + track * _pitch; } -Ath__grid* Ath__track::getGrid() +Grid* Track::getGrid() { return _grid; } -uint Ath__track::removeMarkedNetWires() +uint Track::removeMarkedNetWires() { uint cnt = 0; - Ath__wire *wire, *pwire, *nwire; + Wire *wire, *pwire, *nwire; for (uint jj = 0; jj < _markerCnt; jj++) { pwire = nullptr; wire = _marker[jj]; @@ -1498,17 +1490,17 @@ uint Ath__track::removeMarkedNetWires() } return cnt; } -uint Ath__grid::defaultWireType() +uint Grid::defaultWireType() { return _wireType; } -void Ath__grid::setDefaultWireType(uint v) +void Grid::setDefaultWireType(uint v) { _wireType = v; // TODO-OPTIMIZE : can it be 32-bit? } -uint Ath__grid::getBoxes(uint trackIndex, Ath__array1D* table) +uint Grid::getBoxes(uint trackIndex, Array1D* table) { - Ath__track* tr = _trackTable[trackIndex]; + Track* tr = _trackTable[trackIndex]; if (tr == nullptr) { return 0; } @@ -1520,16 +1512,16 @@ uint Ath__grid::getBoxes(uint trackIndex, Ath__array1D* table) if (tr->_marker[k] == nullptr) { continue; } - for (Ath__wire* w = tr->_marker[k]; w != nullptr; w = w->_next) { + for (Wire* w = tr->_marker[k]; w != nullptr; w = w->_next) { table->add(w->_boxId); } } return table->getCnt(); } -void Ath__grid::getBoxes(Ath__array1D* table) +void Grid::getBoxes(Array1D* table) { for (uint ii = 0; ii < _trackCnt; ii++) { - Ath__track* tr = _trackTable[ii]; + Track* tr = _trackTable[ii]; if (tr == nullptr) { continue; } @@ -1537,19 +1529,19 @@ void Ath__grid::getBoxes(Ath__array1D* table) continue; } - for (Ath__wire* w = tr->_marker[0]; w != nullptr; w = w->_next) { + for (Wire* w = tr->_marker[0]; w != nullptr; w = w->_next) { table->add(w->_boxId); } } } -bool Ath__grid::addOnTrack(uint track, Ath__wire* w, uint mark1, uint mark2) +bool Grid::addOnTrack(uint track, Wire* w, uint mark1, uint mark2) { if (_blockedTrackTable[track] > 0) { return false; } - Ath__track* tr = nullptr; + Track* tr = nullptr; if (_trackTable[track] == nullptr) { tr = addTrack(track, _markerCnt); _trackTable[track] = tr; @@ -1569,12 +1561,12 @@ bool Ath__grid::addOnTrack(uint track, Ath__wire* w, uint mark1, uint mark2) } return false; } -uint Ath__grid::placeWire(uint initTrack, - Ath__wire* w, - uint mark1, - uint mark2, - int sortedOrder, - int* height) +uint Grid::placeWire(uint initTrack, + Wire* w, + uint mark1, + uint mark2, + int sortedOrder, + int* height) { uint check = 20; uint track = initTrack; @@ -1607,10 +1599,10 @@ uint Ath__grid::placeWire(uint initTrack, *height = getTrackHeight(track); return nextTrack; } -uint Ath__grid::addWireList(Ath__box* list) +uint Grid::addWireList(Box* list) { uint cnt = 0; - for (Ath__box* e = list; e != nullptr; e = e->_next) { + for (Box* e = list; e != nullptr; e = e->_next) { if (e->_layer != _level) { continue; } @@ -1626,29 +1618,26 @@ uint Ath__grid::addWireList(Ath__box* list) } return cnt; } -uint Ath__grid::addWire(uint initTrack, - Ath__box* box, - int sortedOrder, - int* height) +uint Grid::addWire(uint initTrack, Box* box, int sortedOrder, int* height) { uint id, markIndex1, markIndex2; - Ath__wire* w = makeWire(box, &id, &markIndex1, &markIndex2, 0); + Wire* w = makeWire(box, &id, &markIndex1, &markIndex2, 0); return placeWire(initTrack, w, markIndex1, markIndex2, sortedOrder, height); } -Ath__track* Ath__grid::getTrackPtr(int xy) +Track* Grid::getTrackPtr(int xy) { uint trackNum = getMinMaxTrackNum(xy); return getTrackPtr(trackNum, _markerCnt); } -Ath__track* Ath__grid::getTrackPtr(int* ll) +Track* Grid::getTrackPtr(int* ll) { uint trackNum = getMinMaxTrackNum(ll[_dir]); return getTrackPtr(trackNum, _markerCnt); } -uint Ath__grid::placeBox(uint id, int x1, int y1, int x2, int y2) +uint Grid::placeBox(uint id, int x1, int y1, int x2, int y2) { int ll[2] = {x1, y1}; int ur[2] = {x2, y2}; @@ -1667,9 +1656,9 @@ uint Ath__grid::placeBox(uint id, int x1, int y1, int x2, int y2) } for (uint ii = trackNum1; ii <= trackNum2; ii++) { - Ath__wire* w = makeWire(_dir, ll, ur, id, 0); + Wire* w = makeWire(_dir, ll, ur, id, 0); - Ath__track* track = getTrackPtr(ii, _markerCnt); + Track* track = getTrackPtr(ii, _markerCnt); if (track->place(w, m1)) { w->_track = track; @@ -1680,17 +1669,17 @@ uint Ath__grid::placeBox(uint id, int x1, int y1, int x2, int y2) return trackNum1; } -void Ath__wire::setXY(int xy1, uint len) +void Wire::setXY(int xy1, uint len) { _xy = xy1; // offset from track start?? _len = len; } -Ath__wire* Ath__wire::makeCoupleWire(AthPool* wirePool, - int targetHighTracks, - Ath__wire* w2, - int xy1, - uint len, - uint /* unused: wtype */) +Wire* Wire::makeCoupleWire(AthPool* wirePool, + int targetHighTracks, + Wire* w2, + int xy1, + uint len, + uint /* unused: wtype */) { int dist; if (targetHighTracks) { @@ -1702,7 +1691,7 @@ Ath__wire* Ath__wire::makeCoupleWire(AthPool* wirePool, return nullptr; } - Ath__wire* w = getPoolWire(wirePool); + Wire* w = getPoolWire(wirePool); w->_srcId = 0; w->reset(); @@ -1722,19 +1711,19 @@ Ath__wire* Ath__wire::makeCoupleWire(AthPool* wirePool, } return w; } -Ath__wire* Ath__wire::getPoolWire(AthPool* wirePool) +Wire* Wire::getPoolWire(AthPool* wirePool) { int n; int getRecycleFlag = 0; - Ath__wire* w = wirePool->alloc(&getRecycleFlag, &n); + Wire* w = wirePool->alloc(&getRecycleFlag, &n); if (getRecycleFlag == 0) { w->_id = n; } return w; } -Ath__wire* Ath__wire::makeWire(AthPool* wirePool, int xy1, uint len) +Wire* Wire::makeWire(AthPool* wirePool, int xy1, uint len) { - Ath__wire* w = getPoolWire(wirePool); + Wire* w = getPoolWire(wirePool); w->_srcId = 0; @@ -1754,19 +1743,19 @@ Ath__wire* Ath__wire::makeWire(AthPool* wirePool, int xy1, uint len) return w; } -Ath__wire* Ath__grid::getPoolWire() +Wire* Grid::getPoolWire() { int n; int getRecycleFlag = 0; - Ath__wire* w = _wirePoolPtr->alloc(&getRecycleFlag, &n); + Wire* w = _wirePoolPtr->alloc(&getRecycleFlag, &n); if (getRecycleFlag == 0) { w->_id = n; } return w; } -Ath__wire* Ath__grid::makeWire(Ath__wire* v, uint type) +Wire* Grid::makeWire(Wire* v, uint type) { - Ath__wire* w = getPoolWire(); + Wire* w = getPoolWire(); w->_srcId = 0; w->reset(); @@ -1787,7 +1776,7 @@ Ath__wire* Ath__grid::makeWire(Ath__wire* v, uint type) return w; } -uint Ath__grid::placeWire(Ath__searchBox* bb) +uint Grid::placeWire(SearchBox* bb) { uint d = !_dir; @@ -1803,9 +1792,9 @@ uint Ath__grid::placeWire(Ath__searchBox* bb) uint wireType = bb->getType(); - Ath__wire* w + Wire* w = makeWire(_dir, ll, ur, bb->getOwnerId(), bb->getOtherId(), wireType); - Ath__track* track; + Track* track; int TTTsubt = 1; if (TTTsubt) { track = getTrackPtr(trackNum1, _markerCnt, w->_base); @@ -1815,37 +1804,37 @@ uint Ath__grid::placeWire(Ath__searchBox* bb) // track->place2(w, m1, m2); track->place(w, m1); for (uint ii = trackNum1 + 1; ii <= trackNum2; ii++) { - Ath__wire* w1 = makeWire(w, wireType); + Wire* w1 = makeWire(w, wireType); w1->_srcId = w->_id; w1->_srcWire = w; _gridtable->incrMultiTrackWireCnt(w->isPower()); - Ath__track* track = getTrackPtr(ii, _markerCnt); + Track* track = getTrackPtr(ii, _markerCnt); track->place(w1, m1); } return trackNum1; } -uint Ath__grid::placeWire(Ath__wire* w) +uint Grid::placeWire(Wire* w) { uint m1 = getBucketNum(w->_xy); uint trackNum1 = getMinMaxTrackNum(w->_base); uint trackNum2 = getMinMaxTrackNum(w->_base + w->_width); - Ath__track* track = getTrackPtr(trackNum1, _markerCnt); + Track* track = getTrackPtr(trackNum1, _markerCnt); track->place(w, m1); for (uint ii = trackNum1 + 1; ii <= trackNum2; ii++) { - Ath__wire* w1 = makeWire(w, w->_flags); + Wire* w1 = makeWire(w, w->_flags); w1->_srcId = w->_id; _gridtable->incrMultiTrackWireCnt(w->isPower()); - Ath__track* track = getTrackPtr(ii, _markerCnt); + Track* track = getTrackPtr(ii, _markerCnt); track->place(w1, m1); } return trackNum1; } -uint Ath__grid::placeBox(dbBox* box, uint wtype, uint id) +uint Grid::placeBox(dbBox* box, uint wtype, uint id) { int ll[2] = {box->xMin(), box->yMin()}; int ur[2] = {box->xMax(), box->yMax()}; @@ -1867,22 +1856,22 @@ uint Ath__grid::placeBox(dbBox* box, uint wtype, uint id) if (id == 0) { id = box->getId(); } - Ath__wire* w = makeWire(_dir, ll, ur, id, 0, wtype); - Ath__track* track = getTrackPtr(trackNum1, _markerCnt); + Wire* w = makeWire(_dir, ll, ur, id, 0, wtype); + Track* track = getTrackPtr(trackNum1, _markerCnt); track->place(w, m1); for (uint ii = trackNum1 + 1; ii <= trackNum2; ii++) { - Ath__wire* w1 = makeWire(w); + Wire* w1 = makeWire(w); w1->_srcId = w->_id; _gridtable->incrMultiTrackWireCnt(w->isPower()); - Ath__track* track = getTrackPtr(ii, _markerCnt); + Track* track = getTrackPtr(ii, _markerCnt); track->place(w1, m1); } return trackNum1; } -uint Ath__grid::setExtrusionMarker() +uint Grid::setExtrusionMarker() { - Ath__track *track, *tstr; + Track *track, *tstr; uint cnt = 0; for (uint ii = 0; ii < _trackCnt; ii++) { track = _trackTable[ii]; @@ -1897,15 +1886,15 @@ uint Ath__grid::setExtrusionMarker() } return cnt; } -uint Ath__grid::placeBox(Ath__box* box) +uint Grid::placeBox(Box* box) { int ll[2] = {box->_xlo, box->_ylo}; int ur[2] = {box->_xhi, box->_yhi}; uint markIndex1; - Ath__wire* w = makeWire(ll, ur, box->getOwner(), &markIndex1); + Wire* w = makeWire(ll, ur, box->getOwner(), &markIndex1); - Ath__track* track = getTrackPtr(ll); + Track* track = getTrackPtr(ll); if (!track->place(w, markIndex1)) { fprintf(stdout, "OVERLAP placement\n"); @@ -1915,18 +1904,17 @@ uint Ath__grid::placeBox(Ath__box* box) return track->_num; } -Ath__wire* Ath__grid::getWirePtr(uint wireId) +Wire* Grid::getWirePtr(uint wireId) { return _wirePoolPtr->get(wireId); } -void Ath__grid::getBoxIds(Ath__array1D* wireIdTable, - Ath__array1D* idtable) +void Grid::getBoxIds(Array1D* wireIdTable, Array1D* idtable) { // remove duplicate entries for (uint ii = 0; ii < wireIdTable->getCnt(); ii++) { uint wid = wireIdTable->get(ii); - Ath__wire* w = getWirePtr(wid); + Wire* w = getWirePtr(wid); uint boxId = w->_boxId; if (w->_srcId > 0) { @@ -1942,7 +1930,7 @@ void Ath__grid::getBoxIds(Ath__array1D* wireIdTable, } for (uint jj = 0; jj < wireIdTable->getCnt(); jj++) { - Ath__wire* w = getWirePtr(wireIdTable->get(jj)); + Wire* w = getWirePtr(wireIdTable->get(jj)); w->_ext = 0; if (w->_srcId > 0) { @@ -1951,14 +1939,13 @@ void Ath__grid::getBoxIds(Ath__array1D* wireIdTable, } } } -void Ath__grid::getWireIds(Ath__array1D* wireIdTable, - Ath__array1D* idtable) +void Grid::getWireIds(Array1D* wireIdTable, Array1D* idtable) { // remove duplicate entries for (uint ii = 0; ii < wireIdTable->getCnt(); ii++) { uint wid = wireIdTable->get(ii); - Ath__wire* w = getWirePtr(wid); + Wire* w = getWirePtr(wid); if (w->_srcId > 0) { w = getWirePtr(w->_srcId); @@ -1973,7 +1960,7 @@ void Ath__grid::getWireIds(Ath__array1D* wireIdTable, } for (uint jj = 0; jj < wireIdTable->getCnt(); jj++) { - Ath__wire* w = getWirePtr(wireIdTable->get(jj)); + Wire* w = getWirePtr(wireIdTable->get(jj)); w->_ext = 0; if (w->_srcId > 0) { w = getWirePtr(w->_srcId); @@ -1981,11 +1968,9 @@ void Ath__grid::getWireIds(Ath__array1D* wireIdTable, } } } -uint Ath__grid::search(Ath__searchBox* bb, - Ath__array1D* idtable, - bool wireIdFlag) +uint Grid::search(SearchBox* bb, Array1D* idtable, bool wireIdFlag) { - Ath__array1D wireIdTable(16000); + Array1D wireIdTable(16000); // uint d= (_dir>0) ? 0 : 1; uint d = !_dir; @@ -2002,9 +1987,9 @@ uint Ath__grid::search(Ath__searchBox* bb, uint loMarker = getBucketNum(loXY); uint hiMarker = getBucketNum(hiXY); - Ath__track* tstrack; + Track* tstrack; for (uint ii = loTrackNum; ii <= hiTrackNum; ii++) { - Ath__track* track = _trackTable[ii]; + Track* track = _trackTable[ii]; if (track == nullptr) { continue; } @@ -2027,14 +2012,14 @@ uint Ath__grid::search(Ath__searchBox* bb, return idtable->getCnt(); } -uint Ath__grid::search(Ath__searchBox* bb, - const uint* gxy, - Ath__array1D* idtable, - Ath__grid* g) +uint Grid::search(SearchBox* bb, + const uint* gxy, + Array1D* idtable, + Grid* g) { - Ath__array1D wireIdTable(1024); + Array1D wireIdTable(1024); - AthPool* wirePool = _wirePoolPtr; + AthPool* wirePool = _wirePoolPtr; if (g != nullptr) { wirePool = g->getWirePoolPtr(); } @@ -2054,7 +2039,7 @@ uint Ath__grid::search(Ath__searchBox* bb, uint hiMarker = getBucketNum(hiXY); for (uint ii = loTrackNum; ii <= hiTrackNum; ii++) { - Ath__track* track = _trackTable[ii]; + Track* track = _trackTable[ii]; if (track == nullptr) { continue; } @@ -2065,8 +2050,8 @@ uint Ath__grid::search(Ath__searchBox* bb, continue; } - Ath__wire* w0 = _wirePoolPtr->get(wireIdTable.get(0)); - Ath__wire* w1 = w0->makeWire(wirePool, w0->_xy, w0->_len); + Wire* w0 = _wirePoolPtr->get(wireIdTable.get(0)); + Wire* w1 = w0->makeWire(wirePool, w0->_xy, w0->_len); if (g != nullptr) { g->placeWire(w1); @@ -2074,7 +2059,7 @@ uint Ath__grid::search(Ath__searchBox* bb, idtable->add(w1->_id); for (uint jj = 1; jj < cnt1; jj++) { - Ath__wire* w = _wirePoolPtr->get(wireIdTable.get(jj)); + Wire* w = _wirePoolPtr->get(wireIdTable.get(jj)); uint dist = w->_xy - (w1->_xy + w1->_len); if (dist <= gxy[d]) { @@ -2093,16 +2078,16 @@ uint Ath__grid::search(Ath__searchBox* bb, return idtable->getCnt(); } -void Ath__grid::getBuses(Ath__array1D* boxTable, uint width) +void Grid::getBuses(Array1D* boxTable, uint width) { - Ath__array1D wireTable(32); + Array1D wireTable(32); for (uint ii = 0; ii < _trackCnt; ii++) { if (_blockedTrackTable[ii] > 0) { continue; } - Ath__track* track = _trackTable[ii]; + Track* track = _trackTable[ii]; if (track == nullptr) { continue; } @@ -2117,12 +2102,12 @@ void Ath__grid::getBuses(Ath__array1D* boxTable, uint width) track->getAllWires(&wireTable, _markerCnt); for (uint jj = 0; jj < wireTable.getCnt(); jj++) { - Ath__wire* e = wireTable.get(jj); + Wire* e = wireTable.get(jj); if (!e->isTileBus()) { continue; } - Ath__box* bb = new Ath__box(); + Box* bb = new Box(); if (_dir > 0) { bb->set(e->_xy, height, e->_xy + e->_len, height + width); } else { @@ -2135,25 +2120,25 @@ void Ath__grid::getBuses(Ath__array1D* boxTable, uint width) } } } -Ath__wire* Ath__grid::getWire_Linear(uint id) +Wire* Grid::getWire_Linear(uint id) { for (uint ii = 0; ii < _trackCnt; ii++) { - Ath__track* tr = _trackTable[ii]; + Track* tr = _trackTable[ii]; if (tr == nullptr) { continue; } - Ath__wire* w = tr->getWire_Linear(_markerCnt, id); + Wire* w = tr->getWire_Linear(_markerCnt, id); if (w != nullptr) { return w; } } return nullptr; } -void Ath__grid::adjustOverlapMakerEnd() +void Grid::adjustOverlapMakerEnd() { int TTTnewAdj = 1; - Ath__track *track, *tstr; + Track *track, *tstr; for (uint ii = 0; ii < _trackCnt; ii++) { track = _trackTable[ii]; if (track == nullptr) { @@ -2171,11 +2156,11 @@ void Ath__grid::adjustOverlapMakerEnd() } } -bool Ath__grid::isOrdered(bool /* unused: ascending */, uint* cnt) +bool Grid::isOrdered(bool /* unused: ascending */, uint* cnt) { bool ordered = true; for (uint ii = 0; ii < _trackCnt; ii++) { - Ath__track* tr = _trackTable[ii]; + Track* tr = _trackTable[ii]; if (tr == nullptr) { continue; } @@ -2187,7 +2172,7 @@ bool Ath__grid::isOrdered(bool /* unused: ascending */, uint* cnt) } return ordered; } -uint Ath__grid::getBucketNum(int xy) +uint Grid::getBucketNum(int xy) { int offset = xy - _start; if (offset < 0) { @@ -2203,12 +2188,12 @@ uint Ath__grid::getBucketNum(int xy) } return b; } -uint Ath__grid::getWidth() +uint Grid::getWidth() { return _width; } -int Ath__grid::getXYbyWidth(int xy, uint* mark) +int Grid::getXYbyWidth(int xy, uint* mark) { int offset = xy - _start; if (offset < 0) { @@ -2224,7 +2209,7 @@ int Ath__grid::getXYbyWidth(int xy, uint* mark) } return a; } -uint Ath__grid::getTrackNum1(int xy) +uint Grid::getTrackNum1(int xy) { int a = xy - _base; @@ -2239,7 +2224,7 @@ uint Ath__grid::getTrackNum1(int xy) } return b; } -uint Ath__grid::getTrackNum(int* ll, uint d, uint* marker) +uint Grid::getTrackNum(int* ll, uint d, uint* marker) { *marker = getBucketNum(ll[d]); @@ -2255,7 +2240,7 @@ uint Ath__grid::getTrackNum(int* ll, uint d, uint* marker) } return b; } -uint Ath__grid::getTrackNum(Ath__box* box) +uint Grid::getTrackNum(Box* box) { int ll[2] = {box->_xlo, box->_ylo}; @@ -2266,14 +2251,9 @@ uint Ath__grid::getTrackNum(Ath__box* box) } return a / _pitch; } -Ath__wire* Ath__grid::makeWire(uint dir, - int* ll, - int* ur, - uint id1, - uint id2, - uint type) +Wire* Grid::makeWire(uint dir, int* ll, int* ur, uint id1, uint id2, uint type) { - Ath__wire* w = getPoolWire(); + Wire* w = getPoolWire(); w->_srcId = 0; w->_srcWire = nullptr; @@ -2286,7 +2266,7 @@ Ath__wire* Ath__grid::makeWire(uint dir, return w; } -Ath__wire* Ath__grid::makeWire(int* ll, int* ur, uint id, uint* m1) +Wire* Grid::makeWire(int* ll, int* ur, uint id, uint* m1) { uint d = (_dir > 0) ? 0 : 1; @@ -2294,7 +2274,7 @@ Ath__wire* Ath__grid::makeWire(int* ll, int* ur, uint id, uint* m1) // int xy2= ur[d]; *m1 = getBucketNum(xy1); - Ath__wire* w = getPoolWire(); + Wire* w = getPoolWire(); w->_srcId = 0; w->_otherId = 0; @@ -2304,18 +2284,18 @@ Ath__wire* Ath__grid::makeWire(int* ll, int* ur, uint id, uint* m1) return w; } -Ath__wire* Ath__grid::makeWire(Ath__box* box, - uint* id, - uint* m1, - uint* m2, - uint /* unused: fullTrack */) +Wire* Grid::makeWire(Box* box, + uint* id, + uint* m1, + uint* m2, + uint /* unused: fullTrack */) { int ll[2] = {box->_xlo, box->_ylo}; int ur[2] = {box->_xhi, box->_yhi}; *m1 = 0; *m2 = 3; - Ath__wire* w = getPoolWire(); + Wire* w = getPoolWire(); w->_otherId = 0; *id = w->_id; @@ -2326,13 +2306,13 @@ Ath__wire* Ath__grid::makeWire(Ath__box* box, return w; } -uint Ath__grid::getFirstTrack(uint divider) +uint Grid::getFirstTrack(uint divider) { int xy = _base + (_max - _base) / divider; return getAbsTrackNum(xy); } -int Ath__grid::getClosestTrackCoord(int xy) +int Grid::getClosestTrackCoord(int xy) { int track1 = getAbsTrackNum(xy); int ii; @@ -2361,7 +2341,7 @@ int Ath__grid::getClosestTrackCoord(int xy) } return h1 + _width / 2; } -int Ath__grid::findEmptyTrack(int ll[2], int ur[2]) +int Grid::findEmptyTrack(int ll[2], int ur[2]) { uint track1 = getAbsTrackNum(ll[_dir]); uint track2 = getAbsTrackNum(ur[_dir]); @@ -2371,7 +2351,7 @@ int Ath__grid::findEmptyTrack(int ll[2], int ur[2]) cnt++; continue; } - Ath__wire w; + Wire w; w.reset(); int xy1 = (ll[_dir % 1] - _start) / _width; @@ -2394,42 +2374,14 @@ int Ath__grid::findEmptyTrack(int ll[2], int ur[2]) return -1; } -bool Ath__intersect(int X1, int DX, int x1, int dx, int* ix1, int* ix2) +void GridTable::init1(uint memChunk, + uint rowSize, + uint colSize, + uint dx, + uint dy) { - *ix1 = X1; - *ix2 = X1 + DX; - - int dx1 = X1 - x1; - if (dx1 >= 0) { // on left side - int dlen = dx - dx1; - if (dlen <= 0) { - return false; - } - - if (dlen < DX) { - *ix2 = x1 + dx; - } - } else { - *ix1 = x1; - if (dx1 + DX <= 0) { // outside right side - return false; - } - - if (*ix2 > x1 + dx) { - *ix2 = x1 + dx; - } - } - return true; -} - -void Ath__gridTable::init1(uint memChunk, - uint rowSize, - uint colSize, - uint dx, - uint dy) -{ - _trackPool = new AthPool(memChunk); - _wirePool = new AthPool(memChunk * 1000); + _trackPool = new AthPool(memChunk); + _wirePool = new AthPool(memChunk * 1000); _wirePool->alloc(); // so all wire ids>0 @@ -2442,13 +2394,13 @@ void Ath__gridTable::init1(uint memChunk, resetMaxArea(); } -Ath__gridTable::Ath__gridTable(Ath__box* bb, - uint rowSize, - uint colSize, - uint layer, - uint dir, - uint width, - uint pitch) +GridTable::GridTable(Box* bb, + uint rowSize, + uint colSize, + uint layer, + uint dir, + uint width, + uint pitch) { init1(1024, rowSize, colSize, bb->getDX(), bb->getDY()); _bbox.set(bb); @@ -2468,10 +2420,10 @@ Ath__gridTable::Ath__gridTable(Ath__box* bb, _signalMultiTrackWire = 0; _bandWire = nullptr; - _gridTable = new Ath__grid**[_rowCnt]; + _gridTable = new Grid**[_rowCnt]; int y1 = bb->_ylo; for (uint ii = 0; ii < _rowCnt; ii++) { - _gridTable[ii] = new Ath__grid*[_colCnt]; + _gridTable[ii] = new Grid*[_colCnt]; int y2 = y1 + rowSize; int x1 = bb->_xlo; @@ -2479,9 +2431,9 @@ Ath__gridTable::Ath__gridTable(Ath__box* bb, int x2 = x1 + colSize; uint num = ii * 1000 + jj; - Ath__box box; + Box box; box.set(x1, y1, x2, y2); - _gridTable[ii][jj] = new Ath__grid( + _gridTable[ii][jj] = new Grid( this, _trackPool, _wirePool, &box, layer, dir, num, width, pitch, 32); x1 = x2; @@ -2489,14 +2441,14 @@ Ath__gridTable::Ath__gridTable(Ath__box* bb, y1 = y2; } } -Ath__gridTable::Ath__gridTable(dbBox* bb, - uint rowSize, - uint colSize, - uint layer, - uint dir, - uint width, - uint pitch, - uint minWidth) +GridTable::GridTable(dbBox* bb, + uint rowSize, + uint colSize, + uint layer, + uint dir, + uint width, + uint pitch, + uint minWidth) { init1(1024, rowSize, colSize, bb->getDX(), bb->getDY()); _rectBB = bb->getBox(); @@ -2519,10 +2471,10 @@ Ath__gridTable::Ath__gridTable(dbBox* bb, uint maxCellNumPerMarker = 16; uint markerCnt = (bb->getDX() / minWidth) / maxCellNumPerMarker; - _gridTable = new Ath__grid**[_rowCnt]; + _gridTable = new Grid**[_rowCnt]; int y1 = bb->yMin(); for (uint ii = 0; ii < _rowCnt; ii++) { - _gridTable[ii] = new Ath__grid*[_colCnt]; + _gridTable[ii] = new Grid*[_colCnt]; int y2 = y1 + rowSize; int x1 = bb->xMin(); @@ -2531,7 +2483,7 @@ Ath__gridTable::Ath__gridTable(dbBox* bb, uint num = ii * 1000 + jj; // Rect rectBB(x1, y1, x2, y2); _gridTable[ii][jj] - = new Ath__grid(this, _trackPool, _wirePool, layer, num, markerCnt); + = new Grid(this, _trackPool, _wirePool, layer, num, markerCnt); _gridTable[ii][jj]->setTracks(dir, width, pitch, x1, y1, x2, y2); _gridTable[ii][jj]->setSchema(_schema); @@ -2540,30 +2492,30 @@ Ath__gridTable::Ath__gridTable(dbBox* bb, y1 = y2; } } -void Ath__gridTable::releaseWire(uint wireId) +void GridTable::releaseWire(uint wireId) { - Ath__wire* w = _wirePool->get(wireId); + Wire* w = _wirePool->get(wireId); _wirePool->free(w); } -Ath__wire* Ath__gridTable::getWirePtr(uint id) +Wire* GridTable::getWirePtr(uint id) { return _wirePool->get(id); } -uint Ath__gridTable::getRowCnt() +uint GridTable::getRowCnt() { return _rowCnt; } -uint Ath__gridTable::getColCnt() +uint GridTable::getColCnt() { return _colCnt; } -void Ath__gridTable::dumpTrackCounts(FILE* fp) +void GridTable::dumpTrackCounts(FILE* fp) { fprintf(fp, "Multiple_track_power_wires : %d\n", _powerMultiTrackWire); fprintf(fp, "Multiple_track_signal_wires : %d\n", _signalMultiTrackWire); fprintf(fp, "layer dir alloc live offbase expand tsubtn toptk stn\n"); - Ath__grid* tgrid; + Grid* tgrid; uint topBigTrack = 0; uint topSubtNum; uint totalSubtNum; @@ -2632,14 +2584,14 @@ void Ath__gridTable::dumpTrackCounts(FILE* fp) texpand, ttsubtn); } -Ath__gridTable::Ath__gridTable(Rect* bb, - uint rowCnt, - uint colCnt, - uint* /* unused: width */, - uint* pitch, - uint* /* unused: spacing */, - const int* X1, - const int* Y1) +GridTable::GridTable(Rect* bb, + uint rowCnt, + uint colCnt, + uint* /* unused: width */, + uint* pitch, + uint* /* unused: spacing */, + const int* X1, + const int* Y1) { // for net wires init1(1024, bb->dy(), bb->dx(), bb->dx(), bb->dy()); @@ -2670,16 +2622,15 @@ Ath__gridTable::Ath__gridTable(Rect* bb, int x2 = bb->xMax(); int y2 = bb->yMax(); - _gridTable = new Ath__grid**[_rowCnt]; + _gridTable = new Grid**[_rowCnt]; for (uint ii = 0; ii < _rowCnt; ii++) { - _gridTable[ii] = new Ath__grid*[_colCnt]; + _gridTable[ii] = new Grid*[_colCnt]; _gridTable[ii][0] = nullptr; for (uint jj = 1; jj < _colCnt; jj++) { uint num = ii * 1000 + jj; - _gridTable[ii][jj] - = new Ath__grid(this, _trackPool, _wirePool, jj, num, 10); + _gridTable[ii][jj] = new Grid(this, _trackPool, _wirePool, jj, num, 10); x1 = X1 ? X1[jj] : bb->xMin(); y1 = Y1 ? Y1[jj] : bb->yMin(); _gridTable[ii][jj]->setTracks( @@ -2689,12 +2640,12 @@ Ath__gridTable::Ath__gridTable(Rect* bb, } } -Ath__gridTable::Ath__gridTable(Rect* bb, - uint layer, - uint dir, - uint width, - uint pitch, - uint minWidth) +GridTable::GridTable(Rect* bb, + uint layer, + uint dir, + uint width, + uint pitch, + uint minWidth) { init1(1024, bb->dy(), bb->dx(), bb->dx(), bb->dy()); _colCnt = 1; @@ -2722,19 +2673,18 @@ Ath__gridTable::Ath__gridTable(Rect* bb, markerCnt = 1; } - Ath__grid* g - = new Ath__grid(this, _trackPool, _wirePool, layer, 1, markerCnt); + Grid* g = new Grid(this, _trackPool, _wirePool, layer, 1, markerCnt); g->setTracks( dir, width, pitch, bb->xMin(), bb->yMin(), bb->xMax(), bb->yMax()); g->setSchema(_schema); - _gridTable = new Ath__grid**[1]; - _gridTable[0] = new Ath__grid*[1]; + _gridTable = new Grid**[1]; + _gridTable[0] = new Grid*[1]; _gridTable[0][0] = g; } -Ath__gridTable::~Ath__gridTable() +GridTable::~GridTable() { delete _trackPool; delete _wirePool; @@ -2747,35 +2697,35 @@ Ath__gridTable::~Ath__gridTable() } delete[] _gridTable; } -int Ath__gridTable::xMin() +int GridTable::xMin() { if (_schema > 0) { return _rectBB.xMin(); } return _bbox._xlo; } -int Ath__gridTable::xMax() +int GridTable::xMax() { if (_schema > 0) { return _rectBB.xMax(); } return _bbox._xhi; } -int Ath__gridTable::yMin() +int GridTable::yMin() { if (_schema > 0) { return _rectBB.yMin(); } return _bbox._ylo; } -int Ath__gridTable::yMax() +int GridTable::yMax() { if (_schema > 0) { return _rectBB.yMax(); } return _bbox._yhi; } -uint Ath__gridTable::getRowNum(int y) +uint GridTable::getRowNum(int y) { int dy = y - yMin(); if (dy < 0) { @@ -2783,7 +2733,7 @@ uint Ath__gridTable::getRowNum(int y) } return dy / _rowSize; } -uint Ath__gridTable::getColNum(int x) +uint GridTable::getColNum(int x) { int dx = x - xMin(); if (dx < 0) { @@ -2792,24 +2742,24 @@ uint Ath__gridTable::getColNum(int x) return dx / _colSize; } -uint Ath__gridTable::search(Ath__searchBox* bb, - uint row, - uint col, - Ath__array1D* idTable, - bool wireIdFlag) +uint GridTable::search(SearchBox* bb, + uint row, + uint col, + Array1D* idTable, + bool wireIdFlag) { return _gridTable[row][col]->search(bb, idTable, wireIdFlag); } -uint Ath__gridTable::search(Ath__searchBox* bb, - uint* gxy, - uint row, - uint col, - Ath__array1D* idtable, - Ath__grid* g) +uint GridTable::search(SearchBox* bb, + uint* gxy, + uint row, + uint col, + Array1D* idtable, + Grid* g) { return _gridTable[row][col]->search(bb, gxy, idtable, g); } -uint Ath__gridTable::search(Ath__searchBox* bb, Ath__array1D* idTable) +uint GridTable::search(SearchBox* bb, Array1D* idTable) { uint row1 = getRowNum(bb->loXY(1)); if (row1 > 0) { @@ -2832,7 +2782,7 @@ uint Ath__gridTable::search(Ath__searchBox* bb, Ath__array1D* idTable) } return 0; } -bool Ath__gridTable::getRowCol(int x1, int y1, uint* row, uint* col) +bool GridTable::getRowCol(int x1, int y1, uint* row, uint* col) { *row = getRowNum(y1); if (*row >= _rowCnt) { @@ -2846,7 +2796,7 @@ bool Ath__gridTable::getRowCol(int x1, int y1, uint* row, uint* col) } return true; } -uint Ath__gridTable::setExtrusionMarker(uint startRow, uint startCol) +uint GridTable::setExtrusionMarker(uint startRow, uint startCol) { uint cnt = 0; for (uint ii = startRow; ii < _rowCnt; ii++) { @@ -2856,21 +2806,21 @@ uint Ath__gridTable::setExtrusionMarker(uint startRow, uint startCol) } return cnt; } -AthPool* Ath__grid::getWirePoolPtr() +AthPool* Grid::getWirePoolPtr() { return _wirePoolPtr; } -uint Ath__grid::removeMarkedNetWires() +uint Grid::removeMarkedNetWires() { uint cnt = 0; for (uint ii = 0; ii < _trackCnt; ii++) { - Ath__track* btrack = _trackTable[ii]; + Track* btrack = _trackTable[ii]; if (btrack == nullptr) { continue; } - Ath__track* track = nullptr; + Track* track = nullptr; bool tohi = true; while ((track = btrack->getNextSubTrack(track, tohi)) != nullptr) { cnt += track->removeMarkedNetWires(); @@ -2879,29 +2829,29 @@ uint Ath__grid::removeMarkedNetWires() return cnt; } -Ath__grid* Ath__gridTable::getGrid(uint row, uint col) +Grid* GridTable::getGrid(uint row, uint col) { return _gridTable[row][col]; } -bool Ath__gridTable::addBox(uint row, uint col, dbBox* bb) +bool GridTable::addBox(uint row, uint col, dbBox* bb) { - Ath__grid* g = _gridTable[row][col]; + Grid* g = _gridTable[row][col]; g->placeBox(bb, 0, 0); return true; } -Ath__wire* Ath__gridTable::addBox(dbBox* bb, uint wtype, uint id) +Wire* GridTable::addBox(dbBox* bb, uint wtype, uint id) { uint row = 0; uint col = 0; - Ath__grid* g = _gridTable[row][col]; + Grid* g = _gridTable[row][col]; g->placeBox(bb, wtype, id); return nullptr; } -Ath__wire* Ath__gridTable::addBox(Ath__box* bb) +Wire* GridTable::addBox(Box* bb) { uint row; uint col; @@ -2909,19 +2859,19 @@ Ath__wire* Ath__gridTable::addBox(Ath__box* bb) return nullptr; } - Ath__grid* g = _gridTable[row][col]; + Grid* g = _gridTable[row][col]; g->placeBox(bb); return nullptr; } -Ath__wire* Ath__gridTable::getWire_Linear(uint instId) +Wire* GridTable::getWire_Linear(uint instId) { // bool ordered= true; // uint cnt= 0; for (uint ii = 0; ii < _rowCnt; ii++) { for (uint jj = 0; jj < _colCnt; jj++) { - Ath__wire* w = _gridTable[ii][jj]->getWire_Linear(instId); + Wire* w = _gridTable[ii][jj]->getWire_Linear(instId); if (w != nullptr) { return w; } @@ -2929,7 +2879,7 @@ Ath__wire* Ath__gridTable::getWire_Linear(uint instId) } return nullptr; } -void Ath__gridTable::adjustOverlapMakerEnd() +void GridTable::adjustOverlapMakerEnd() { if (_overlapAdjust != Z_endAdjust) { return; @@ -2943,7 +2893,7 @@ void Ath__gridTable::adjustOverlapMakerEnd() } } -void Ath__gridTable::incrNotAlignedOverlap(Ath__wire* w1, Ath__wire* w2) +void GridTable::incrNotAlignedOverlap(Wire* w1, Wire* w2) { if (w1->isPower() != w2->isPower()) { _signalPowerNotAlignedOverlap++; @@ -2953,23 +2903,23 @@ void Ath__gridTable::incrNotAlignedOverlap(Ath__wire* w1, Ath__wire* w2) _signalNotAlignedOverlap++; } } -void Ath__gridTable::incrSignalOverlap() +void GridTable::incrSignalOverlap() { _signalOverlap++; } -void Ath__gridTable::incrPowerOverlap() +void GridTable::incrPowerOverlap() { _powerOverlap++; } -void Ath__gridTable::incrSignalToPowerOverlap() +void GridTable::incrSignalToPowerOverlap() { _signalPowerOverlap++; } -void Ath__gridTable::incrPowerToSignallOverlap() +void GridTable::incrPowerToSignallOverlap() { _powerSignalOverlap++; } -void Ath__gridTable::incrMultiTrackWireCnt(bool isPower) +void GridTable::incrMultiTrackWireCnt(bool isPower) { if (isPower) { _powerMultiTrackWire++; @@ -2977,7 +2927,7 @@ void Ath__gridTable::incrMultiTrackWireCnt(bool isPower) _signalMultiTrackWire++; } } -bool Ath__gridTable::isOrdered(bool /* unused: ascending */) +bool GridTable::isOrdered(bool /* unused: ascending */) { bool ordered = true; @@ -3000,39 +2950,39 @@ bool Ath__gridTable::isOrdered(bool /* unused: ascending */) return ordered; } -void Ath__gridTable::removeMarkedNetWires() +void GridTable::removeMarkedNetWires() { uint cnt = 0; for (uint jj = 1; jj < _colCnt; jj++) { for (int ii = _rowCnt - 1; ii >= 0; ii--) { - Ath__grid* netGrid = _gridTable[ii][jj]; + Grid* netGrid = _gridTable[ii][jj]; cnt += netGrid->removeMarkedNetWires(); } } fprintf(stdout, "remove %d sdb wires.\n", cnt); } -void Ath__gridTable::setExtControl(dbBlock* block, - bool useDbSdb, - uint adj, - uint npsrc, - uint nptgt, - uint ccUp, - bool allNet, - uint contextDepth, - Ath__array1D** contextArray, - Ath__array1D*** dgContextArray, - uint* dgContextDepth, - uint* dgContextPlanes, - uint* dgContextTracks, - uint* dgContextBaseLvl, - int* dgContextLowLvl, - int* dgContextHiLvl, - uint* dgContextBaseTrack, - int* dgContextLowTrack, - int* dgContextHiTrack, - int** dgContextTrackBase, - AthPool* seqPool) +void GridTable::setExtControl(dbBlock* block, + bool useDbSdb, + uint adj, + uint npsrc, + uint nptgt, + uint ccUp, + bool allNet, + uint contextDepth, + Array1D** contextArray, + Array1D*** dgContextArray, + uint* dgContextDepth, + uint* dgContextPlanes, + uint* dgContextTracks, + uint* dgContextBaseLvl, + int* dgContextLowLvl, + int* dgContextHiLvl, + uint* dgContextBaseTrack, + int* dgContextLowTrack, + int* dgContextHiTrack, + int** dgContextTrackBase, + AthPool* seqPool) { _block = block; _useDbSdb = useDbSdb; @@ -3062,51 +3012,51 @@ void Ath__gridTable::setExtControl(dbBlock* block, _dgContextTrackBase = dgContextTrackBase; _seqPool = seqPool; } -void Ath__gridTable::reverseTargetTrack() +void GridTable::reverseTargetTrack() { _CCtargetHighTracks = _CCtargetHighTracks == 2 ? 0 : 2; _targetTrackReversed = _targetTrackReversed ? false : true; } -void Ath__gridTable::setMaxArea(int x1, int y1, int x2, int y2) +void GridTable::setMaxArea(int x1, int y1, int x2, int y2) { _maxSearchBox.set(x1, y1, x2, y2, 1); _setMaxArea = true; } -void Ath__gridTable::resetMaxArea() +void GridTable::resetMaxArea() { _setMaxArea = false; _maxSearchBox.invalidateBox(); } -void Ath__gridTable::getBox(uint wid, - int* x1, - int* y1, - int* x2, - int* y2, - uint* level, - uint* id1, - uint* id2, - uint* wtype) +void GridTable::getBox(uint wid, + int* x1, + int* y1, + int* x2, + int* y2, + uint* level, + uint* id1, + uint* id2, + uint* wireType) { - Ath__wire* w = getWirePtr(wid); + Wire* w = getWirePtr(wid); *id1 = w->_boxId; *id2 = w->_otherId; - *wtype = w->_flags; + *wireType = w->_flags; *level = w->_track->getGrid()->getLevel(); uint dir; w->getCoords(x1, y1, x2, y2, &dir); } -uint Ath__gridTable::addBox(int x1, - int y1, - int x2, - int y2, - uint level, - uint id1, - uint id2, - uint wireType) +uint GridTable::addBox(int x1, + int y1, + int x2, + int y2, + uint level, + uint id1, + uint id2, + uint wireType) { - Ath__searchBox bb(x1, y1, x2, y2, level); + SearchBox bb(x1, y1, x2, y2, level); bb.setOwnerId(id1, id2); bb.setType(wireType); @@ -3115,44 +3065,44 @@ uint Ath__gridTable::addBox(int x1, _wireCnt++; return trackNum; } -uint Ath__gridTable::getWireCnt() +uint GridTable::getWireCnt() { return _wireCnt; } -uint Ath__gridTable::search(int x1, - int y1, - int x2, - int y2, - uint row, - uint col, - Ath__array1D* idTable, - bool /* unused: wireIdFlag */) +uint GridTable::search(int x1, + int y1, + int x2, + int y2, + uint row, + uint col, + Array1D* idTable, + bool /* unused: wireIdFlag */) { - Ath__searchBox bb(x1, y1, x2, y2, col, row); + SearchBox bb(x1, y1, x2, y2, col, row); return search(&bb, row, col, idTable, true); // single grid } -void Ath__gridTable::getCoords(Ath__searchBox* bb, uint wireId) +void GridTable::getCoords(SearchBox* bb, uint wireId) { - Ath__wire* w = getWirePtr(wireId); + Wire* w = getWirePtr(wireId); w->getCoords(bb); } -void Ath__gridTable::getCCdist(uint wid, - uint* width, - uint* len, - uint* id1, - uint* id2) +void GridTable::getCCdist(uint wid, + uint* width, + uint* len, + uint* id1, + uint* id2) { - Ath__wire* w = getWirePtr(wid); + Wire* w = getWirePtr(wid); *width = w->_width; *len = w->_len; *id1 = w->_boxId; *id2 = w->_otherId; } -void Ath__gridTable::getIds(uint wid, uint* id1, uint* id2, uint* wtype) +void GridTable::getIds(uint wid, uint* id1, uint* id2, uint* wtype) { - Ath__wire* w = getWirePtr(wid); + Wire* w = getWirePtr(wid); *wtype = w->_flags; *id1 = w->_boxId; diff --git a/src/rcx/src/gs.cpp b/src/rcx/src/gs.cpp index c2bd7e95f48..92e0f23ef0f 100644 --- a/src/rcx/src/gs.cpp +++ b/src/rcx/src/gs.cpp @@ -396,7 +396,7 @@ uint gs::get_seq(int* ll, int* ur, uint order, uint plane, - odb::Ath__array1D* array) + odb::Array1D* array) { if (check_slice(plane) != 0) { return 0; diff --git a/src/rcx/src/name.cpp b/src/rcx/src/name.cpp index d7e75bfea31..8e09619e461 100644 --- a/src/rcx/src/name.cpp +++ b/src/rcx/src/name.cpp @@ -47,7 +47,7 @@ class NameTable::NameBucket friend class NameTable; }; -static void Ath__hashError(const char* msg, int exitFlag) +static void hashError(const char* msg, int exitFlag) { fprintf(stderr, "Cannot find %s in hash table\n", msg); fprintf(stderr, "\nexiting ...\n"); @@ -140,7 +140,7 @@ uint NameTable::getDataId(const char* name, return 0; } - Ath__hashError(name, exitFlag); + hashError(name, exitFlag); return 0; } diff --git a/src/rcx/src/netRC.cpp b/src/rcx/src/netRC.cpp index 6c12e66bedb..ae9631a3b3d 100644 --- a/src/rcx/src/netRC.cpp +++ b/src/rcx/src/netRC.cpp @@ -1107,14 +1107,14 @@ void extMain::getExtractedCorners() return; } - Ath__parser parser(logger_); + Parser parser(logger_); uint pCornerCnt = parser.mkWords(_prevControl->_extractedCornerList.c_str(), " "); if (pCornerCnt <= 0) { return; } - _processCornerTable = new Ath__array1D(); + _processCornerTable = new Array1D(); uint cornerCnt = 0; uint ii, jj; @@ -1139,7 +1139,7 @@ void extMain::getExtractedCorners() } if (_scaledCornerTable == nullptr) { - _scaledCornerTable = new Ath__array1D(); + _scaledCornerTable = new Array1D(); } for (ii = 0; ii < sCornerCnt; ii++) { @@ -1163,7 +1163,7 @@ void extMain::getExtractedCorners() t->_dbIndex = cornerCnt++; _scaledCornerTable->add(t); } - Ath__array1D A; + Array1D A; parser.mkWords(_prevControl->_resFactorList.c_str(), " "); parser.getDoubleArray(&A, 0); @@ -1197,7 +1197,7 @@ void extMain::makeCornerMapFromExtControl() return; } - Ath__parser parser(logger_); + Parser parser(logger_); uint wordCnt = parser.mkWords(_prevControl->_cornerIndexList.c_str(), " "); if (wordCnt <= 0) { return; @@ -1227,7 +1227,7 @@ char* extMain::addRCCorner(const char* name, int model, int userDefined) model = model - 100; } if (_processCornerTable == nullptr) { - _processCornerTable = new Ath__array1D(); + _processCornerTable = new Array1D(); } for (uint ii = 0; ii < _processCornerTable->getCnt(); ii++) { @@ -1308,7 +1308,7 @@ char* extMain::addRCCornerScaled(const char* name, return nullptr; } if (_scaledCornerTable == nullptr) { - _scaledCornerTable = new Ath__array1D(); + _scaledCornerTable = new Array1D(); } uint ii = 0; @@ -2098,7 +2098,7 @@ int extSpef::getWriteCorner(int corner, const char* names) _active_corner_cnt = 0; int cn = 0; - Ath__parser parser(logger_); + Parser parser(logger_); parser.mkWords(names, nullptr); for (int ii = 0; ii < parser.getWordCnt(); ii++) { cn = _block->getExtCornerIndex(parser.get(ii)); diff --git a/src/rcx/src/wire.h b/src/rcx/src/wire.h index fe3d0c7ae16..dad5b1e5aef 100644 --- a/src/rcx/src/wire.h +++ b/src/rcx/src/wire.h @@ -44,24 +44,24 @@ namespace rcx { -using odb::Ath__array1D; +using odb::Array1D; using odb::AthPool; using odb::dbBlock; using odb::dbBox; using odb::dbNet; using odb::Rect; -enum Ath__overlapAdjust +enum OverlapAdjust { Z_noAdjust, Z_merge, Z_endAdjust }; -class Ath__track; +class Track; struct SEQ; -class Ath__searchBox +class SearchBox { private: int _ll[2]; @@ -73,10 +73,10 @@ class Ath__searchBox uint _type; public: - Ath__searchBox(int x1, int y1, int x2, int y2, uint l, int dir = -1); - Ath__searchBox(Ath__box* bb, uint l, int dir = -1); - Ath__searchBox(Ath__searchBox* bb, uint l, int dir = -1); - Ath__searchBox(); + SearchBox(int x1, int y1, int x2, int y2, uint l, int dir = -1); + SearchBox(Box* bb, uint l, int dir = -1); + SearchBox(SearchBox* bb, uint l, int dir = -1); + SearchBox(); void set(int x1, int y1, int x2, int y2, uint l, int dir); void setMidPointSearch(); int loXY(uint d); @@ -98,17 +98,17 @@ class Ath__searchBox uint getLength(); }; -class Ath__wire +class Wire { private: uint _id; uint _srcId; // TODO-OPTIMIZE uint _boxId; uint _otherId; - Ath__wire* _srcWire; // OpenRCX + Wire* _srcWire; // OpenRCX - Ath__track* _track; - Ath__wire* _next; + Track* _track; + Wire* _next; int _xy; // TODO offset from track start in large dimension int _len; @@ -131,11 +131,11 @@ class Ath__wire void reset(); // void set(int xy1, int xy2); void set(uint dir, const int* ll, const int* ur); - void search(int xy1, int xy2, uint& cnt, Ath__array1D* idTable); - void search1(int xy1, int xy2, uint& cnt, Ath__array1D* idTable); + void search(int xy1, int xy2, uint& cnt, Array1D* idTable); + void search1(int xy1, int xy2, uint& cnt, Array1D* idTable); - void setNext(Ath__wire* w) { _next = w; }; - Ath__wire* getNext() { return _next; }; + void setNext(Wire* w) { _next = w; }; + Wire* getNext() { return _next; }; uint getFlags() { return _flags; }; uint getBoxId(); void setExt(uint ext) { _ext = ext; }; @@ -149,53 +149,53 @@ class Ath__wire bool isTileBus(); uint getOwnerId(); uint getSrcId(); - void getCoords(Ath__searchBox* box); + void getCoords(SearchBox* box); int getXY() { return _xy; } void getCoords(int* x1, int* y1, int* x2, int* y2, uint* dir); - friend class Ath__track; - friend class Ath__grid; - friend class Ath__gridTable; + friend class Track; + friend class Grid; + friend class GridTable; // Extraction void printOneWire(FILE* ptfile); void printWireNeighbor(uint met, - Ath__array1D* topNeighbor, - Ath__array1D* botNeighbor); - int wireOverlap(Ath__wire* w, int* len1, int* len2, int* len3); - Ath__wire* getPoolWire(AthPool* wirePool); - Ath__wire* makeWire(AthPool* wirePool, int xy1, uint len); - Ath__wire* makeCoupleWire(AthPool* wirePool, - int targetHighTracks, - Ath__wire* w2, - int xy1, - uint len, - uint wtype); + Array1D* topNeighbor, + Array1D* botNeighbor); + int wireOverlap(Wire* w, int* len1, int* len2, int* len3); + Wire* getPoolWire(AthPool* wirePool); + Wire* makeWire(AthPool* wirePool, int xy1, uint len); + Wire* makeCoupleWire(AthPool* wirePool, + int targetHighTracks, + Wire* w2, + int xy1, + uint len, + uint wtype); void setXY(int xy1, uint len); dbNet* getNet(); }; -class Ath__grid; +class Grid; -class Ath__track +class Track { private: int _x; // you need only one int _y; int _base; - Ath__track* _hiTrack; - Ath__track* _lowTrack; + Track* _hiTrack; + Track* _lowTrack; - Ath__wire** _marker; - Ath__wire** _eMarker; + Wire** _marker; + Wire** _eMarker; uint _markerCnt; uint _searchMarkerIndex; uint _targetMarker; - Ath__wire* _targetWire; + Wire* _targetWire; - Ath__grid* _grid; + Grid* _grid; uint _num : 20; @@ -209,7 +209,7 @@ class Ath__track public: uint getTrackNum() { return _num; }; - void set(Ath__grid* g, + void set(Grid* g, int x, int y, uint n, @@ -217,92 +217,89 @@ class Ath__track uint markerLen, uint markerCnt, int base); - void freeWires(AthPool* pool); - bool place(Ath__wire* w, int markIndex1, int markIndex2); - bool place(Ath__wire* w, int markIndex1); + void freeWires(AthPool* pool); + bool place(Wire* w, int markIndex1, int markIndex2); + bool place(Wire* w, int markIndex1); uint setExtrusionMarker(int markerCnt, int start, uint markerLen); - bool placeTrail(Ath__wire* w, uint m1, uint m2); + bool placeTrail(Wire* w, uint m1, uint m2); - bool overlapCheck(Ath__wire* w, int markIndex1, int markIndex2); + bool overlapCheck(Wire* w, int markIndex1, int markIndex2); bool isAscendingOrdered(uint markerCnt, uint* wCnt); - Ath__grid* getGrid(); - Ath__wire* getWire_Linear(uint markerCnt, uint id); - Ath__wire* getNextWire(Ath__wire* wire); + Grid* getGrid(); + Wire* getWire_Linear(uint markerCnt, uint id); + Wire* getNextWire(Wire* wire); uint search(int xy1, int xy2, uint markIndex1, uint markIndex2, - Ath__array1D* idtable); + Array1D* idtable); uint search1(int xy1, int xy2, uint markIndex1, uint markIndex2, - Ath__array1D* idTable); + Array1D* idTable); - bool checkAndplace(Ath__wire* w, int markIndex1); + bool checkAndplace(Wire* w, int markIndex1); bool checkMarker(int markIndex); - bool checkAndplacerOnMarker(Ath__wire* w, int markIndex); - uint getAllWires(Ath__array1D* boxTable, uint markerCnt); + bool checkAndplacerOnMarker(Wire* w, int markIndex); + uint getAllWires(Array1D* boxTable, uint markerCnt); void resetExtFlag(uint markerCnt); - void linkWire(Ath__wire*& w1, Ath__wire*& w2); + void linkWire(Wire*& w1, Wire*& w2); - Ath__track* getNextSubTrack(Ath__track* subt, bool tohi); + Track* getNextSubTrack(Track* subt, bool tohi); int getBase() { return _base; }; - void setHiTrack(Ath__track* hitrack); - void setLowTrack(Ath__track* lowtrack); - Ath__track* getHiTrack(); - Ath__track* getLowTrack(); - Ath__track* nextTrackInRange(uint& delt, - uint trackDist, - uint srcTrack, - bool tohi); - int nextSubTrackInRange(Ath__track*& tstrack, + void setHiTrack(Track* hitrack); + void setLowTrack(Track* lowtrack); + Track* getHiTrack(); + Track* getLowTrack(); + Track* nextTrackInRange(uint& delt, uint trackDist, uint srcTrack, bool tohi); + int nextSubTrackInRange(Track*& tstrack, uint& delt, uint trackDist, uint srcTrack, bool tohi); void setLowest(uint lst) { _lowest = lst; }; - friend class Ath__gridTable; - friend class Ath__grid; - friend class Ath__wire; + friend class GridTable; + friend class Grid; + friend class Wire; uint removeMarkedNetWires(); // EXTRACTION - bool place2(Ath__wire* w, int mark1, int mark2); - void insertWire(Ath__wire* w, int mark1, int mark2); + bool place2(Wire* w, int mark1, int mark2); + void insertWire(Wire* w, int mark1, int mark2); uint initTargetTracks(uint srcTrack, uint trackDist, bool tohi); - void findNeighborWire(Ath__wire*, Ath__array1D*, bool); - void getTrackWires(std::vector& ctxwire); - void buildDgContext(Ath__array1D* dgContext, - Ath__wire**& allWire, + void findNeighborWire(Wire*, Array1D*, bool); + void getTrackWires(std::vector& ctxwire); + void buildDgContext(Array1D* dgContext, + Wire**& allWire, int& awcnt, int& awsize); - int getBandWires(Ath__array1D* bandWire); - uint couplingCaps(Ath__grid* ccGrid, + int getBandWires(Array1D* bandWire); + uint couplingCaps(Grid* ccGrid, uint srcTrack, uint trackDist, uint ccThreshold, - Ath__array1D* ccIdTable, + Array1D* ccIdTable, uint met, CoupleAndCompute coupleAndCompute, void* compPtr); - uint findOverlap(Ath__wire* origWire, + uint findOverlap(Wire* origWire, uint ccThreshold, - Ath__array1D* wTable, - Ath__array1D* nwTable, - Ath__grid* ccGrid, - Ath__array1D* ccTable, + Array1D* wTable, + Array1D* nwTable, + Grid* ccGrid, + Array1D* ccTable, uint met, CoupleAndCompute coupleAndCompute, void* compPtr); void initTargetWire(int noPowerWire); - Ath__wire* nextTargetWire(int noPowerWire); - Ath__wire* getTargetWire(); + Wire* nextTargetWire(int noPowerWire); + Wire* getTargetWire(); void adjustOverlapMakerEnd(uint markerCnt); void adjustOverlapMakerEnd(uint markerCnt, int start, uint markerLen); uint trackContextOn(int orig, @@ -310,17 +307,17 @@ class Ath__track int base, int width, uint firstContextTrack, - Ath__array1D* context); + Array1D* context); - void dealloc(AthPool* pool); + void dealloc(AthPool* pool); }; -class Ath__gridTable; +class GridTable; -class Ath__grid +class Grid { private: - Ath__gridTable* _gridtable; - Ath__track** _trackTable; + GridTable* _gridtable; + Track** _trackTable; uint* _blockedTrackTable; uint _trackCnt; uint* _subTrackCnt; @@ -347,8 +344,8 @@ class Ath__grid uint _widthTable[8]; uint _shiftTable[8]; - AthPool* _trackPoolPtr; - AthPool* _wirePoolPtr; + AthPool* _trackPoolPtr; + AthPool* _wirePoolPtr; uint _schema; uint _wireType; @@ -357,25 +354,25 @@ class Ath__grid uint _lastFreeTrack; public: - Ath__grid(Ath__gridTable* gt, - AthPool* trackPool, - AthPool* wirePool, - Ath__box* bb, - uint level, - uint dir, - uint num, - uint width, - uint pitch, - uint markerCnt = 4); - Ath__grid(Ath__gridTable* gt, - AthPool* trackPool, - AthPool* wirePool, - uint level, - uint num, - uint markerCnt); - ~Ath__grid(); - - Ath__gridTable* getGridTable() { return _gridtable; }; + Grid(GridTable* gt, + AthPool* trackPool, + AthPool* wirePool, + Box* bb, + uint level, + uint dir, + uint num, + uint width, + uint pitch, + uint markerCnt = 4); + Grid(GridTable* gt, + AthPool* trackPool, + AthPool* wirePool, + uint level, + uint num, + uint markerCnt); + ~Grid(); + + GridTable* getGridTable() { return _gridtable; }; void setBoundaries(uint dir, int xlo, int ylo, int xhi, int yhi); void setTracks(uint dir, uint width, @@ -391,52 +388,43 @@ class Ath__grid bool anyTrackAvailable(); - uint addWireList(Ath__box* box); + uint addWireList(Box* list); uint getTrackCnt() { return _trackCnt; }; - Ath__track* getTrackPtr(uint n) { return _trackTable[n]; }; + Track* getTrackPtr(uint n) { return _trackTable[n]; }; uint getTrackNum1(int xy); uint getWidth(); int getXYbyWidth(int xy, uint* mark); - Ath__track* addTrack(uint ii, uint markerCnt, int base); - Ath__track* addTrack(uint ii, uint markerCnt); + Track* addTrack(uint ii, uint markerCnt, int base); + Track* addTrack(uint ii, uint markerCnt); void makeTracks(uint space, uint width); - void getBbox(Ath__box* bb); - void getBbox(Ath__searchBox* bb); + void getBbox(Box* bb); + void getBbox(SearchBox* bb); uint setExtrusionMarker(); - uint addWire(Ath__box* box, int check); - uint addWire(Ath__box* box); + uint addWire(Box* box, int check); + uint addWire(Box* box); - uint placeWire(Ath__searchBox* bb); + uint placeWire(SearchBox* bb); uint placeBox(uint id, int x1, int y1, int x2, int y2); uint placeBox(dbBox* box, uint wtype, uint id); - uint placeBox(Ath__box* box); - uint placeBox(Ath__searchBox* bb); + uint placeBox(Box* box); + uint placeBox(SearchBox* bb); uint getBucketNum(int xy); uint getTrackNum(int* ll, uint d, uint* marker); - Ath__wire* getWirePtr(uint wireId); - void getBoxIds(Ath__array1D* wireIdTable, Ath__array1D* idtable); - void getWireIds(Ath__array1D* wireIdTable, Ath__array1D* idtable); + Wire* getWirePtr(uint wireId); + void getBoxIds(Array1D* wireIdTable, Array1D* idtable); + void getWireIds(Array1D* wireIdTable, Array1D* idtable); int findEmptyTrack(int ll[2], int ur[2]); uint getFirstTrack(uint divider); int getClosestTrackCoord(int xy); - uint addWire(uint initTrack, Ath__box* box, int sortedOrder, int* height); - Ath__wire* getPoolWire(); - Ath__wire* makeWire(Ath__box* box, - uint* id, - uint* m1, - uint* m2, - uint fullTrack); - Ath__wire* makeWire(Ath__box* box, uint id, uint* m1); - Ath__wire* makeWire(int* ll, int* ur, uint id, uint* m1); - Ath__wire* makeWire(uint dir, - int* ll, - int* ur, - uint id1, - uint id2, - uint type = 0); - - Ath__wire* makeWire(Ath__wire* w, uint type = 0); + uint addWire(uint initTrack, Box* box, int sortedOrder, int* height); + Wire* getPoolWire(); + Wire* makeWire(Box* box, uint* id, uint* m1, uint* m2, uint fullTrack); + Wire* makeWire(Box* box, uint id, uint* m1); + Wire* makeWire(int* ll, int* ur, uint id, uint* m1); + Wire* makeWire(uint dir, int* ll, int* ur, uint id1, uint id2, uint type = 0); + + Wire* makeWire(Wire* v, uint type = 0); void makeTrackTable(uint width, uint pitch, uint space = 0); float updateFreeTracks(float v); @@ -444,35 +432,33 @@ class Ath__grid void freeTracksAndTables(); uint getAbsTrackNum(int xy); uint getMinMaxTrackNum(int xy); - bool addOnTrack(uint track, Ath__wire* w, uint mark1, uint mark2); + bool addOnTrack(uint track, Wire* w, uint mark1, uint mark2); int getTrackHeight(uint track); - uint getTrackNum(Ath__box* box); - Ath__track* getTrackPtr(int* ll); - Ath__track* getTrackPtr(int xy); - Ath__track* getTrackPtr(uint ii, uint markerCnt, int base); - Ath__track* getTrackPtr(uint ii, uint markerCnt); + uint getTrackNum(Box* box); + Track* getTrackPtr(int* ll); + Track* getTrackPtr(int xy); + Track* getTrackPtr(uint ii, uint markerCnt, int base); + Track* getTrackPtr(uint ii, uint markerCnt); bool isOrdered(bool ascending, uint* cnt); - uint search(Ath__searchBox* bb, - Ath__array1D* idtable, - bool wireIdFlag = false); + uint search(SearchBox* bb, Array1D* idtable, bool wireIdFlag = false); uint placeWire(uint initTrack, - Ath__wire* w, + Wire* w, uint mark1, uint mark2, int sortedOrder, int* height); - void getBoxes(Ath__array1D* table); - uint getBoxes(uint ii, Ath__array1D* table); + void getBoxes(Array1D* table); + uint getBoxes(uint trackIndex, Array1D* table); uint getDir(); uint getLevel(); - Ath__wire* getWire_Linear(uint id); + Wire* getWire_Linear(uint id); - void getBuses(Ath__array1D* boxtable, uint width); + void getBuses(Array1D* boxtable, uint width); - friend class Ath__gridTable; + friend class GridTable; uint removeMarkedNetWires(); void setSearchDomain(uint domainAdjust); @@ -484,21 +470,18 @@ class Ath__grid int getBandWires(int hiXY, uint couplingDist, uint& wireCnt, - Ath__array1D* bandWire, + Array1D* bandWire, int* limitArray); - uint couplingCaps(Ath__grid* resGrid, + uint couplingCaps(Grid* resGrid, uint couplingDist, - Ath__array1D* ccTable, + Array1D* ccTable, CoupleAndCompute coupleAndCompute, void* compPtr); - AthPool* getWirePoolPtr(); - uint placeWire(Ath__wire* w); + AthPool* getWirePoolPtr(); + uint placeWire(Wire* w); uint defaultWireType(); void setDefaultWireType(uint v); - uint search(Ath__searchBox* bb, - const uint* gxy, - Ath__array1D* idtable, - Ath__grid* g); + uint search(SearchBox* bb, const uint* gxy, Array1D* idtable, Grid* g); void adjustOverlapMakerEnd(); void initContextGrids(); void initContextTracks(); @@ -520,20 +503,20 @@ class Ath__grid void dealloc(); }; -class Ath__gridTable +class GridTable { private: - Ath__grid*** _gridTable; - Ath__box _bbox; - Ath__box _maxSearchBox; + Grid*** _gridTable; + Box _bbox; + Box _maxSearchBox; bool _setMaxArea; Rect _rectBB; uint _rowCnt; uint _colCnt; uint _rowSize; uint _colSize; - AthPool* _trackPool; - AthPool* _wirePool; + AthPool* _trackPool; + AthPool* _wirePool; uint _schema; uint _overlapAdjust; uint _powerMultiTrackWire; @@ -552,10 +535,10 @@ class Ath__gridTable uint _ccContextDepth; - Ath__array1D** _ccContextArray; + Array1D** _ccContextArray; AthPool* _seqPool; - Ath__array1D*** _dgContextArray; // array + Array1D*** _dgContextArray; // array uint* _dgContextDepth; // not array uint* _dgContextPlanes; // not array @@ -580,68 +563,68 @@ class Ath__gridTable uint _wireCnt; - Ath__array1D* _bandWire; + Array1D* _bandWire; public: - Ath__gridTable(Ath__box* bb, - uint rowSize, - uint colSize, - uint layer, - uint dir, - uint width, - uint pitch); - Ath__gridTable(dbBox* bb, - uint rowSize, - uint colSize, - uint layer, - uint dir, - uint width, - uint pitch, - uint minWidth); - Ath__gridTable(Rect* bb, - uint layer, - uint dir, - uint width, - uint pitch, - uint minWidth); - Ath__gridTable(Rect* bb, - uint rowCnt, - uint colCnt, - uint* width, - uint* pitch, - uint* spacing, - const int* X1 = nullptr, - const int* Y1 = nullptr); - ~Ath__gridTable(); - Ath__grid* getGrid(uint row, uint col); + GridTable(Box* bb, + uint rowSize, + uint colSize, + uint layer, + uint dir, + uint width, + uint pitch); + GridTable(dbBox* bb, + uint rowSize, + uint colSize, + uint layer, + uint dir, + uint width, + uint pitch, + uint minWidth); + GridTable(Rect* bb, + uint layer, + uint dir, + uint width, + uint pitch, + uint minWidth); + GridTable(Rect* bb, + uint rowCnt, + uint colCnt, + uint* width, + uint* pitch, + uint* spacing, + const int* X1 = nullptr, + const int* Y1 = nullptr); + ~GridTable(); + Grid* getGrid(uint row, uint col); void init1(uint memChunk, uint rowSize, uint colSize, uint dx, uint dy); uint getColCnt(); uint getRowCnt(); - Ath__wire* getWirePtr(uint id); + Wire* getWirePtr(uint id); void releaseWire(uint wireId); - Ath__box* maxSearchBox() { return &_maxSearchBox; }; + Box* maxSearchBox() { return &_maxSearchBox; }; int xMin(); int xMax(); int yMin(); int yMax(); - uint getRowNum(int x); - uint getColNum(int y); + uint getRowNum(int y); + uint getColNum(int x); bool getRowCol(int x1, int y1, uint* row, uint* col); - Ath__wire* addBox(Ath__box* bb); - Ath__wire* addBox(dbBox* bb, uint wtype, uint id); + Wire* addBox(Box* bb); + Wire* addBox(dbBox* bb, uint wtype, uint id); bool addBox(uint row, uint col, dbBox* bb); uint setExtrusionMarker(uint startRow, uint startCol); - uint getBoxes(Ath__box* bb, Ath__array1D* table); + uint getBoxes(Box* bb, Array1D* table); bool isOrdered(bool ascending); - uint search(Ath__searchBox* bb, + uint search(SearchBox* bb, uint row, uint col, - Ath__array1D* idTable, + Array1D* idTable, bool wireIdFlag); - uint search(Ath__searchBox* bb, Ath__array1D* idTable); - uint search(Ath__box* bb); - Ath__wire* getWire_Linear(uint instId); + uint search(SearchBox* bb, Array1D* idTable); + uint search(Box* bb); + Wire* getWire_Linear(uint instId); uint addBox(int x1, int y1, @@ -657,9 +640,9 @@ class Ath__gridTable int y2, uint row, uint col, - Ath__array1D* idTable, + Array1D* idTable, bool wireIdFlag); - void getCoords(Ath__searchBox* bb, uint wireId); + void getCoords(SearchBox* bb, uint wireId); void setMaxArea(int x1, int y1, int x2, int y2); void resetMaxArea(); @@ -669,13 +652,13 @@ class Ath__gridTable void setDefaultWireType(uint v); void buildDgContext(int base, uint level, uint dir); - Ath__array1D* renewDgContext(uint gridn, uint trackn); - uint couplingCaps(Ath__gridTable* resGridTable, + Array1D* renewDgContext(uint gridn, uint trackn); + uint couplingCaps(GridTable* resGridTable, uint couplingDist, - Ath__array1D* ccTable, + Array1D* ccTable, CoupleAndCompute coupleAndCompute, void* compPtr); - uint couplingCaps(uint row, uint col, Ath__grid* resGrid, uint couplingDist); + uint couplingCaps(uint row, uint col, Grid* resGrid, uint couplingDist); void getBox(uint wid, int* x1, int* y1, @@ -685,14 +668,14 @@ class Ath__gridTable uint* id1, uint* id2, uint* wireType); - void getCCdist(uint wid, uint* width, uint* level, uint* id1, uint* id2); + void getCCdist(uint wid, uint* width, uint* len, uint* id1, uint* id2); void getIds(uint wid, uint* id1, uint* id2, uint* wtype); - uint search(Ath__searchBox* bb, + uint search(SearchBox* bb, uint* gxy, uint row, uint col, - Ath__array1D* idtable, - Ath__grid* g); + Array1D* idtable, + Grid* g); uint getOverlapAdjust() { return _overlapAdjust; }; uint getOverlapTouchCheck() { return _overlapTouchCheck; }; uint targetHighTracks() { return _CCtargetHighTracks; }; @@ -700,9 +683,9 @@ class Ath__gridTable void setCCFlag(uint ccflag) { _ccFlag = ccflag; }; uint getCcFlag() { return _ccFlag; }; uint contextDepth() { return _ccContextDepth; }; - Ath__array1D** contextArray() { return _ccContextArray; }; + Array1D** contextArray() { return _ccContextArray; }; AthPool* seqPool() { return _seqPool; }; - Ath__array1D*** dgContextArray() { return _dgContextArray; }; + Array1D*** dgContextArray() { return _dgContextArray; }; int** dgContextTrackBase() { return _dgContextTrackBase; }; uint* dgContextBaseTrack() { return _dgContextBaseTrack; }; int* dgContextLowTrack() { return _dgContextLowTrack; }; @@ -727,8 +710,8 @@ class Ath__gridTable uint ccUp, bool allNet, uint contextDepth, - Ath__array1D** contextArray, - Ath__array1D*** dgContextArray, + Array1D** contextArray, + Array1D*** dgContextArray, uint* dgContextDepth, uint* dgContextPlanes, uint* dgContextTracks, @@ -743,7 +726,7 @@ class Ath__gridTable bool usingDbSdb() { return _useDbSdb; } void reverseTargetTrack(); bool targetTrackReversed() { return _targetTrackReversed; }; - void incrNotAlignedOverlap(Ath__wire* w1, Ath__wire* w2); + void incrNotAlignedOverlap(Wire* w1, Wire* w2); void incrSignalOverlap(); void incrPowerOverlap(); void incrSignalToPowerOverlap(); diff --git a/src/rsz/src/RepairDesign.cc b/src/rsz/src/RepairDesign.cc index 3c418c79608..c385e98b195 100644 --- a/src/rsz/src/RepairDesign.cc +++ b/src/rsz/src/RepairDesign.cc @@ -470,7 +470,7 @@ bool RepairDesign::performGainBuffering(Net* net, std::pair sort_label(const StaState* sta) const { - return std::make_pair(required(sta), -level); + return {required(sta), -level}; } float capacitance(const Network* network) diff --git a/src/stt/include/stt/SteinerTreeBuilder.h b/src/stt/include/stt/SteinerTreeBuilder.h index 3242cf44bab..c471c791148 100644 --- a/src/stt/include/stt/SteinerTreeBuilder.h +++ b/src/stt/include/stt/SteinerTreeBuilder.h @@ -78,9 +78,6 @@ struct Tree class SteinerTreeBuilder { public: - SteinerTreeBuilder(); - ~SteinerTreeBuilder() = default; - void init(odb::dbDatabase* db, Logger* logger); Tree makeSteinerTree(const std::vector& x, @@ -113,13 +110,13 @@ class SteinerTreeBuilder int computeHPWL(odb::dbNet* net); const int flute_accuracy = 3; - float alpha_; + float alpha_{0.3}; std::map net_alpha_map_; - std::pair min_fanout_alpha_; - std::pair min_hpwl_alpha_; + std::pair min_fanout_alpha_{0, -1}; + std::pair min_hpwl_alpha_{0, -1}; - Logger* logger_; - odb::dbDatabase* db_; + Logger* logger_{nullptr}; + odb::dbDatabase* db_{nullptr}; }; // Used by regressions. diff --git a/src/stt/src/SteinerTreeBuilder.cpp b/src/stt/src/SteinerTreeBuilder.cpp index 3605f813b51..3c616635dbd 100644 --- a/src/stt/src/SteinerTreeBuilder.cpp +++ b/src/stt/src/SteinerTreeBuilder.cpp @@ -46,15 +46,6 @@ namespace stt { static void reportSteinerBranches(const stt::Tree& tree, Logger* logger); -SteinerTreeBuilder::SteinerTreeBuilder() - : alpha_(0.3), - min_fanout_alpha_({0, -1}), - min_hpwl_alpha_({0, -1}), - logger_(nullptr), - db_(nullptr) -{ -} - void SteinerTreeBuilder::init(odb::dbDatabase* db, Logger* logger) { db_ = db; diff --git a/src/tap/src/tapcell.cpp b/src/tap/src/tapcell.cpp index 9017093a1f1..6dccc76e016 100644 --- a/src/tap/src/tapcell.cpp +++ b/src/tap/src/tapcell.cpp @@ -50,8 +50,6 @@ namespace tap { -using std::max; -using std::min; using std::string; using std::vector; @@ -441,7 +439,9 @@ bool Tapcell::checkSymmetry(odb::dbMaster* master, const odb::dbOrientType& ori) std::vector Tapcell::getBoundaryAreas() const { - using namespace boost::polygon::operators; + using boost::polygon::operators::operator+=; + using boost::polygon::operators::operator-=; + using boost::polygon::operators::operator&; using Polygon90Set = boost::polygon::polygon_90_set_data; auto rect_to_poly = [](const odb::Rect& rect) -> Polygon90 { diff --git a/src/upf/src/upf.cpp b/src/upf/src/upf.cpp index e83ab3a61c7..13d20c6b719 100644 --- a/src/upf/src/upf.cpp +++ b/src/upf/src/upf.cpp @@ -1485,8 +1485,7 @@ bool add_level_shifter_element(utl::Logger* logger, return false; } - std::string _element(element); - ls->addElement(_element); + ls->addElement(element); return true; } diff --git a/src/utl/include/utl/Logger.h b/src/utl/include/utl/Logger.h index 1b3cbc83ab9..cff961abf66 100644 --- a/src/utl/include/utl/Logger.h +++ b/src/utl/include/utl/Logger.h @@ -310,9 +310,9 @@ class Logger using MessageCounter = std::array; std::array message_counters_; std::array debug_group_level_; - bool debug_on_; - std::atomic_int warning_count_; - std::atomic_int error_count_; + bool debug_on_{false}; + std::atomic_int warning_count_{0}; + std::atomic_int error_count_{0}; static constexpr const char* level_names[] = {"TRACE", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL", "OFF"}; static constexpr const char* pattern_ = "%v"; diff --git a/src/utl/include/utl/Metrics.h b/src/utl/include/utl/Metrics.h index f3de330c5d2..11acec5f5bd 100644 --- a/src/utl/include/utl/Metrics.h +++ b/src/utl/include/utl/Metrics.h @@ -61,7 +61,7 @@ class MetricsPolicy public: MetricsPolicy(const std::string& key_pattern, MetricsPolicyType policy, - bool repeating_use_exact_match); + bool repeating_use_regex); void applyPolicy(std::list& entries); @@ -73,7 +73,7 @@ class MetricsPolicy private: std::regex pattern_regex_; - bool matching(std::string key); + bool matching(const std::string& key); }; } // namespace utl diff --git a/src/utl/include/utl/ScopedTemporaryFile.h b/src/utl/include/utl/ScopedTemporaryFile.h index c2231538b26..e2d64a76b33 100644 --- a/src/utl/include/utl/ScopedTemporaryFile.h +++ b/src/utl/include/utl/ScopedTemporaryFile.h @@ -32,7 +32,7 @@ #pragma once -#include +#include #include #include diff --git a/src/utl/src/Logger.cpp b/src/utl/src/Logger.cpp index df55f28e6f9..a43507eb034 100644 --- a/src/utl/src/Logger.cpp +++ b/src/utl/src/Logger.cpp @@ -46,21 +46,21 @@ namespace utl { Logger::Logger(const char* log_filename, const char* metrics_filename) - : debug_on_(false), warning_count_(0), error_count_(0) - { sinks_.push_back(std::make_shared()); - if (log_filename) + if (log_filename) { sinks_.push_back( std::make_shared(log_filename)); + } logger_ = std::make_shared( "logger", sinks_.begin(), sinks_.end()); logger_->set_pattern(pattern_); logger_->set_level(spdlog::level::level_enum::debug); - if (metrics_filename) + if (metrics_filename) { addMetricsSink(metrics_filename); + } metrics_policies_ = MetricsPolicy::makeDefaultPolicies(); @@ -78,7 +78,7 @@ Logger::~Logger() void Logger::addMetricsSink(const char* metrics_filename) { - metrics_sinks_.push_back(metrics_filename); + metrics_sinks_.emplace_back(metrics_filename); } void Logger::removeMetricsSink(const char* metrics_filename) @@ -97,8 +97,9 @@ ToolId Logger::findToolId(const char* tool_name) { int tool_id = 0; for (const char* tool : tool_names_) { - if (strcmp(tool_name, tool) == 0) + if (strcmp(tool_name, tool) == 0) { return static_cast(tool_id); + } tool_id++; } return UKN; @@ -145,10 +146,11 @@ void Logger::removeSink(spdlog::sink_ptr sink) void Logger::setMetricsStage(std::string_view format) { - if (metrics_stages_.empty()) + if (metrics_stages_.empty()) { metrics_stages_.push(std::string(format)); - else + } else { metrics_stages_.top() = format; + } } void Logger::clearMetricsStage() @@ -168,16 +170,15 @@ std::string Logger::popMetricsStage() std::string stage = metrics_stages_.top(); metrics_stages_.pop(); return stage; - } else { - return ""; - } + } + return {}; } void Logger::flushMetrics() { const std::string json = MetricsEntry::assembleJSON(metrics_entries_); - for (std::string sink_path : metrics_sinks_) { + for (const std::string& sink_path : metrics_sinks_) { std::ofstream sink_file(sink_path); if (sink_file) { sink_file << json; diff --git a/src/utl/src/Metrics.cpp b/src/utl/src/Metrics.cpp index b951873503b..dd9b4fc3843 100644 --- a/src/utl/src/Metrics.cpp +++ b/src/utl/src/Metrics.cpp @@ -44,8 +44,8 @@ namespace utl { std::string MetricsEntry::assembleJSON(const std::list& entries) { std::string json = "{"; - std::string separator = ""; - for (MetricsEntry entry : entries) { + std::string separator; + for (const MetricsEntry& entry : entries) { json += fmt::format("{}\n\t\"{}\": {}", separator, entry.key, entry.value); separator = ","; } @@ -63,12 +63,12 @@ MetricsPolicy::MetricsPolicy(const std::string& key_pattern, pattern_regex_ = std::regex(pattern_); } -bool MetricsPolicy::matching(std::string key) +bool MetricsPolicy::matching(const std::string& key) { - if (repeating_use_regex_) + if (repeating_use_regex_) { return std::regex_match(key, pattern_regex_); - else - return pattern_.compare(key) == 0; + } + return pattern_ == key; } void MetricsPolicy::applyPolicy(std::list& entries) @@ -81,8 +81,9 @@ void MetricsPolicy::applyPolicy(std::list& entries) auto copy_iter = iter; iter++; if (matching(copy_iter->key)) { - if (matched) + if (matched) { entries.erase(copy_iter); + } matched = true; } } @@ -94,8 +95,9 @@ void MetricsPolicy::applyPolicy(std::list& entries) std::list::iterator last; for (auto iter = entries.begin(); iter != entries.end(); iter++) { if (matching(iter->key)) { - if (matched) + if (matched) { entries.erase(last); + } last = iter; matched = true; }