43 #include "pybind11/pybind11.h"
47 #include "config/the_isa.hh"
49 #if THE_ISA != NULL_ISA
60 namespace py = pybind11;
62 #if THE_ISA != NULL_ISA
68 if (eo == NULL && ed == NULL) {
69 warn(
"error casting SimObject %s", so->
name());
89 SimObject *o2,
const std::string &name2,
int i2)
91 #if THE_ISA != NULL_ISA
99 if ((eo1 || ed1) && (eo2 || ed2)) {
100 EtherInt *p1 = lookupEthPort(o1, name1, i1);
101 EtherInt *p2 = lookupEthPort(o2, name2, i2);
103 if (p1 != NULL && p2 != NULL) {
132 if (mo1 == NULL || mo2 == NULL) {
133 panic (
"Error casting SimObjects %s and %s to MemObject", o1->
name(),
141 masterPort.
bind(slavePort);
149 py::module
m = m_native.def_submodule(
"pyobject");
void setPeer(EtherInt *p)
const std::string & name()
virtual BaseSlavePort & getSlavePort(const std::string &if_name, PortID idx=InvalidPortID)
Get a slave port with a given name and index.
A BaseSlavePort is a protocol-agnostic slave port, responsible only for the structural connection to ...
virtual EtherInt * getEthPort(const std::string &if_name, int idx=-1)=0
Additional function to return the Port of a memory object.
void pybind_init_pyobject(py::module &m_native)
virtual EtherInt * getEthPort(const std::string &if_name, int idx=-1)=0
Additional function to return the Port of a memory object.
The base EtherObject class, allows for an accesor function to a simobj that returns the Port...
Base Ethernet Device declaration.
virtual const std::string name() const
virtual void bind(BaseSlavePort &slave_port)=0
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
The base EtherObject class, allows for an accesor function to a simobj that returns the Port...
static int connectPorts(SimObject *o1, const std::string &name1, int i1, SimObject *o2, const std::string &name2, int i2)
Connect the described MemObject ports.
virtual BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a master port with a given name and index.
Abstract superclass for simulation objects.
Base Ethernet Object declaration.