Skip to content

Commit

Permalink
Merge branch 'master' into scandef
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Garay <fgaray@google.com>
  • Loading branch information
fgaray committed Jul 20, 2024
2 parents 40e5d0b + d48987e commit 973432d
Show file tree
Hide file tree
Showing 93 changed files with 12,304 additions and 806 deletions.
23 changes: 16 additions & 7 deletions etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _versionCompare() {
}

_equivalenceDeps() {
yosysVersion=yosys-0.42
yosysVersion=yosys-0.43

# yosys
yosysPrefix=${PREFIX:-"/usr/local"}
Expand Down Expand Up @@ -580,15 +580,24 @@ _installCI() {
parallel \
software-properties-common \
unzip
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

# Add Docker's official GPG key:
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
-o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null

apt-get -y update
apt-get -y install --no-install-recommends \
containerd.io \
docker-ce \
docker-ce-cli
docker-ce-cli \
containerd.io \
docker-buildx-plugin
}

_checkIsLocal() {
Expand Down
2 changes: 1 addition & 1 deletion etc/DockerHelper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ _test() {

_create() {
echo "Create docker image ${imagePath} using ${file}"
eval docker build \
eval docker buildx build \
--file "${file}" \
--tag "${imagePath}" \
${buildArgs} \
Expand Down
10 changes: 5 additions & 5 deletions jenkins/Jenkinsfile.coverage
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@Library('utils@or-v2.0.1') _

timeout(time: 1, unit: 'HOURS') {
timeout(time: 2, unit: 'HOURS') {
node {

stage('Checkout'){
Expand Down Expand Up @@ -40,10 +40,10 @@ timeout(time: 1, unit: 'HOURS') {
}
}
}
}

stage('Send Email Report') {
sendEmail();
}
stage('Send Email Report') {
sendEmail();
}

}
}
1 change: 0 additions & 1 deletion src/dbSta/src/dbNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,6 @@ ObjectId dbNetwork::id(const Pin* pin) const
dbModITerm* moditerm = nullptr;
dbModBTerm* modbterm = nullptr;

static std::map<ObjectId, void*> id_ptr_map;
staToDb(pin, iterm, bterm, moditerm, modbterm);

if (hierarchy_) {
Expand Down
1 change: 1 addition & 0 deletions src/dpl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ add_library(dpl_lib
src/Padding.cpp
src/Place.cpp
src/FillerPlacement.cpp
src/DecapPlacement.cpp
src/OptMirror.cpp
)

Expand Down
37 changes: 37 additions & 0 deletions src/dpl/include/dpl/Opendp.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ struct DbuRect;

using dbMasterSeq = vector<dbMaster*>;

using IRDropByPoint = std::map<odb::Point, double>;
struct GapInfo;
struct DecapCell;
struct IRDrop;
////////////////////////////////////////////////////////////////

class Opendp
Expand Down Expand Up @@ -155,6 +159,10 @@ class Opendp
void removeFillers();
void optimizeMirroring();

// Place decap cells
void addDecapMaster(dbMaster* decap_master, double decap_cap);
void insertDecapCells(double target, IRDropByPoint& psm_ir_drops);

private:
using bgPoint
= boost::geometry::model::d2::point_xy<int,
Expand All @@ -169,6 +177,9 @@ class Opendp
using GapFillers = vector<dbMasterSeq>;

using MasterByImplant = std::map<dbTechLayer*, dbMasterSeq>;

using YCoordToGap = std::map<int, vector<GapInfo*>>;

friend class OpendpTest_IsPlaced_Test;
friend class Graphics;
void findDisplacementStats();
Expand Down Expand Up @@ -314,6 +325,26 @@ class Opendp
bool isOneSiteCell(odb::dbMaster* db_master) const;
const char* gridInstName(GridY row, GridX col, const GridInfo& grid_info);

// Place decaps
vector<int> findDecapCellIndices(const int& gap_width,
const double& current,
const double& target);
void insertDecapInPos(dbMaster* master,
const odb::dbOrientType& orient,
const int& pos_x,
const int& pos_y);
void insertDecapInRow(const vector<GapInfo*>& gaps,
int gap_y,
int irdrop_x,
int irdrop_y,
double& total,
const double& target);
void findGaps();
void findGapsInRow(GridY row, DbuY row_height, const GridInfo& grid_info);
void mapToVectorIRDrops(IRDropByPoint& psm_ir_drops,
std::vector<IRDrop>& ir_drops);
void prepareDecapAndGaps();

Logger* logger_ = nullptr;
dbDatabase* db_ = nullptr;
dbBlock* block_ = nullptr;
Expand Down Expand Up @@ -342,13 +373,19 @@ class Opendp
bool have_fillers_ = false;
bool have_one_site_cells_ = false;

// Decap placement.
vector<DecapCell*> decap_masters_;
int decap_count_ = 0;
YCoordToGap gaps_;

// Results saved for optional reporting.
int64_t hpwl_before_ = 0;
int64_t displacement_avg_ = 0;
int64_t displacement_sum_ = 0;
int64_t displacement_max_ = 0;

std::unique_ptr<DplObserver> debug_observer_;
std::unique_ptr<Cell> dummy_cell_;

// Magic numbers
static constexpr int bin_search_width_ = 10;
Expand Down
73 changes: 73 additions & 0 deletions src/dpl/src/DecapObjects.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2024, Precision Innovations Inc.
// All rights reserved.
//
// BSD 3-Clause License
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
///////////////////////////////////////////////////////////////////////////////

#pragma once

#include "dpl/Opendp.h"

namespace dpl {

struct GapInfo
{
int x;
odb::dbOrientType orient;
int width;
int height;
bool is_filled{false};
GapInfo(int x, const odb::dbOrientType& orient, int width, int height)
: x(x), orient(orient), width(width), height(height)
{
}
};

struct DecapCell
{
dbMaster* master;
double capacitance;
DecapCell(dbMaster* master, double& capacitance)
: master(master), capacitance(capacitance)
{
}
};

struct IRDrop
{
odb::Point position;
double value;
IRDrop(const odb::Point& position, double& value)
: position(position), value(value)
{
}
};

} // namespace dpl
Loading

0 comments on commit 973432d

Please sign in to comment.