mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 18:13:50 +02:00
Split V3Order into further part and decouple various components (#4953)
Continuing the idea of decoupling the implementations of the various algorithms. The main points: -Move the former "processDomain" stuff, dealing with assigning combinational logic into the relevant sensitivity domains into V3OrderProcessDomains.cpp -Move the parallel code construction in V3OrderParallel.cpp (Could combine this with some parts of V3Partition - those not called from V3Partition::finalize - but that's not for this patch). -Move the serial code construction into V3OrderSerial.cpp -Factored the very small common code between the parallel and serial code construction (processMoveOneLogic) into V3OrderCFuncEmitter.cpp
This commit is contained in:
@@ -92,7 +92,7 @@ class OrderGraphBuilder final : public VNVisitor {
|
||||
OrderLogicVertex* m_logicVxp = nullptr; // Current logic block being analyzed
|
||||
|
||||
// Map from Trigger reference AstSenItem to the original AstSenTree
|
||||
const std::unordered_map<const AstSenItem*, const AstSenTree*>& m_trigToSen;
|
||||
const V3Order::TrigToSenMap& m_trigToSen;
|
||||
|
||||
// Current AstScope being processed
|
||||
AstScope* m_scopep = nullptr;
|
||||
@@ -363,7 +363,7 @@ class OrderGraphBuilder final : public VNVisitor {
|
||||
|
||||
// CONSTRUCTOR
|
||||
OrderGraphBuilder(AstNetlist* /*nodep*/, const std::vector<V3Sched::LogicByScope*>& coll,
|
||||
const std::unordered_map<const AstSenItem*, const AstSenTree*>& trigToSen)
|
||||
const V3Order::TrigToSenMap& trigToSen)
|
||||
: m_trigToSen{trigToSen} {
|
||||
// Build the graph
|
||||
for (const V3Sched::LogicByScope* const lbsp : coll) {
|
||||
@@ -379,16 +379,16 @@ class OrderGraphBuilder final : public VNVisitor {
|
||||
public:
|
||||
// Process the netlist and return the constructed ordering graph. It's 'process' because
|
||||
// this visitor does change the tree (removes some nodes related to DPI export trigger).
|
||||
static std::unique_ptr<OrderGraph>
|
||||
apply(AstNetlist* nodep, const std::vector<V3Sched::LogicByScope*>& coll,
|
||||
const std::unordered_map<const AstSenItem*, const AstSenTree*>& trigToSen) {
|
||||
static std::unique_ptr<OrderGraph> apply(AstNetlist* nodep,
|
||||
const std::vector<V3Sched::LogicByScope*>& coll,
|
||||
const V3Order::TrigToSenMap& trigToSen) {
|
||||
return std::unique_ptr<OrderGraph>{OrderGraphBuilder{nodep, coll, trigToSen}.m_graphp};
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<OrderGraph> V3Order::buildOrderGraph(
|
||||
AstNetlist* netlistp, //
|
||||
const std::vector<V3Sched::LogicByScope*>& coll, //
|
||||
const std::unordered_map<const AstSenItem*, const AstSenTree*>& trigToSen) {
|
||||
std::unique_ptr<OrderGraph>
|
||||
V3Order::buildOrderGraph(AstNetlist* netlistp, //
|
||||
const std::vector<V3Sched::LogicByScope*>& coll, //
|
||||
const V3Order::TrigToSenMap& trigToSen) {
|
||||
return OrderGraphBuilder::apply(netlistp, coll, trigToSen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user