Skip to content

Commit

Permalink
timing: integrate c2c delays and cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanG077 committed Sep 16, 2024
1 parent 57f014e commit 0334ca2
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 113 deletions.
10 changes: 5 additions & 5 deletions common/kernel/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ delay_t Context::predictArcDelay(const NetInfo *net_info, const PortRef &sink) c

delay_t Context::getNetinfoRouteDelay(const NetInfo *net_info, const PortRef &user_info) const
{
// #ifdef ARCH_ECP5
// if (net_info->is_global)
// return 0;
// #endif
#ifdef ARCH_ECP5
if (net_info->is_global)
return 0;
#endif

if (net_info->wires.empty())
return predictArcDelay(net_info, user_info);
Expand Down Expand Up @@ -417,7 +417,7 @@ void Context::check() const
namespace {
struct FixupHierarchyWorker
{
FixupHierarchyWorker(Context *ctx) : ctx(ctx) {};
FixupHierarchyWorker(Context *ctx) : ctx(ctx){};
Context *ctx;
void run()
{
Expand Down
12 changes: 9 additions & 3 deletions common/kernel/nextpnr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct PortRef
// minimum and maximum delay
struct DelayPair
{
DelayPair() : min_delay(0), max_delay(0) {};
DelayPair() : min_delay(0), max_delay(0){};
explicit DelayPair(delay_t delay) : min_delay(delay), max_delay(delay) {}
DelayPair(delay_t min_delay, delay_t max_delay) : min_delay(min_delay), max_delay(max_delay) {}
delay_t minDelay() const { return min_delay; }
Expand Down Expand Up @@ -278,7 +278,7 @@ struct PseudoCell
virtual bool getDelay(IdString fromPort, IdString toPort, DelayQuad &delay) const = 0;
virtual TimingPortClass getPortTimingClass(IdString port, int &clockInfoCount) const = 0;
virtual TimingClockingInfo getPortClockingInfo(IdString port, int index) const = 0;
virtual ~PseudoCell() {};
virtual ~PseudoCell(){};
};

struct RegionPlug : PseudoCell
Expand Down Expand Up @@ -398,16 +398,20 @@ struct CriticalPath
// Segment type
enum class Type
{
CLK_SKEW, // Clock skew
CLK_TO_Q, // Clock-to-Q delay
SOURCE, // Delayless source
LOGIC, // Combinational logic delay
ROUTING, // Routing delay
SETUP // Setup time in sink
SETUP, // Setup time in sink
HOLD // Hold time in sink
};

[[maybe_unused]] static const std::string type_to_str(Type typ)
{
switch (typ) {
case Type::CLK_SKEW:
return "CLK_SKEW";
case Type::CLK_TO_Q:
return "CLK_TO_Q";
case Type::SOURCE:
Expand All @@ -418,6 +422,8 @@ struct CriticalPath
return "ROUTING";
case Type::SETUP:
return "SETUP";
case Type::HOLD:
return "HOLD";
default:
log_error("Impossible Segment::Type");
}
Expand Down
Loading

0 comments on commit 0334ca2

Please sign in to comment.