Skip to content

Commit

Permalink
Align PlacedInstance naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Werni2A committed Jun 21, 2024
1 parent 4189e62 commit b3c5205
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ set(SOURCES
${LIB_SRC_DIR}/Structures/StructOffPageSymbol.cpp
${LIB_SRC_DIR}/Structures/StructPackage.cpp
${LIB_SRC_DIR}/Structures/StructPartCell.cpp
${LIB_SRC_DIR}/Structures/StructPartInst.cpp
${LIB_SRC_DIR}/Structures/StructPinShapeSymbol.cpp
${LIB_SRC_DIR}/Structures/StructPlacedInstance.cpp
${LIB_SRC_DIR}/Structures/StructPort.cpp
${LIB_SRC_DIR}/Structures/StructPortSymbol.cpp
${LIB_SRC_DIR}/Structures/StructSthInHierarchy1.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/Primitives/PrimCommentText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void PrimCommentText::read(FileFormatVersion /* aVersion */)
// Maybe the byte length does not count itself and
// the following 4 zero bytes.
// This issue is somehow related to the disabled
// readOptionalTrailingFuture check in StructPartInst
// readOptionalTrailingFuture check in StructPlacedInstance
// and readOptionalTrailingFuture in StructT0x10
const uint32_t byteLength = ds.readUint32() + 8U;

Expand Down
4 changes: 2 additions & 2 deletions src/RecordFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#include "Structures/StructOffPageSymbol.hpp"
#include "Structures/StructPackage.hpp"
#include "Structures/StructPartCell.hpp"
#include "Structures/StructPartInst.hpp"
#include "Structures/StructPinShapeSymbol.hpp"
#include "Structures/StructPlacedInstance.hpp"
#include "Structures/StructPort.hpp"
#include "Structures/StructPortSymbol.hpp"
#include "Structures/StructSthInHierarchy1.hpp"
Expand Down Expand Up @@ -97,7 +97,7 @@ std::unique_ptr<Record> RecordFactory::build(StreamContext& aCtx, Structure aStr
case Structure::Package: return std::make_unique<StructPackage>(aCtx); break;
case Structure::PartCell: return std::make_unique<StructPartCell>(aCtx); break;
case Structure::PinShapeSymbol: return std::make_unique<StructPinShapeSymbol>(aCtx); break;
case Structure::PlacedInstance: return std::make_unique<StructPartInst>(aCtx); break;
case Structure::PlacedInstance: return std::make_unique<StructPlacedInstance>(aCtx); break;
case Structure::Port: return std::make_unique<StructPort>(aCtx); break;
case Structure::PortSymbol: return std::make_unique<StructPortSymbol>(aCtx); break;
case Structure::SthInHierarchy1: return std::make_unique<StructSthInHierarchy1>(aCtx); break;
Expand Down
8 changes: 4 additions & 4 deletions src/Streams/StreamPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ void StreamPage::read(FileFormatVersion /* aVersion */)
wires.push_back(dynamic_pointer_cast<StructWire>(parser.readStructure()));
}

const uint16_t lenPartInsts = ds.readUint16();
const uint16_t lenPlacedInstances = ds.readUint16();

mCtx.mLogger.trace("lenPartInsts = {}", lenPartInsts);
mCtx.mLogger.trace("lenPlacedInstances = {}", lenPlacedInstances);

for(size_t i = 0u; i < lenPartInsts; ++i)
for(size_t i = 0u; i < lenPlacedInstances; ++i)
{
partInsts.push_back(dynamic_pointer_cast<StructPartInst>(parser.readStructure()));
placedInstances.push_back(dynamic_pointer_cast<StructPlacedInstance>(parser.readStructure()));
}

const uint16_t lenPorts = ds.readUint16();
Expand Down
14 changes: 7 additions & 7 deletions src/Streams/StreamPage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "Structures/StructGlobal.hpp"
#include "Structures/StructGraphicInst.hpp"
#include "Structures/StructOffPageConnector.hpp"
#include "Structures/StructPartInst.hpp"
#include "Structures/StructPlacedInstance.hpp"
#include "Structures/StructPort.hpp"
#include "Structures/StructT0x34.hpp"
#include "Structures/StructT0x35.hpp"
Expand All @@ -30,7 +30,7 @@ class StreamPage : public Stream
public:

StreamPage(ContainerContext& aCtx, const fs::path& aInputStream) : Stream{aCtx, aInputStream}, name{}, pageSize{}, pageSettings{mCtx},
titleBlocks{}, t0x34s{}, t0x35s{}, wires{}, partInsts{}, ports{}, globals{}, offPageConnectors{},
titleBlocks{}, t0x34s{}, t0x35s{}, wires{}, placedInstances{}, ports{}, globals{}, offPageConnectors{},
ercObjects{}, busEntries{}, graphicInsts{}
{ }

Expand All @@ -56,7 +56,7 @@ class StreamPage : public Stream
std::vector<std::unique_ptr<StructT0x34>> t0x34s;
std::vector<std::unique_ptr<StructT0x35>> t0x35s;
std::vector<std::unique_ptr<StructWire>> wires;
std::vector<std::unique_ptr<StructPartInst>> partInsts;
std::vector<std::unique_ptr<StructPlacedInstance>> placedInstances;
std::vector<std::unique_ptr<StructPort>> ports;
std::vector<std::unique_ptr<StructGlobal>> globals;
std::vector<std::unique_ptr<StructOffPageConnector>> offPageConnectors;
Expand Down Expand Up @@ -113,12 +113,12 @@ static std::string to_string(const StreamPage& aObj)
}
}

