qualcomm/qbox
Loading...
Searching...
No Matches
container_builder.h
1/*
2 * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause-Clear
5 */
6#ifndef _GREENSOCS_BASE_COMPONENTS_CONTAINER_BUILDER_H
7#define _GREENSOCS_BASE_COMPONENTS_CONTAINER_BUILDER_H
8
9#include <systemc>
10#include <tlm>
11#include <tlm_utils/peq_with_get.h>
12#include <cci_configuration>
13#include <cciutils.h>
14#include <scp/report.h>
15#include <module_factory_registery.h>
16#include <ports/target-signal-socket.h>
17#include <ports/initiator-signal-socket.h>
18#include <module_factory_container.h>
19#include <string>
20#include <map>
21#include <vector>
22#include <memory>
23
24namespace gs {
26{
27public:
28 container_builder(sc_core::sc_module_name _name);
29 ~container_builder() = default;
30
31protected:
32 void dispatch(const std::string& _name);
33 void redirect_socket_params(const std::string& _name);
34 static std::string get_socket_redirect_cycle(const std::map<std::string, std::string>& socket_redirects);
35 std::string replace_all(std::string str, const std::string& from, const std::string& to);
36
37 template <class T>
38 void cci_set(std::string n, T value)
39 {
40 auto handle = m_broker.get_param_handle(n);
41 if (handle.is_valid())
42 handle.set_cci_value(cci::cci_value(value));
43 else if (!m_broker.has_preset_value(n)) {
44 m_broker.set_preset_cci_value(n, cci::cci_value(value));
45 } else {
46 SCP_FATAL(())("Trying to re-set a value? {}", n);
47 }
48 }
49
50 // Socket redirection map: alias_name -> internal_path
51 std::map<std::string, std::string> m_socket_redirects;
52};
53} // namespace gs
54
55extern "C" void module_register();
56
57#endif
Definition module_factory_container.h:1358
Tool which reads a Lua configuration file and sets parameters.
Definition biflow.cc:10