scc 2025.09
SystemC components library
python4sc.h
1/*******************************************************************************
2 * Copyright 2025 MINRES Technologies GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16
17#ifndef _SCC_PYTHON4SC_H_
18#define _SCC_PYTHON4SC_H_
19
20#include "cci/cfg/cci_param_typed.h"
21#include <cci_configuration>
22#include <pybind11/pybind11.h>
23#include <unordered_map>
24
30namespace scc {
36struct python4sc : public sc_core::sc_module {
38#if SYSTEMC_VERSION < 20250221
40#endif
41 cci::cci_param<std::string> input_file_name{"input_file_name", "", "the name of the python file to be executed by the interpreter"};
47 explicit python4sc(sc_core::sc_module_name nm)
48 : sc_core::sc_module(nm) {
49 SC_THREAD(run);
50 }
51
52 void register_module(std::string const& name, pybind11::module_&& mod) { mods.insert({name, mod}); }
53
54private:
55 void run();
56 std::unordered_map<std::string, pybind11::module_> mods;
57};
58} // namespace scc // end of scc-sysc
60#endif /* _SCC_PYTHON4SC_H_ */
SCC TLM utilities.
SC_HAS_PROCESS(python4sc)
yes, we have processes
python4sc(sc_core::sc_module_name nm)
Definition python4sc.h:47