Include a simplification step in the net extraction

This commit is contained in:
Matthias Koefferlein 2025-05-04 17:15:47 +02:00
parent 2bc8ac235a
commit fc25590dd7
4 changed files with 37 additions and 3 deletions

View File

@ -24,6 +24,12 @@
#include "pexRExtractorTech.h"
namespace pex
{
RExtractorTech::RExtractorTech ()
: skip_simplify (false)
{
// .. nothing yet ..
}
}

View File

@ -36,7 +36,7 @@ namespace pex
* Note that the layers are generic IDs. These are usigned ints specifying
* a layer.
*/
class RExtractorTechVia
class PEX_PUBLIC RExtractorTechVia
{
public:
RExtractorTechVia ()
@ -82,7 +82,7 @@ public:
* Note that the layers are generic IDs. These are usigned ints specifying
* a layer.
*/
class RExtractorTechConductor
class PEX_PUBLIC RExtractorTechConductor
{
public:
/**
@ -147,9 +147,14 @@ public:
/**
* @brief Specifies the extraction parameters
*/
class RExtractorTech
class PEX_PUBLIC RExtractorTech
{
public:
/**
* @brief Constructor
*/
RExtractorTech ();
/**
* @brief A list of via definitions
*/
@ -159,6 +164,11 @@ public:
* @brief A list of conductor definitions
*/
std::list<RExtractorTechConductor> conductors;
/**
* @brief A flag indicating to skip the simplify step after extraction
*/
bool skip_simplify;
};
}

View File

@ -101,6 +101,10 @@ RNetExtractor::extract (const RExtractorTech &tech,
extract_conductor (*cond, g->second, vp, vp_offset, pp, pp_offset, viap, rnetwork);
}
if (! tech.skip_simplify) {
rnetwork.simplify ();
}
}
static double

View File

@ -170,6 +170,7 @@ TEST(netex_2layer)
pex::RNetwork network;
pex::RExtractorTech tech;
tech.skip_simplify = true;
pex::RExtractorTechVia via1;
via1.bottom_conductor = l1;
@ -229,4 +230,17 @@ TEST(netex_2layer)
"R $7(0.1,0.1;0.7,0.7) V1(0.4,-5.6;0.4,-5.6) 1.875\n"
"R $1(0.3,-5.7;0.5,-5.5) V1(0.4,-5.6;0.4,-5.6) 0"
);
tech.skip_simplify = false;
rex.extract (tech, geo, vertex_ports, polygon_ports, network);
EXPECT_EQ (network.to_string (true),
"R $2(9.3,-5.9;9.9,-5.3) P0(12.9,-5.9;13.5,-5.3) 2.25\n"
"R $8(10,-3.5;10,-2.7) P1(12.9,-3.4;13.5,-2.8) 1\n"
"R $2(9.3,-5.9;9.9,-5.3) V1(0.3,-5.7;0.5,-5.5) 55.75\n"
"R $2(9.3,-5.9;9.9,-5.3) $8(10,-3.5;10,-2.7) 13.2813\n"
"R $8(10,-3.5;10,-2.7) V0(5.2,0.4;5.2,0.4) 28.7812\n"
"R V0(5.2,0.4;5.2,0.4) V1(0.3,-5.7;0.5,-5.5) 17.375"
);
}