Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tlm_target: added constructor argument to assign a socket name #47

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/scc/tlm_target.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ template <unsigned int BUSWIDTH = LT, unsigned int ADDR_UNIT_WIDTH = 8> class tl
* @brief the constructor
*
* @param clock the clock period of the component
* @param socket_name optional name of the internal socket
*/
tlm_target(sc_core::sc_time& clock);
tlm_target(sc_core::sc_time& clock, const char* socket_name = "socket");
//! the target socket
tlm::scc::target_mixin<tlm::scc::scv::tlm_rec_target_socket<BUSWIDTH>> socket;
/**
Expand Down Expand Up @@ -125,8 +126,8 @@ template <unsigned int BUSWIDTH = LT, unsigned int ADDR_UNIT_WIDTH = 8> struct t
} /* namespace scc */

template <unsigned int BUSWIDTH, unsigned int ADDR_UNIT_WIDTH>
inline scc::tlm_target<BUSWIDTH, ADDR_UNIT_WIDTH>::tlm_target(sc_core::sc_time& clock)
: socket("socket")
inline scc::tlm_target<BUSWIDTH, ADDR_UNIT_WIDTH>::tlm_target(sc_core::sc_time& clock, const char* socket_name)
: socket(socket_name)
, clk(clock)
, socket_map(std::make_pair(nullptr, 0)) {
socket.register_b_transport(
Expand Down