113723Sgabeblack@google.com/* 213723Sgabeblack@google.com * Copyright 2019 Google, Inc. 313723Sgabeblack@google.com * 413723Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without 513723Sgabeblack@google.com * modification, are permitted provided that the following conditions are 613723Sgabeblack@google.com * met: redistributions of source code must retain the above copyright 713723Sgabeblack@google.com * notice, this list of conditions and the following disclaimer; 813723Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright 913723Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the 1013723Sgabeblack@google.com * documentation and/or other materials provided with the distribution; 1113723Sgabeblack@google.com * neither the name of the copyright holders nor the names of its 1213723Sgabeblack@google.com * contributors may be used to endorse or promote products derived from 1313723Sgabeblack@google.com * this software without specific prior written permission. 1413723Sgabeblack@google.com * 1513723Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1613723Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1713723Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1813723Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1913723Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2013723Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2113723Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2213723Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2313723Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2413723Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2513723Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2613723Sgabeblack@google.com * 2713723Sgabeblack@google.com * Authors: Gabe Black 2813723Sgabeblack@google.com */ 2913723Sgabeblack@google.com 3013723Sgabeblack@google.com#include "systemc/core/python.hh" 3113723Sgabeblack@google.com#include "systemc/ext/tlm_core/2/quantum/global_quantum.hh" 3213723Sgabeblack@google.com 3313723Sgabeblack@google.comnamespace 3413723Sgabeblack@google.com{ 3513723Sgabeblack@google.com 3613723Sgabeblack@google.comstruct InstallTlmGlobalQuantum : public ::sc_gem5::PythonInitFunc 3713723Sgabeblack@google.com{ 3813723Sgabeblack@google.com void 3913723Sgabeblack@google.com run(pybind11::module &systemc) override 4013723Sgabeblack@google.com { 4113723Sgabeblack@google.com pybind11::class_<tlm::tlm_global_quantum>( 4213723Sgabeblack@google.com systemc, "tlm_global_quantum") 4313723Sgabeblack@google.com .def_static("instance", &tlm::tlm_global_quantum::instance, 4413723Sgabeblack@google.com pybind11::return_value_policy::reference) 4513723Sgabeblack@google.com .def("set", &tlm::tlm_global_quantum::set) 4613723Sgabeblack@google.com .def("get", &tlm::tlm_global_quantum::get) 4713723Sgabeblack@google.com .def("compute_local_quantum", 4813723Sgabeblack@google.com &tlm::tlm_global_quantum::compute_local_quantum) 4913723Sgabeblack@google.com ; 5013723Sgabeblack@google.com } 5113723Sgabeblack@google.com} installTlmGlobalQuantum; 5213723Sgabeblack@google.com 5313723Sgabeblack@google.com} // anonymous namespace 54