str += fmt::format("{}partInsts:\n", indent(1));
for(size_t i = 0u; i < aObj.partInsts.size(); ++i)
str += fmt::format("{}placedInstances:\n", indent(1));
for(size_t i = 0u; i < aObj.placedInstances.size(); ++i)
{
if(aObj.partInsts[i])
if(aObj.placedInstances[i])
{
str += indent(fmt::format("[{}]: {}", i, aObj.partInsts[i]->to_string()), 2);
str += indent(fmt::format("[{}]: {}", i, aObj.placedInstances[i]->to_string()), 2);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#include "FutureData.hpp"
#include "General.hpp"
#include "GenericParser.hpp"
#include "Structures/StructPartInst.hpp"
#include "Structures/StructPlacedInstance.hpp"


void StructPartInst::read(FileFormatVersion /* aVersion */)
void StructPlacedInstance::read(FileFormatVersion /* aVersion */)
{
auto& ds = mCtx.mDs;
GenericParser parser{mCtx};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef STRUCTPARTINST_HPP
#define STRUCTPARTINST_HPP
#ifndef STRUCTPLACEDINSTANCE_HPP
#define STRUCTPLACEDINSTANCE_HPP


#include <cstdint>
Expand All @@ -18,11 +18,11 @@
#include "Structures/StructT0x10.hpp"


class StructPartInst : public Record
class StructPlacedInstance : public Record
{
public:

StructPartInst(StreamContext& aCtx) : Record{aCtx}, symbolDisplayProps{},
StructPlacedInstance(StreamContext& aCtx) : Record{aCtx}, symbolDisplayProps{},
t0x10s{}
{ }

Expand All @@ -46,7 +46,7 @@ class StructPartInst : public Record


[[maybe_unused]]
static std::string to_string(const StructPartInst& aObj)
static std::string to_string(const StructPlacedInstance& aObj)
{
std::string str;

Expand Down Expand Up @@ -74,19 +74,19 @@ static std::string to_string(const StructPartInst& aObj)
}


inline std::string StructPartInst::to_string() const
inline std::string StructPlacedInstance::to_string() const
{
return ::to_string(*this);
}


[[maybe_unused]]
static std::ostream& operator<<(std::ostream& aOs, const StructPartInst& aVal)
static std::ostream& operator<<(std::ostream& aOs, const StructPlacedInstance& aVal)
{
aOs << to_string(aVal);

return aOs;
}


#endif // STRUCTPARTINST_HPP
#endif // STRUCTPLACEDINSTANCE_HPP
4 changes: 2 additions & 2 deletions src/VisitorPattern.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class StructOffPageConnector;
class StructOffPageSymbol;
class StructPackage;
class StructPartCell;
class StructPartInst;
class StructPinShapeSymbol;
class StructPlacedInstance;
class StructPort;
class StructPortSymbol;
class StructSthInHierarchy1;
Expand Down Expand Up @@ -137,8 +137,8 @@ class Visitor
virtual void visit(const StructOffPageSymbol& aObj) = 0;
virtual void visit(const StructPackage& aObj) = 0;
virtual void visit(const StructPartCell& aObj) = 0;
virtual void visit(const StructPartInst& aObj) = 0;
virtual void visit(const StructPinShapeSymbol& aObj) = 0;
virtual void visit(const StructPlacedInstance& aObj) = 0;
virtual void visit(const StructPort& aObj) = 0;
virtual void visit(const StructPortSymbol& aObj) = 0;
virtual void visit(const StructSthInHierarchy1& aObj) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/XmlExporter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ class XmlExporter : public Visitor
virtual void visit(const StructOffPageSymbol& /* aObj */) override { }
virtual void visit(const StructPackage& aObj) override;
virtual void visit(const StructPartCell& /* aObj */) override { }
virtual void visit(const StructPartInst& /* aObj */) override { }
virtual void visit(const StructPinShapeSymbol& /* aObj */) override { }
virtual void visit(const StructPlacedInstance& /* aObj */) override { }
virtual void visit(const StructPort& /* aObj */) override { }
virtual void visit(const StructPortSymbol& /* aObj */) override { }
virtual void visit(const StructSthInHierarchy1& /* aObj */) override { }
Expand Down

0 comments on commit b3c5205

Please sign in to comment.