Skip to content

Commit

Permalink
iop: clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Liberty committed Jan 14, 2021
1 parent e3861fb commit 1f9c422
Show file tree
Hide file tree
Showing 12 changed files with 702 additions and 480 deletions.
30 changes: 16 additions & 14 deletions src/ioPlacer/include/ioplacer/IOPlacer.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace odb {
class dbDatabase;
class dbTech;
class dbBlock;
}
} // namespace odb

namespace ppl {

Expand Down Expand Up @@ -86,9 +86,7 @@ struct Interval
int begin;
int end;
Interval() = default;
Interval(Edge edg, int b, int e) :
edge(edg), begin(b), end(e)
{}
Interval(Edge edg, int b, int e) : edge(edg), begin(b), end(e) {}
Edge getEdge() { return edge; }
int getBegin() { return begin; }
int getEnd() { return end; }
Expand All @@ -99,9 +97,10 @@ struct Constraint
std::string name;
Direction direction;
Interval interval;
Constraint(std::string name, Direction dir, Interval interv) :
name(name), direction(dir), interval(interv)
{}
Constraint(std::string name, Direction dir, Interval interv)
: name(name), direction(dir), interval(interv)
{
}
};

class IOPlacer
Expand All @@ -116,10 +115,11 @@ class IOPlacer
Parameters* getParameters() { return parms_; }
int returnIONetsHPWL();
void excludeInterval(Edge edge, int begin, int end);
void addDirectionConstraint(Direction direction, Edge edge,
int begin, int end);
void addNameConstraint(std::string name, Edge edge,
int begin, int end);
void addDirectionConstraint(Direction direction,
Edge edge,
int begin,
int end);
void addNameConstraint(std::string name, Edge edge, int begin, int end);
void addHorLayer(int layer) { hor_layers_.insert(layer); }
void addVerLayer(int layer) { ver_layers_.insert(layer); }
Edge getEdge(std::string edge);
Expand All @@ -144,7 +144,8 @@ class IOPlacer
private:
void makeComponents();
void deleteComponents();
void initNetlistAndCore(std::set<int> hor_layer_idx, std::set<int> ver_layer_idx);
void initNetlistAndCore(std::set<int> hor_layer_idx,
std::set<int> ver_layer_idx);
void initIOLists();
void initParms();
void randomPlacement(const RandomMode);
Expand All @@ -160,14 +161,15 @@ class IOPlacer
bool checkBlocked(Edge edge, int pos);

// db functions
void populateIOPlacer(std::set<int> hor_layer_idx, std::set<int> ver_layer_idx);
void populateIOPlacer(std::set<int> hor_layer_idx,
std::set<int> ver_layer_idx);
void commitIOPlacementToDB(std::vector<IOPin>& assignment);
void initCore(std::set<int> hor_layer_idxs, std::set<int> ver_layer_idxs);
void initNetlist();
void initTracks();

ord::OpenRoad* openroad_;
Logger *logger_;
Logger* logger_;
Parameters* parms_;
Netlist netlist_io_pins_;
SlotVector slots_;
Expand Down
1 change: 1 addition & 0 deletions src/ioPlacer/src/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
///////////////////////////////////////////////////////////////////////////////

#include "Core.h"

#include <algorithm>

namespace ppl {
Expand Down
12 changes: 9 additions & 3 deletions src/ioPlacer/src/HungarianMatching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@
///////////////////////////////////////////////////////////////////////////////

#include "HungarianMatching.h"

#include "utility/Logger.h"

namespace ppl {

HungarianMatching::HungarianMatching(Section& section, SlotVector& slots, Logger *logger)
HungarianMatching::HungarianMatching(Section& section,
SlotVector& slots,
Logger* logger)
: netlist_(section.net), slots_(slots)
{
num_io_pins_ = netlist_.numIOPins();
Expand Down Expand Up @@ -96,8 +99,11 @@ void HungarianMatching::getFinalAssignment(std::vector<IOPin>& assigment)
continue;
}
if (hungarian_matrix_[row][col] == hungarian_fail) {
logger_->warn(utl::PPL, 33, "I/O pin {} cannot be placed in the specified region. Not enough space",
io_pin.getName().c_str());
logger_->warn(utl::PPL,
33,
"I/O pin {} cannot be placed in the specified region. "
"Not enough space",
io_pin.getName().c_str());
}
io_pin.setPos(slots_[slot_index].pos);
io_pin.setLayer(slots_[slot_index].layer);
Expand Down
6 changes: 3 additions & 3 deletions src/ioPlacer/src/HungarianMatching.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
#include <utility>

#include "Hungarian.h"
#include "ioplacer/IOPlacer.h"
#include "Netlist.h"
#include "Slots.h"
#include "ioplacer/IOPlacer.h"

namespace utl {
class Logger;
Expand All @@ -72,12 +72,12 @@ class HungarianMatching
int non_blocked_slots_;
Edge edge_;
const int hungarian_fail = std::numeric_limits<int>::max();
Logger *logger_;
Logger* logger_;

void createMatrix(std::vector<Constraint>& constraints);

public:
HungarianMatching(Section&, SlotVector&, Logger *logger);
HungarianMatching(Section&, SlotVector&, Logger* logger);
virtual ~HungarianMatching() = default;
void findAssignment(std::vector<Constraint>& constraints);
void getFinalAssignment(std::vector<IOPin>&);
Expand Down
Loading

0 comments on commit 1f9c422

Please sign in to comment.