15#include <unordered_map>
96 const std::string&
getName()
const {
return name_; }
108 std::shared_ptr<Net>
getNet()
const {
return net_; }
116 std::shared_ptr<Net> net_;
124 explicit Net(
const std::string& name);
126 const std::string&
getName()
const {
return name_; }
131 const std::vector<std::shared_ptr<Pin>>&
getPins()
const {
return pins_; }
138 std::vector<std::shared_ptr<Pin>> pins_;
194 std::shared_ptr<Component>
getChild(
const std::string& name)
const;
213 std::shared_ptr<Pin>
getPin(
const std::string& name)
const;
214 const std::vector<std::shared_ptr<Pin>>&
getPins()
const {
return pins_; }
217 void setProperty(
const std::string& key,
const std::string& value);
264 std::vector<std::shared_ptr<Pin>>
pins_;
265 std::unordered_map<std::string, std::shared_ptr<Pin>>
pin_map_;
286 std::shared_ptr<Component>
getComponent(
const std::string& name)
const;
287 std::shared_ptr<Component>
createComponent(
const std::string& type,
const std::string& name)
const;
290 const std::string&
getName()
const {
return name_; }
299 std::unordered_map<std::string, std::shared_ptr<Component>> components_;
300 std::unordered_map<std::string, std::function<std::shared_ptr<Component>(
const std::string&)>> factories_;
309 std::function<
void(std::shared_ptr<Component>)> visitor);
311 std::function<
void(std::shared_ptr<Component>)> visitor);
320 const std::vector<std::shared_ptr<Component>>&
components);
323 const std::vector<std::shared_ptr<Component>>&
components,
324 const std::string& block_name);
Base class for all EDA components.
std::vector< std::shared_ptr< Component > > children_
const geometry::Rectangle & getBoundingBox() const
ComponentCategory getCategory() const
void addPin(std::shared_ptr< Pin > pin)
const std::string & getType() const
void setPosition(const geometry::Point &pos)
void setElectricalInfo(const ElectricalInfo &electrical)
virtual size_t getTotalGateCount() const
std::string getProperty(const std::string &key) const
virtual void deserialize(const std::string &data)
void removePin(const std::string &name)
void setTechNode(TechNode node)
void removeChild(const std::string &name)
std::weak_ptr< Component > parent_
virtual std::string getDescription() const
geometry::Point getPosition() const
virtual geometry::Rectangle calculateHierarchicalBoundingBox() const
void setRotation(double angle)
const TimingInfo & getTimingInfo() const
virtual std::vector< std::shared_ptr< Component > > flattenHierarchy() const
void setTimingInfo(const TimingInfo &timing)
std::shared_ptr< Component > getParent() const
const std::vector< std::shared_ptr< Pin > > & getPins() const
void setType(const std::string &type)
const std::string & getName() const
const std::vector< std::shared_ptr< Component > > & getChildren() const
const std::map< std::string, std::string > & getProperties() const
virtual double calculateTotalArea() const
geometry::Point position_
TechNode getTechNode() const
const ElectricalInfo & getElectricalInfo() const
void addChild(std::shared_ptr< Component > child)
ComponentCategory category_
Component(const std::string &name, ComponentCategory category)
std::shared_ptr< Pin > getPin(const std::string &name) const
double getRotation() const
void setParent(std::shared_ptr< Component > parent)
void setProperty(const std::string &key, const std::string &value)
virtual ~Component()=default
void setPowerInfo(const PowerInfo &power)
std::unordered_map< std::string, std::shared_ptr< Pin > > pin_map_
void setBoundingBox(const geometry::Rectangle &bbox)
geometry::Rectangle bounding_box_
virtual void simulate(double time_step)
std::shared_ptr< Component > getChild(const std::string &name) const
ElectricalInfo electrical_
std::vector< std::shared_ptr< Pin > > pins_
virtual std::string serialize() const
std::map< std::string, std::string > properties_
void setName(const std::string &name)
const PowerInfo & getPowerInfo() const
Component library for managing component definitions.
void addComponent(std::shared_ptr< Component > component)
ComponentLibrary(const std::string &name)
std::vector< std::string > getComponentTypes() const
const std::string & getName() const
void loadFromFile(const std::string &filename)
std::shared_ptr< Component > getComponent(const std::string &name) const
void saveToFile(const std::string &filename) const
std::shared_ptr< Component > createComponent(const std::string &type, const std::string &name) const
Memory component (RAM/ROM)
Net class representing electrical connections.
const std::string & getName() const
Net(const std::string &name)
const std::vector< std::shared_ptr< Pin > > & getPins() const
void propagateSignal(SignalState state)
void addPin(std::shared_ptr< Pin > pin)
void removePin(std::shared_ptr< Pin > pin)
Pin class representing component connection points.
Pin(const std::string &name, PinType type, const geometry::Point &position)
const geometry::Point & getPosition() const
void connectToNet(std::shared_ptr< Net > net)
std::shared_ptr< Net > getNet() const
void setPosition(const geometry::Point &pos)
void setSignalState(SignalState state)
const std::string & getName() const
SignalState getSignalState() const
2D point with high-precision coordinates and utility methods
Axis-aligned rectangle for bounding boxes and simple EDA components.
Utility functions for component hierarchy.
void traversePostOrder(std::shared_ptr< Component > root, std::function< void(std::shared_ptr< Component >)> visitor)
size_t countComponents(std::shared_ptr< Component > root, ComponentCategory category)
double calculateTotalPower(std::shared_ptr< Component > root)
void traversePreOrder(std::shared_ptr< Component > root, std::function< void(std::shared_ptr< Component >)> visitor)
std::shared_ptr< Component > createHierarchicalBlock(const std::vector< std::shared_ptr< Component > > &components, const std::string &block_name)
double calculateCriticalPath(std::shared_ptr< Component > root)
std::vector< std::shared_ptr< Component > > groupComponentsByFunction(const std::vector< std::shared_ptr< Component > > &components)
PinType
Pin types for component connections.
SignalState
Signal states in digital circuits.
ComponentCategory
Component categories for organization.
TechNode
Technology nodes for manufacturing.
Main namespace for ZLayout library.
2D Point class for geometric calculations
Axis-aligned rectangle class for bounding boxes and simple components.
Component electrical characteristics.
Component power information.
Component timing information.