mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
tengiga enable
This commit is contained in:
parent
b7cb341ee3
commit
a76ed6d8db
@ -1614,7 +1614,6 @@ int enableTenGigabitEthernet(int val) {
|
||||
} else {
|
||||
bus_w(addr, bus_r(addr) & (~CONFIG_GB10_SND_UDP_MSK));
|
||||
}
|
||||
// configuremac called from client
|
||||
}
|
||||
return ((bus_r(addr) & CONFIG_GB10_SND_UDP_MSK) >>
|
||||
CONFIG_GB10_SND_UDP_OFST);
|
||||
|
@ -1528,7 +1528,6 @@ int enableTenGigabitEthernet(int val) {
|
||||
send_to_ten_gig = 1;
|
||||
else
|
||||
send_to_ten_gig = 0;
|
||||
// configuremac called from client
|
||||
}
|
||||
return send_to_ten_gig;
|
||||
}
|
||||
|
@ -427,6 +427,8 @@ void setupDetector() {
|
||||
setGateDelay(i, DEFAULT_GATE_DELAY);
|
||||
}
|
||||
setInitialExtSignals();
|
||||
// 10G UDP
|
||||
enableTenGigabitEthernet(1);
|
||||
|
||||
// check module type attached if not in debug mode
|
||||
{
|
||||
@ -1493,6 +1495,26 @@ int setDetectorPosition(int pos[]) {
|
||||
|
||||
int *getDetectorPosition() { return detPos; }
|
||||
|
||||
int enableTenGigabitEthernet(int val) {
|
||||
uint32_t addr = PKT_CONFIG_REG;
|
||||
|
||||
// set
|
||||
if (val != -1) {
|
||||
LOG(logINFO, ("Setting 10Gbe: %d\n", (val > 0) ? 1 : 0));
|
||||
// 1g
|
||||
if (val == 0) {
|
||||
bus_w(addr, bus_r(addr) | PKT_CONFIG_1G_INTERFACE_MSK);
|
||||
}
|
||||
// 10g
|
||||
else {
|
||||
bus_w(addr, bus_r(addr) & (~PKT_CONFIG_1G_INTERFACE_MSK));
|
||||
}
|
||||
}
|
||||
int oneG = ((bus_r(addr) & PKT_CONFIG_1G_INTERFACE_MSK) >>
|
||||
PKT_CONFIG_1G_INTERFACE_OFST);
|
||||
return oneG ? 0 : 1;
|
||||
}
|
||||
|
||||
/* pattern */
|
||||
|
||||
void startPattern() {
|
||||
|
@ -377,7 +377,8 @@ int getInterruptSubframe();
|
||||
int setReadNLines(int value);
|
||||
int getReadNLines();
|
||||
#endif
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(EIGERD)
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(EIGERD) || \
|
||||
defined(MYTHEN3D)
|
||||
int enableTenGigabitEthernet(int val);
|
||||
#endif
|
||||
|
||||
|
@ -2855,14 +2855,14 @@ int enable_ten_giga(int file_des) {
|
||||
return printSocketReadError();
|
||||
LOG(logINFOBLUE, ("Setting 10GbE: %d\n", arg));
|
||||
|
||||
#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(MYTHEN3D) || \
|
||||
defined(GOTTHARD2D)
|
||||
#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(GOTTHARD2D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// set & get
|
||||
if ((arg == GET_FLAG) || (Server_VerifyLock() == OK)) {
|
||||
if (arg >= 0 && enableTenGigabitEthernet(GET_FLAG) != arg) {
|
||||
enableTenGigabitEthernet(arg);
|
||||
#ifdef EIGERD
|
||||
uint64_t hardwaremac = getDetectorMAC();
|
||||
if (udpDetails.srcmac != hardwaremac) {
|
||||
LOG(logINFOBLUE, ("Updating udp source mac\n"));
|
||||
@ -2873,6 +2873,7 @@ int enable_ten_giga(int file_des) {
|
||||
LOG(logINFOBLUE, ("Updating udp source ip\n"));
|
||||
udpDetails.srcip = hardwareip;
|
||||
}
|
||||
#endif
|
||||
configure_mac();
|
||||
}
|
||||
retval = enableTenGigabitEthernet(GET_FLAG);
|
||||
|
@ -511,10 +511,10 @@ class Detector {
|
||||
|
||||
Result<std::string> printRxConfiguration(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger][CTB][Moench] */
|
||||
/** [Eiger][CTB][Moench][Mythen3] */
|
||||
Result<bool> getTenGiga(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger][CTB][Moench] */
|
||||
/** [Eiger][CTB][Moench][Mythen3] */
|
||||
void setTenGiga(bool value, Positions pos = {});
|
||||
|
||||
/** [Eiger, Jungfrau] */
|
||||
|
@ -1648,7 +1648,7 @@ class CmdProxy {
|
||||
"\n\tPrints the receiver configuration.");
|
||||
|
||||
INTEGER_COMMAND(tengiga, getTenGiga, setTenGiga, StringTo<int>,
|
||||
"[0, 1]\n\t[Eiger][Ctb][Moench] 10GbE Enable.");
|
||||
"[0, 1]\n\t[Eiger][Ctb][Moench][Mythen3] 10GbE Enable.");
|
||||
|
||||
INTEGER_COMMAND(flowcontrol10g, getTenGigaFlowControl,
|
||||
setTenGigaFlowControl, StringTo<int>,
|
||||
|
@ -1565,7 +1565,7 @@ TEST_CASE("tengiga", "[.cmd][.new]") {
|
||||
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::EIGER || det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::MOENCH) {
|
||||
det_type == defs::MOENCH || det_type == defs::MYTHEN3) {
|
||||
auto tengiga = det.getTenGiga();
|
||||
det.setTenGiga(false);
|
||||
|
||||
|
@ -430,7 +430,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
|
||||
}
|
||||
impl()->setTimingMode(arg.timMode);
|
||||
if (myDetectorType == EIGER || myDetectorType == MOENCH ||
|
||||
myDetectorType == CHIPTESTBOARD) {
|
||||
myDetectorType == CHIPTESTBOARD || myDetectorType == MYTHEN3) {
|
||||
try {
|
||||
impl()->setTenGigaEnable(arg.tenGiga);
|
||||
} catch (const RuntimeError &e) {
|
||||
@ -987,7 +987,7 @@ int ClientInterface::get_overwrite(Interface &socket) {
|
||||
int ClientInterface::enable_tengiga(Interface &socket) {
|
||||
auto val = socket.Receive<int>();
|
||||
if (myDetectorType != EIGER && myDetectorType != CHIPTESTBOARD &&
|
||||
myDetectorType != MOENCH)
|
||||
myDetectorType != MOENCH && myDetectorType != MYTHEN3)
|
||||
functionNotImplemented();
|
||||
|
||||
if (val >= 0) {
|
||||
|
@ -1662,6 +1662,9 @@ void Implementation::setTenGigaEnable(const bool b) {
|
||||
case EIGER:
|
||||
generalData->SetTenGigaEnable(b, dynamicRange);
|
||||
break;
|
||||
case MYTHEN3:
|
||||
generalData->SetDynamicRange(dynamicRange, b);
|
||||
break;
|
||||
case MOENCH:
|
||||
case CHIPTESTBOARD:
|
||||
ctbAnalogDataBytes = generalData->setImageSize(
|
||||
|
Loading…
x
Reference in New Issue
Block a user