113784Sgabeblack@google.com/*
213784Sgabeblack@google.com * Copyright 2019 Google, Inc.
313784Sgabeblack@google.com *
413784Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
513784Sgabeblack@google.com * modification, are permitted provided that the following conditions are
613784Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
713784Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
813784Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
913784Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1013784Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1113784Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1213784Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1313784Sgabeblack@google.com * this software without specific prior written permission.
1413784Sgabeblack@google.com *
1513784Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1613784Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1713784Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1813784Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1913784Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2013784Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2113784Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2213784Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2313784Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2413784Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2513784Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2613784Sgabeblack@google.com *
2713784Sgabeblack@google.com * Authors: Gabe Black
2813784Sgabeblack@google.com */
2913784Sgabeblack@google.com
3013784Sgabeblack@google.com#include "pybind11/pybind11.h"
3113784Sgabeblack@google.com#include "sim/init.hh"
3213784Sgabeblack@google.com#include "sim/port.hh"
3313784Sgabeblack@google.com
3413784Sgabeblack@google.comnamespace
3513784Sgabeblack@google.com{
3613784Sgabeblack@google.com
3713784Sgabeblack@google.comvoid
3813784Sgabeblack@google.comsim_pybind(pybind11::module &m_internal)
3913784Sgabeblack@google.com{
4013784Sgabeblack@google.com    pybind11::module m = m_internal.def_submodule("sim");
4113784Sgabeblack@google.com    pybind11::class_<
4213784Sgabeblack@google.com        Port, std::unique_ptr<Port, pybind11::nodelete>>(m, "Port")
4313784Sgabeblack@google.com        .def("bind", &Port::bind)
4413784Sgabeblack@google.com        ;
4513784Sgabeblack@google.com}
4613784Sgabeblack@google.comEmbeddedPyBind embed_("sim", &sim_pybind);
4713784Sgabeblack@google.com
4813784Sgabeblack@google.com} // anonymous namespace
49