From 3fdeaeb833e219fc750ab583baf065e3a6c0b239 Mon Sep 17 00:00:00 2001 From: Owen Green Date: Tue, 13 Apr 2021 23:56:01 +0100 Subject: [PATCH] Fix latency u_cmd by defining after the server knows the Unit exists --- include/wrapper/Realtime.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/wrapper/Realtime.hpp b/include/wrapper/Realtime.hpp index e6e183a..64bff83 100644 --- a/include/wrapper/Realtime.hpp +++ b/include/wrapper/Realtime.hpp @@ -34,8 +34,9 @@ public: static void setup(InterfaceTable* ft, const char* name) { - ft->fDefineUnitCmd(name, "latency", doLatency); + registerUnit(ft,name); + ft->fDefineUnitCmd(name, "latency", doLatency); } static void doLatency(Unit* unit, sc_msg_iter*) @@ -47,7 +48,7 @@ public: std::stringstream ss; ss << '/' << Wrapper::getName() << "_latency"; - std::cout << ss.str() << std::endl; + // std::cout << ss.str() << ": " << l[0] << std::endl; ft->fSendNodeReply(&unit->mParent->mNode, -1, ss.str().c_str(), 1, l); }