ROOM » Core » C++ Classes » Net
Net Class
Reference for room::Net. Moreā¦
| Header: | #include "net.h" |
|---|---|
| CMake: | target_link_libraries(mytarget PRIVATE ROOM::room) |
Public Functions
| explicit Net(std::string name, SigType sigType = SigType::Signal) | Constructs an electrical net with no terminals yet. |
| const std::string & name() const | Returns the net name. |
| SigType sigType() const | Returns the signal type of this net. |
| void setSigType(SigType type) | Changes the signal type classification. |
| std::vector<Term> & terms() | Returns terminals connected to this net for modification. |
| const std::vector<Term> & terms() const | Returns terminals for read-only access. |
Detailed Description
Member Function Documentation
explicit Net(std::string name, SigType sigType = SigType::Signal)
Constructs an electrical net with no terminals yet.
| Parameter | Description |
|---|---|
name | Net name (for example "VDD" or "N1"). |
sigType | Signal classification: Signal (default), Power, Ground, or Clock. |
const std::string & name() const
Returns the net name.
Returns: Name assigned at construction.
SigType sigType() const
Returns the signal type of this net.
Returns: Signal, Power, Ground, or Clock.
void setSigType(SigType type)
Changes the signal type classification.
| Parameter | Description |
|---|---|
type | New SigType value. |
std::vector<Term> & terms()
Returns terminals connected to this net for modification.
Returns: Mutable reference to Term objects (pins on the net).
const std::vector<Term> & terms() const
Returns terminals for read-only access.
Returns: Const reference to the terminal list.
Example
room::Net vdd("VDD", room::SigType::Power);
vdd.terms().emplace_back("VDD", 0, room::Point{0, 0});
room::Net n1("N1");
n1.terms().emplace_back("A", 1, room::Point{100, 200});
n1.terms().emplace_back("Y", 1, room::Point{500, 200});
block.nets().push_back(std::move(vdd));
block.nets().push_back(std::move(n1));