diff --git a/README.md b/README.md index 5d327a8..b82b288 100644 --- a/README.md +++ b/README.md @@ -80,16 +80,16 @@ The services are DIM RPC services. Every RPC is called with a string and expects * Operations may be: * An SCA command and data pair (e.g. `0x0000f00d,0x0000cafe`) * A wait operation (e.g. `30,wait`) in ms, defaults to 3 - * An SCA connect operation (e.g. `connect`) - * An SCA reset operation (`reset`) + * An SCA supervisory level connect operation (e.g. `svl_connect`) + * An SCA supervisory level reset operation (`svl_reset`) * An SC global reset operation (`sc_reset`) * An instruction to execute the sequence atomically (`lock` - needs to lead the sequence) * Returns: * Sequence of SCA output as follows: * SCA command and SCA read pairs * Wait confirmations with time waited - * Connect confirmations made up of a "connect" string - * No entries for `reset`, `sc_reset`, and `lock` directives + * Connect confirmations made up of a "svl_connect" string + * No entries for `svl_reset`, `sc_reset`, and `lock` directives * Example: * DIM input: `0x00000010,0x00000011\n3\n0x000000020,0x00000021` diff --git a/apps/AlfClient.cxx b/apps/AlfClient.cxx index 670c2d7..afed93e 100644 --- a/apps/AlfClient.cxx +++ b/apps/AlfClient.cxx @@ -190,8 +190,8 @@ class AlfClient : public AliceO2::Common::Program if (mOptions.sca) { auto scaOut = scaSequence.write({ std::make_pair("", "sc_reset"), - std::make_pair("", "reset"), - std::make_pair("", "connect"), + std::make_pair("", "svl_reset"), + std::make_pair("", "svl_connect"), std::make_pair("1000", "wait"), std::make_pair("0x00010002", "0xff000000"), std::make_pair("0x00020004", "0xff000000"), diff --git a/apps/AlfLibClient.cxx b/apps/AlfLibClient.cxx index 130bf43..07fde93 100644 --- a/apps/AlfLibClient.cxx +++ b/apps/AlfLibClient.cxx @@ -70,8 +70,8 @@ class AlfLibClient : public AliceO2::Common::Program std::cout << "Running simple SCA operations" << std::endl; try { - sca.reset(); - sca.connect(); + sca.svlReset(); + sca.svlConnect(); auto scaOut = sca.executeCommand({ 0x00010002, 0xff000000 }); std::cout << scaOut.command << " " << scaOut.data << std::endl; } catch (const ScaException& e) { @@ -82,8 +82,8 @@ class AlfLibClient : public AliceO2::Common::Program std::vector> ops; sca.setChannel(1); ops.push_back({ Sca::Operation::SCReset, {} }); - ops.push_back({ Sca::Operation::Reset, {} }); - ops.push_back({ Sca::Operation::Connect, {} }); + ops.push_back({ Sca::Operation::SVLReset, {} }); + ops.push_back({ Sca::Operation::SVLConnect, {} }); ops.push_back({ Sca::Operation::Command, Sca::CommandData{ 0x00100002, 0xff000000 } }); ops.push_back({ Sca::Operation::Command, Sca::CommandData{ 0x00100003, 0xff000000 } }); ops.push_back({ Sca::Operation::Wait, 100 }); @@ -94,12 +94,12 @@ class AlfLibClient : public AliceO2::Common::Program std::cout << "Command: " << boost::get(out.second) << std::endl; } else if (out.first == Sca::Operation::Wait) { std::cout << "Wait: " << std::dec << boost::get(out.second) << std::endl; - } else if (out.first == Sca::Operation::Reset) { - std::cout << "Reset" << std::endl; + } else if (out.first == Sca::Operation::SVLReset) { + std::cout << "SVL Reset" << std::endl; } else if (out.first == Sca::Operation::SCReset) { std::cout << "SC Reset" << std::endl; - } else if (out.first == Sca::Operation::Connect) { - std::cout << "Connect " << std::endl; + } else if (out.first == Sca::Operation::SVLConnect) { + std::cout << "SVL Connect " << std::endl; } else if (out.first == Sca::Operation::Error) { std::cout << "Error: " << boost::get(out.second) << std::endl; } else { diff --git a/include/Alf/Sca.h b/include/Alf/Sca.h index 4b3503d..9d30978 100644 --- a/include/Alf/Sca.h +++ b/include/Alf/Sca.h @@ -53,8 +53,8 @@ class Sca enum Operation { Command, Wait, SCReset, - Reset, - Connect, + SVLReset, + SVLConnect, Error, Lock }; @@ -84,10 +84,10 @@ class Sca void scReset(); /// Executes an SCA reset - void reset(); + void svlReset(); /// Executes an SCA connect - void connect(); + void svlConnect(); /// Executes an SCA command /// \param commandData SCA command, data pair diff --git a/src/AlfServer.cxx b/src/AlfServer.cxx index 5bc2a52..8e87a6c 100644 --- a/src/AlfServer.cxx +++ b/src/AlfServer.cxx @@ -296,23 +296,23 @@ std::pair AlfServer::stringToScaPair(const std::strin } catch (const std::exception& e) { BOOST_THROW_EXCEPTION(SwtException() << ErrorInfo::Message("SCA Wait Time provided cannot be converted to int")); } - } else if (scaPair[scaPair.size() - 1] == "reset") { - operation = Sca::Operation::Reset; + } else if (scaPair[scaPair.size() - 1] == "svl_reset") { + operation = Sca::Operation::SVLReset; if (scaPair.size() != 1) { BOOST_THROW_EXCEPTION( - AlfException() << ErrorInfo::Message("Too many arguments for RESET operation")); + AlfException() << ErrorInfo::Message("Too many arguments for SVL RESET operation")); } - } else if (scaPair[scaPair.size() - 1] == "sc_reset") { - operation = Sca::Operation::SCReset; + } else if (scaPair[scaPair.size() - 1] == "svl_connect") { + operation = Sca::Operation::SVLConnect; if (scaPair.size() != 1) { BOOST_THROW_EXCEPTION( - AlfException() << ErrorInfo::Message("Too many arguments for SC RESET operation")); + AlfException() << ErrorInfo::Message("Too many arguments for SVL CONNECT operation")); } - } else if (scaPair[scaPair.size() - 1] == "connect") { - operation = Sca::Operation::Connect; + } else if (scaPair[scaPair.size() - 1] == "sc_reset") { + operation = Sca::Operation::SCReset; if (scaPair.size() != 1) { BOOST_THROW_EXCEPTION( - AlfException() << ErrorInfo::Message("Too many arguments for CONNECT operation")); + AlfException() << ErrorInfo::Message("Too many arguments for SC RESET operation")); } } else { // regular sca command operation = Sca::Operation::Command; diff --git a/src/Sca.cxx b/src/Sca.cxx index 634ae0d..382fe89 100644 --- a/src/Sca.cxx +++ b/src/Sca.cxx @@ -102,13 +102,13 @@ void Sca::scReset() barWrite(sc_regs::SC_RESET.index, 0x0); //void cmd to sync clocks } -void Sca::reset() +void Sca::svlReset() { barWrite(sc_regs::SCA_WR_CTRL.index, 0x1); barWrite(sc_regs::SCA_WR_CTRL.index, 0x0); } -void Sca::connect() +void Sca::svlConnect() { barWrite(sc_regs::SCA_WR_CTRL.index, 0x2); barWrite(sc_regs::SCA_WR_CTRL.index, 0x0); @@ -298,15 +298,15 @@ std::vector> Sca::executeSequence(const std } std::this_thread::sleep_for(std::chrono::milliseconds(waitTime)); ret.push_back({ operation, waitTime }); - } else if (operation == Operation::Reset) { - reset(); - ret.push_back({ Operation::Reset, {} }); + } else if (operation == Operation::SVLReset) { + svlReset(); + ret.push_back({ Operation::SVLReset, {} }); } else if (operation == Operation::SCReset) { scReset(); ret.push_back({ Operation::SCReset, {} }); - } else if (operation == Operation::Connect) { - connect(); - ret.push_back({ Operation::Connect, {} }); + } else if (operation == Operation::SVLConnect) { + svlConnect(); + ret.push_back({ Operation::SVLConnect, {} }); } else { BOOST_THROW_EXCEPTION(ScaException() << ErrorInfo::Message("SCA operation type unknown")); } @@ -318,12 +318,12 @@ std::vector> Sca::executeSequence(const std meaningfulMessage = (boost::format("SCA_SEQUENCE cmd=0x%08x data=0x%08x serialId=%s link=%d error='%s'") % boost::get(data).command % boost::get(data).data % mLink.serialId % mLink.linkId % e.what()).str(); } else if (operation == Operation::Wait) { meaningfulMessage = (boost::format("SCA_SEQUENCE WAIT waitTime=%d serialId=%s link=%d error='%s'") % boost::get(data) % mLink.serialId % mLink.linkId % e.what()).str(); - } else if (operation == Operation::Reset) { - meaningfulMessage = (boost::format("SCA_SEQUENCE RESET serialId=%s link=%d error='%s'") % mLink.serialId % mLink.linkId % e.what()).str(); + } else if (operation == Operation::SVLReset) { + meaningfulMessage = (boost::format("SCA_SEQUENCE SVL RESET serialId=%s link=%d error='%s'") % mLink.serialId % mLink.linkId % e.what()).str(); } else if (operation == Operation::SCReset) { meaningfulMessage = (boost::format("SCA_SEQUENCE SC RESET serialId=%s link=%d error='%s'") % mLink.serialId % mLink.linkId % e.what()).str(); - } else if (operation == Operation::Connect) { - meaningfulMessage = (boost::format("SCA_SEQUENCE CONNECT serialId=%s link=%d error='%s'") % mLink.serialId % mLink.linkId % e.what()).str(); + } else if (operation == Operation::SVLConnect) { + meaningfulMessage = (boost::format("SCA_SEQUENCE SVL CONNECT serialId=%s link=%d error='%s'") % mLink.serialId % mLink.linkId % e.what()).str(); } else { meaningfulMessage = (boost::format("SCA_SEQUENCE UNKNOWN serialId=%s link=%d error='%s'") % mLink.serialId % mLink.linkId % e.what()).str(); } @@ -352,10 +352,10 @@ std::string Sca::writeSequence(const std::vector>& op resultBuffer << data << "\n"; // "[cmd],[data]\n" } else if (operation == Operation::Wait) { resultBuffer << std::dec << data << "\n"; // "[time]\n" - } else if (operation == Operation::Reset || operation == Operation::SCReset) { + } else if (operation == Operation::SVLReset || operation == Operation::SCReset) { /* DO NOTHING */ - } else if (operation == Operation::Connect) { - resultBuffer << "connect\n"; // echo + } else if (operation == Operation::SVLConnect) { + resultBuffer << "svl_connect\n"; // echo } else if (operation == Operation::Error) { resultBuffer << data; // "[error_msg]" Logger::get().err() << data << endm;