quic/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 std::string replace_all(std::string str, const std::string& from, const std::string& to);
35
36 template <class T>
37 void cci_set(std::string n, T value)
38 {
39 auto handle = m_broker.get_param_handle(n);
40 if (handle.is_valid())
41 handle.set_cci_value(cci::cci_value(value));
42 else if (!m_broker.has_preset_value(n)) {
43 m_broker.set_preset_cci_value(n, cci::cci_value(value));
44 } else {
45 SCP_FATAL(())("Trying to re-set a value? {}", n);
46 }
47 }
48
49 // Socket redirection map: alias_name -> internal_path
50 std::map<std::string, std::string> m_socket_redirects;
51};
52} // namespace gs
53
54extern "C" void module_register();
55
56#endif
Definition target.h:160
Definition module_factory_container.h:1304
Definition container_builder.h:26
Tool which reads a Lua configuration file and sets parameters.
Definition biflow.cc:10