2012-04-13 03:08:20 +02:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2006-08-26 13:35:28 +02:00
|
|
|
//*************************************************************************
|
2022-08-24 18:17:57 +02:00
|
|
|
// DESCRIPTION: Verilator: Ordering constraint graph
|
2006-08-26 13:35:28 +02:00
|
|
|
//
|
2019-11-08 04:33:59 +01:00
|
|
|
// Code available from: https://verilator.org
|
2006-08-26 13:35:28 +02:00
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2025-01-01 14:30:25 +01:00
|
|
|
// Copyright 2003-2025 by Wilson Snyder. This program is free software; you
|
2020-03-21 16:24:24 +01:00
|
|
|
// can redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 23:07:57 +02:00
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
|
// Version 2.0.
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2006-08-26 13:35:28 +02:00
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
2008-08-06 23:09:33 +02:00
|
|
|
//
|
2022-08-24 18:17:57 +02:00
|
|
|
// OrderGraph is a bipartite graph, with the two parts being formed of only OrderLogicVertex and
|
|
|
|
|
// OrderVarVertex vertices respectively (i.e.: edges are always between OrderLogicVertex and
|
|
|
|
|
// OrderVarVertex, and never between two OrderLogicVertex or OrderVarVertex). The graph represents
|
|
|
|
|
// both fine-grained dependencies, and additional ordering constraints between logic blocks and
|
|
|
|
|
// variables. The fact that OrderGraph is bipartite is important and we take advantage of this fact
|
|
|
|
|
// in various algorithms, so this property must be maintained.
|
|
|
|
|
//
|
|
|
|
|
// Both OrderLogicVertex and OrderVarVertex derives from OrderEitherVertex, so OrderGraph is
|
|
|
|
|
// composed only of OrderEitherVertex vertices.
|
|
|
|
|
//
|
|
|
|
|
// OrderLogicVertex holds a 'logic block', which is just some computational construct that is
|
|
|
|
|
// ordered as a single unit. Ordering of these logic blocks is determined by the variables they
|
|
|
|
|
// read and write, which is represented by the edges between OrderLogicVertex and OrderVarVertex
|
|
|
|
|
// instances (and hence the graph is bipartite).
|
|
|
|
|
//
|
|
|
|
|
// OrderVarVertex is abstract, and has various concrete subtypes that represent various ordering
|
|
|
|
|
// constraints imposed by variables accessed by logic blocks. The concrete subtypes and their
|
|
|
|
|
// roles are:
|
|
|
|
|
//
|
|
|
|
|
// OrderVarStdVertex: Data dependencies for combinational logic and delayed assignment
|
2025-08-19 10:27:59 +02:00
|
|
|
// updates (AlwaysPost).
|
2022-08-24 18:17:57 +02:00
|
|
|
// OrderVarPostVertex: Ensures all sequential logic blocks reading a signal do so before any
|
|
|
|
|
// combinational or delayed assignments update that signal.
|
2025-08-19 10:27:59 +02:00
|
|
|
// OrderVarPordVertex: Ensures a _d = _q AlwaysPre used to implement delayed (non-blocking)
|
2022-08-24 18:17:57 +02:00
|
|
|
// assignments is the first write of a _d, before any sequential blocks
|
|
|
|
|
// write to that _d.
|
2025-08-19 10:27:59 +02:00
|
|
|
// OrderVarPreVertex: This is an optimization. Try to ensure that a _d = _q AlwaysPre is the
|
2022-08-24 18:17:57 +02:00
|
|
|
// last read of a _q, after all reads of that _q by sequential logic. The
|
|
|
|
|
// model is still correct if we cannot satisfy this due to other interfering
|
|
|
|
|
// constraints. If respecting this constraint is possible, then combined
|
|
|
|
|
// with the OrderVarPordVertex constraint we get that all writes to _d are
|
|
|
|
|
// after all reads of a _q, which then allows us to eliminate the _d
|
|
|
|
|
// completely and assign to the _q directly. This means these delayed
|
|
|
|
|
// assignments can be implemented without temporary storage (the redundant
|
|
|
|
|
// storage is eliminated in V3LifePost).
|
|
|
|
|
//
|
|
|
|
|
// Ordering constraints are represented by directed edges, where the source of an edge needs to be
|
|
|
|
|
// ordered before the sink of an edge. A constraint can be either hard (must be satisfied),
|
|
|
|
|
// represented by a non cutable edge, or a constraint can be soft (ideally should be satisfied, but
|
|
|
|
|
// is ok not to if other hard constraints interfere), represented by a cutable edge. Edges
|
|
|
|
|
// otherwise carry no additional information. TODO: what about weight?
|
|
|
|
|
//
|
|
|
|
|
// Note: It is required for hard (non-cutable) constraints to form a DAG, but together with the
|
|
|
|
|
// soft constraints the graph can be arbitrary so long as it remains bipartite.
|
2008-08-06 23:09:33 +02:00
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
2019-10-05 02:17:11 +02:00
|
|
|
|
2021-03-04 03:57:07 +01:00
|
|
|
#ifndef VERILATOR_V3ORDERGRAPH_H_
|
|
|
|
|
#define VERILATOR_V3ORDERGRAPH_H_
|
2017-11-23 14:26:36 +01:00
|
|
|
|
2006-12-18 20:20:45 +01:00
|
|
|
#include "config_build.h"
|
|
|
|
|
#include "verilatedos.h"
|
2018-10-14 19:43:24 +02:00
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
#include "V3Ast.h"
|
|
|
|
|
#include "V3Graph.h"
|
2018-10-14 19:43:24 +02:00
|
|
|
|
2022-08-24 18:17:57 +02:00
|
|
|
class OrderLogicVertex;
|
|
|
|
|
class OrderVarVertex;
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2022-08-24 18:17:57 +02:00
|
|
|
//======================================================================
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2020-08-16 18:05:35 +02:00
|
|
|
enum OrderWeights : uint8_t {
|
2020-04-14 04:51:35 +02:00
|
|
|
WEIGHT_COMBO = 1, // Breakable combo logic
|
|
|
|
|
WEIGHT_POST = 2, // Post-delayed used var
|
|
|
|
|
WEIGHT_PRE = 3, // Breakable pre-delayed used var
|
2019-05-19 22:13:13 +02:00
|
|
|
WEIGHT_MEDIUM = 8, // Medium weight just so dot graph looks nice
|
2022-05-16 21:02:49 +02:00
|
|
|
WEIGHT_NORMAL = 32 // High weight just so dot graph looks nice
|
2020-02-02 16:34:29 +01:00
|
|
|
};
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2022-08-24 18:17:57 +02:00
|
|
|
//======================================================================
|
|
|
|
|
// Graph type
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2020-11-19 03:32:16 +01:00
|
|
|
class OrderGraph final : public V3Graph {
|
2006-08-26 13:35:28 +02:00
|
|
|
public:
|
2022-05-16 21:02:49 +02:00
|
|
|
// METHODS
|
2022-08-24 18:17:57 +02:00
|
|
|
|
|
|
|
|
// Methods to add edges representing constraints, utilizing the type system to help us ensure
|
|
|
|
|
// the graph remains bipartite.
|
2023-09-25 04:12:23 +02:00
|
|
|
inline void addHardEdge(OrderLogicVertex* fromp, OrderVarVertex* top,
|
|
|
|
|
int weight) VL_MT_DISABLED;
|
|
|
|
|
inline void addHardEdge(OrderVarVertex* fromp, OrderLogicVertex* top,
|
|
|
|
|
int weight) VL_MT_DISABLED;
|
|
|
|
|
inline void addSoftEdge(OrderLogicVertex* fromp, OrderVarVertex* top,
|
|
|
|
|
int weight) VL_MT_DISABLED;
|
|
|
|
|
inline void addSoftEdge(OrderVarVertex* fromp, OrderLogicVertex* top,
|
|
|
|
|
int weight) VL_MT_DISABLED;
|
2006-08-26 13:35:28 +02:00
|
|
|
};
|
|
|
|
|
|
2022-08-24 18:17:57 +02:00
|
|
|
//======================================================================
|
2006-08-26 13:35:28 +02:00
|
|
|
// Vertex types
|
|
|
|
|
|
2020-11-19 03:32:16 +01:00
|
|
|
class OrderEitherVertex VL_NOT_FINAL : public V3GraphVertex {
|
2023-09-01 00:00:53 +02:00
|
|
|
VL_RTTI_IMPL(OrderEitherVertex, V3GraphVertex)
|
2022-08-24 18:17:57 +02:00
|
|
|
// Event domain of vertex. For OrderLogicVertex this represents the conditions when the logic
|
|
|
|
|
// block must be executed. For OrderVarVertex, this is the union of the domains of all the
|
|
|
|
|
// OrderLogicVertex vertices that drive the variable. If initially set to nullptr (e.g.: all
|
|
|
|
|
// OrderVarVertex and those OrderLogicVertices that represent combinational logic), then the
|
|
|
|
|
// ordering algorithm will compute the domain automatically based on the edges representing
|
|
|
|
|
// data-flow (those between OrderLogicVertex and OrderVarStdVertex), otherwise the domain is
|
|
|
|
|
// as given (e.g.: for those OrderLogicVertices that represent clocked logic).
|
|
|
|
|
AstSenTree* m_domainp;
|
2020-04-14 04:51:35 +02:00
|
|
|
|
2022-05-16 21:02:49 +02:00
|
|
|
protected:
|
|
|
|
|
// CONSTRUCTOR
|
2023-09-25 04:12:23 +02:00
|
|
|
OrderEitherVertex(OrderGraph* graphp, AstSenTree* domainp) VL_MT_DISABLED
|
|
|
|
|
: V3GraphVertex{graphp},
|
|
|
|
|
m_domainp{domainp} {}
|
2022-09-16 12:22:11 +02:00
|
|
|
~OrderEitherVertex() override = default;
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// METHODS
|
|
|
|
|
virtual bool domainMatters() = 0;
|
|
|
|
|
|
2017-11-28 02:11:34 +01:00
|
|
|
// ACCESSORS
|
2023-04-20 13:02:31 +02:00
|
|
|
AstSenTree* domainp() const VL_MT_STABLE { return m_domainp; }
|
2023-09-25 04:12:23 +02:00
|
|
|
void domainp(AstSenTree* domainp) VL_MT_DISABLED {
|
2022-08-24 18:17:57 +02:00
|
|
|
#if VL_DEBUG
|
|
|
|
|
UASSERT(!m_domainp, "Domain should only be set once");
|
|
|
|
|
#endif
|
|
|
|
|
m_domainp = domainp;
|
|
|
|
|
}
|
2006-08-26 13:35:28 +02:00
|
|
|
};
|
|
|
|
|
|
2020-11-19 03:32:16 +01:00
|
|
|
class OrderLogicVertex final : public OrderEitherVertex {
|
2023-09-01 00:00:53 +02:00
|
|
|
VL_RTTI_IMPL(OrderLogicVertex, OrderEitherVertex)
|
2022-05-25 21:16:19 +02:00
|
|
|
AstNode* const m_nodep; // The logic this vertex represents
|
|
|
|
|
AstScope* const m_scopep; // Scope the logic is under
|
2022-08-24 18:17:57 +02:00
|
|
|
AstSenTree* const m_hybridp; // Additional sensitivities for hybrid combinational logic
|
2020-04-14 04:51:35 +02:00
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
public:
|
2022-05-16 21:02:49 +02:00
|
|
|
// CONSTRUCTOR
|
2022-08-24 18:17:57 +02:00
|
|
|
OrderLogicVertex(OrderGraph* graphp, AstScope* scopep, AstSenTree* domainp,
|
2023-09-25 04:12:23 +02:00
|
|
|
AstSenTree* hybridp, AstNode* nodep) VL_MT_DISABLED
|
|
|
|
|
: OrderEitherVertex{graphp, domainp},
|
|
|
|
|
m_nodep{nodep},
|
|
|
|
|
m_scopep{scopep},
|
|
|
|
|
m_hybridp{hybridp} {
|
2022-05-25 21:16:19 +02:00
|
|
|
UASSERT_OBJ(scopep, nodep, "Must not be null");
|
2022-05-16 21:02:49 +02:00
|
|
|
UASSERT_OBJ(!(domainp && hybridp), nodep, "Cannot have bot domainp and hybridp set");
|
2022-05-15 17:03:32 +02:00
|
|
|
}
|
2022-09-16 17:15:10 +02:00
|
|
|
~OrderLogicVertex() override = default;
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
// METHODS
|
2022-09-16 12:22:11 +02:00
|
|
|
bool domainMatters() override { return true; }
|
2022-05-16 21:02:49 +02:00
|
|
|
|
2017-11-28 02:11:34 +01:00
|
|
|
// ACCESSORS
|
2023-04-20 13:02:31 +02:00
|
|
|
AstNode* nodep() const VL_MT_STABLE { return m_nodep; }
|
|
|
|
|
AstScope* scopep() const VL_MT_STABLE { return m_scopep; }
|
2022-05-16 21:02:49 +02:00
|
|
|
AstSenTree* hybridp() const { return m_hybridp; }
|
|
|
|
|
|
|
|
|
|
// LCOV_EXCL_START // Debug code
|
2023-03-18 01:24:15 +01:00
|
|
|
string name() const override VL_MT_STABLE {
|
2020-04-14 04:51:35 +02:00
|
|
|
return (cvtToHex(m_nodep) + "\\n " + cvtToStr(nodep()->typeName()));
|
|
|
|
|
}
|
2022-09-16 12:22:11 +02:00
|
|
|
string dotShape() const override { return VN_IS(m_nodep, Active) ? "doubleoctagon" : "rect"; }
|
2022-05-16 21:02:49 +02:00
|
|
|
// LCOV_EXCL_STOP
|
2006-08-26 13:35:28 +02:00
|
|
|
};
|
|
|
|
|
|
2020-11-19 03:32:16 +01:00
|
|
|
class OrderVarVertex VL_NOT_FINAL : public OrderEitherVertex {
|
2023-09-01 00:00:53 +02:00
|
|
|
VL_RTTI_IMPL(OrderVarVertex, OrderEitherVertex)
|
2022-05-16 21:02:49 +02:00
|
|
|
AstVarScope* const m_vscp;
|
2020-04-14 04:51:35 +02:00
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
public:
|
2022-05-16 21:02:49 +02:00
|
|
|
// CONSTRUCTOR
|
2023-09-25 04:12:23 +02:00
|
|
|
OrderVarVertex(OrderGraph* graphp, AstVarScope* vscp) VL_MT_DISABLED
|
|
|
|
|
: OrderEitherVertex{graphp, nullptr},
|
|
|
|
|
m_vscp{vscp} {}
|
2022-09-16 12:22:11 +02:00
|
|
|
~OrderVarVertex() override = default;
|
2022-05-16 21:02:49 +02:00
|
|
|
|
2017-11-28 02:11:34 +01:00
|
|
|
// ACCESSORS
|
2022-05-16 21:02:49 +02:00
|
|
|
AstVarScope* vscp() const { return m_vscp; }
|
|
|
|
|
|
|
|
|
|
// LCOV_EXCL_START // Debug code
|
2022-07-30 18:49:30 +02:00
|
|
|
string dotShape() const override final { return "ellipse"; }
|
2023-04-20 13:02:31 +02:00
|
|
|
virtual string nameSuffix() const VL_MT_SAFE = 0;
|
2023-03-18 01:24:15 +01:00
|
|
|
string name() const override final VL_MT_STABLE {
|
2022-05-16 21:02:49 +02:00
|
|
|
return cvtToHex(m_vscp) + " " + nameSuffix() + "\\n " + m_vscp->name();
|
|
|
|
|
}
|
|
|
|
|
// LCOV_EXCL_STOP
|
2006-08-26 13:35:28 +02:00
|
|
|
};
|
|
|
|
|
|
2020-11-19 03:32:16 +01:00
|
|
|
class OrderVarStdVertex final : public OrderVarVertex {
|
2023-09-01 00:00:53 +02:00
|
|
|
VL_RTTI_IMPL(OrderVarStdVertex, OrderVarVertex)
|
2006-08-26 13:35:28 +02:00
|
|
|
public:
|
2022-05-16 21:02:49 +02:00
|
|
|
// CONSTRUCTOR
|
2023-09-25 04:12:23 +02:00
|
|
|
OrderVarStdVertex(OrderGraph* graphp, AstVarScope* vscp) VL_MT_DISABLED
|
2022-08-24 18:17:57 +02:00
|
|
|
: OrderVarVertex{graphp, vscp} {}
|
2022-09-16 12:22:11 +02:00
|
|
|
~OrderVarStdVertex() override = default;
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
// METHODS
|
2022-09-16 12:22:11 +02:00
|
|
|
bool domainMatters() override { return true; }
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
// LCOV_EXCL_START // Debug code
|
2023-04-20 13:02:31 +02:00
|
|
|
string nameSuffix() const override VL_MT_SAFE { return ""; }
|
2022-09-16 17:15:10 +02:00
|
|
|
string dotColor() const override { return "grey"; }
|
2022-05-16 21:02:49 +02:00
|
|
|
// LCOV_EXCL_STOP
|
2006-08-26 13:35:28 +02:00
|
|
|
};
|
2020-04-14 04:51:35 +02:00
|
|
|
|
2022-05-16 21:02:49 +02:00
|
|
|
class OrderVarPreVertex final : public OrderVarVertex {
|
2023-09-01 00:00:53 +02:00
|
|
|
VL_RTTI_IMPL(OrderVarPreVertex, OrderVarVertex)
|
2006-08-26 13:35:28 +02:00
|
|
|
public:
|
2022-05-16 21:02:49 +02:00
|
|
|
// CONSTRUCTOR
|
2023-09-25 04:12:23 +02:00
|
|
|
OrderVarPreVertex(OrderGraph* graphp, AstVarScope* vscp) VL_MT_DISABLED
|
2022-08-24 18:17:57 +02:00
|
|
|
: OrderVarVertex{graphp, vscp} {}
|
2022-09-16 12:22:11 +02:00
|
|
|
~OrderVarPreVertex() override = default;
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
// METHODS
|
2022-09-16 12:22:11 +02:00
|
|
|
bool domainMatters() override { return false; }
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
// LCOV_EXCL_START // Debug code
|
2023-04-20 13:02:31 +02:00
|
|
|
string nameSuffix() const override VL_MT_SAFE { return "PRE"; }
|
2022-09-16 17:15:10 +02:00
|
|
|
string dotColor() const override { return "green"; }
|
2022-05-16 21:02:49 +02:00
|
|
|
// LCOV_EXCL_STOP
|
2006-08-26 13:35:28 +02:00
|
|
|
};
|
2020-04-14 04:51:35 +02:00
|
|
|
|
2022-05-16 21:02:49 +02:00
|
|
|
class OrderVarPostVertex final : public OrderVarVertex {
|
2023-09-01 00:00:53 +02:00
|
|
|
VL_RTTI_IMPL(OrderVarPostVertex, OrderVarVertex)
|
2006-08-26 13:35:28 +02:00
|
|
|
public:
|
2022-05-16 21:02:49 +02:00
|
|
|
// CONSTRUCTOR
|
2023-09-25 04:12:23 +02:00
|
|
|
OrderVarPostVertex(OrderGraph* graphp, AstVarScope* vscp) VL_MT_DISABLED
|
2022-08-24 18:17:57 +02:00
|
|
|
: OrderVarVertex{graphp, vscp} {}
|
2022-09-16 12:22:11 +02:00
|
|
|
~OrderVarPostVertex() override = default;
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
// METHODS
|
2022-09-16 12:22:11 +02:00
|
|
|
bool domainMatters() override { return false; }
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
// LCOV_EXCL_START // Debug code
|
2023-04-20 13:02:31 +02:00
|
|
|
string nameSuffix() const override VL_MT_SAFE { return "POST"; }
|
2022-09-16 17:15:10 +02:00
|
|
|
string dotColor() const override { return "red"; }
|
2022-05-16 21:02:49 +02:00
|
|
|
// LCOV_EXCL_STOP
|
2006-08-26 13:35:28 +02:00
|
|
|
};
|
2020-04-14 04:51:35 +02:00
|
|
|
|
2022-05-16 21:02:49 +02:00
|
|
|
class OrderVarPordVertex final : public OrderVarVertex {
|
2023-09-01 00:00:53 +02:00
|
|
|
VL_RTTI_IMPL(OrderVarPordVertex, OrderVarVertex)
|
2006-08-26 13:35:28 +02:00
|
|
|
public:
|
2022-05-16 21:02:49 +02:00
|
|
|
// CONSTRUCTOR
|
2023-09-25 04:12:23 +02:00
|
|
|
OrderVarPordVertex(OrderGraph* graphp, AstVarScope* vscp) VL_MT_DISABLED
|
2022-08-24 18:17:57 +02:00
|
|
|
: OrderVarVertex{graphp, vscp} {}
|
2022-09-16 12:22:11 +02:00
|
|
|
~OrderVarPordVertex() override = default;
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
// METHODS
|
2022-09-16 17:15:10 +02:00
|
|
|
bool domainMatters() override { return false; }
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
// LCOV_EXCL_START // Debug code
|
2023-04-20 13:02:31 +02:00
|
|
|
string nameSuffix() const override VL_MT_SAFE { return "PORD"; }
|
2022-09-16 17:15:10 +02:00
|
|
|
string dotColor() const override { return "blue"; }
|
2022-05-16 21:02:49 +02:00
|
|
|
// LCOV_EXCL_STOP
|
|
|
|
|
};
|
|
|
|
|
|
2022-08-24 18:17:57 +02:00
|
|
|
//======================================================================
|
|
|
|
|
// Edge type
|
2022-05-16 21:02:49 +02:00
|
|
|
|
2022-08-24 18:17:57 +02:00
|
|
|
class OrderEdge final : public V3GraphEdge {
|
2023-09-01 00:00:53 +02:00
|
|
|
VL_RTTI_IMPL(OrderEdge, V3GraphEdge)
|
2022-08-24 18:17:57 +02:00
|
|
|
friend class OrderGraph; // Only the OrderGraph can create these
|
2022-05-16 21:02:49 +02:00
|
|
|
// CONSTRUCTOR
|
2022-08-24 18:17:57 +02:00
|
|
|
OrderEdge(OrderGraph* graphp, OrderEitherVertex* fromp, OrderEitherVertex* top, int weight,
|
2023-09-25 04:12:23 +02:00
|
|
|
bool cutable) VL_MT_DISABLED : V3GraphEdge{graphp, fromp, top, weight, cutable} {}
|
2022-09-16 12:22:11 +02:00
|
|
|
~OrderEdge() override = default;
|
2022-05-16 21:02:49 +02:00
|
|
|
|
|
|
|
|
// LCOV_EXCL_START // Debug code
|
2022-09-16 17:15:10 +02:00
|
|
|
string dotColor() const override { return cutable() ? "green" : "red"; }
|
2022-05-16 21:02:49 +02:00
|
|
|
// LCOV_EXCL_STOP
|
2006-08-26 13:35:28 +02:00
|
|
|
};
|
|
|
|
|
|
2022-08-24 18:17:57 +02:00
|
|
|
//======================================================================
|
|
|
|
|
// Inline methods
|
|
|
|
|
|
2023-09-25 04:12:23 +02:00
|
|
|
void OrderGraph::addHardEdge(OrderLogicVertex* fromp, OrderVarVertex* top,
|
|
|
|
|
int weight) VL_MT_DISABLED {
|
2022-08-24 18:17:57 +02:00
|
|
|
new OrderEdge{this, fromp, top, weight, /* cutable: */ false};
|
|
|
|
|
}
|
2023-09-25 04:12:23 +02:00
|
|
|
void OrderGraph::addHardEdge(OrderVarVertex* fromp, OrderLogicVertex* top,
|
|
|
|
|
int weight) VL_MT_DISABLED {
|
2022-08-24 18:17:57 +02:00
|
|
|
new OrderEdge{this, fromp, top, weight, /* cutable: */ false};
|
|
|
|
|
}
|
2023-09-25 04:12:23 +02:00
|
|
|
void OrderGraph::addSoftEdge(OrderLogicVertex* fromp, OrderVarVertex* top,
|
|
|
|
|
int weight) VL_MT_DISABLED {
|
2022-08-24 18:17:57 +02:00
|
|
|
new OrderEdge{this, fromp, top, weight, /* cutable: */ true};
|
|
|
|
|
}
|
2023-09-25 04:12:23 +02:00
|
|
|
void OrderGraph::addSoftEdge(OrderVarVertex* fromp, OrderLogicVertex* top,
|
|
|
|
|
int weight) VL_MT_DISABLED {
|
2022-08-24 18:17:57 +02:00
|
|
|
new OrderEdge{this, fromp, top, weight, /* cutable: */ true};
|
|
|
|
|
}
|
2017-11-23 14:26:36 +01:00
|
|
|
|
2018-07-14 23:44:39 +02:00
|
|
|
#endif // Guard
|