diff --git a/MAC/APL/PIC/RSPDriver/src/Cache.cc b/MAC/APL/PIC/RSPDriver/src/Cache.cc index 42cfbdb65bf65096dac6fb44c6d3e9518048e898..fae401b9a96942882097cbd351ecec6d4ab6c8c2 100644 --- a/MAC/APL/PIC/RSPDriver/src/Cache.cc +++ b/MAC/APL/PIC/RSPDriver/src/Cache.cc @@ -50,10 +50,12 @@ CacheBuffer::CacheBuffer() tv.tv_sec = 0; tv.tv_usec = 0; m_timestamp.set(tv); - m_beamletweights().resize(BeamletWeights::SINGLE_TIMESTEP, StationSettings::instance()->nrRcus(), MEPHeader::N_XBLETS); + m_beamletweights().resize(BeamletWeights::SINGLE_TIMESTEP, StationSettings::instance()->nrRcus(), + MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS); m_beamletweights() = complex<int16>(0,0); - m_subbandselection().resize(StationSettings::instance()->nrRcus(), MEPHeader::N_XBLETS); + m_subbandselection().resize(StationSettings::instance()->nrRcus(), + MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS); m_subbandselection() = 0; if (GET_CONFIG("RSPDriver.IDENTITY_WEIGHTS", i)) @@ -63,9 +65,9 @@ CacheBuffer::CacheBuffer() m_beamletweights()(Range::all(), Range::all(), Range::all()) = complex<int16>(0x4000, 0); - // reset weights on first N_XLETS beamlets for cross correlation + // reset weights on first N_LOCAL_XLETS beamlets for cross correlation // they will be set again in BWWrite::sendrequest() - m_beamletweights()(Range::all(), Range::all(), Range(0, MEPHeader::N_XLETS - 1)) = + m_beamletweights()(Range::all(), Range::all(), Range(0, MEPHeader::N_LOCAL_XLETS - 1)) = complex<int16>(0,0); LOG_INFO_STR("m_beamletweights=" << m_beamletweights()(0, Range::all(), Range::all())); @@ -75,7 +77,7 @@ CacheBuffer::CacheBuffer() // for (int rcu = 0; rcu < m_subbandselection().extent(firstDim); rcu++) { for (int sb = 0; sb < MEPHeader::N_BEAMLETS; sb++) { - m_subbandselection()(rcu, sb + MEPHeader::N_XLETS) = (rcu % MEPHeader::N_POL) + + m_subbandselection()(rcu, sb + MEPHeader::N_LOCAL_XLETS) = (rcu % MEPHeader::N_POL) + (sb * MEPHeader::N_POL) + (GET_CONFIG("RSPDriver.FIRST_SUBBAND", i) * 2); } @@ -132,7 +134,7 @@ CacheBuffer::CacheBuffer() memset(&boardinit, 0, sizeof(BoardStatus)); m_systemstatus.board() = boardinit; - EPA_Protocol::RSRVersion versioninit = { 0, 0, 0, 0, 0 }; + EPA_Protocol::RSRVersion versioninit = { 0, 0, 0 }; m_versions.bp().resize(StationSettings::instance()->nrRspBoards()); m_versions.bp() = versioninit; m_versions.ap().resize(StationSettings::instance()->nrBlps()); diff --git a/MAC/APL/PIC/RSPDriver/src/GetSubbandsCmd.cc b/MAC/APL/PIC/RSPDriver/src/GetSubbandsCmd.cc index db193e8d927e1663d9193c355e3b4768c78cbba2..808e74dd6c895d84d129f2cef336817362a7a82b 100644 --- a/MAC/APL/PIC/RSPDriver/src/GetSubbandsCmd.cc +++ b/MAC/APL/PIC/RSPDriver/src/GetSubbandsCmd.cc @@ -62,12 +62,12 @@ void GetSubbandsCmd::ack(CacheBuffer& cache) case SubbandSelection::BEAMLET: ack.subbands().resize(m_event->rcumask.count(), MEPHeader::N_BEAMLETS); - src_range = Range(MEPHeader::N_XLETS, MEPHeader::N_XLETS + MEPHeader::N_BEAMLETS - 1); + src_range = Range(MEPHeader::N_LOCAL_XLETS, MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS - 1); break; case SubbandSelection::XLET: - ack.subbands().resize(m_event->rcumask.count(), MEPHeader::N_XLETS); - src_range = Range(0, MEPHeader::N_XLETS - 1); + ack.subbands().resize(m_event->rcumask.count(), MEPHeader::N_LOCAL_XLETS); + src_range = Range(0, MEPHeader::N_LOCAL_XLETS - 1); break; default: diff --git a/MAC/APL/PIC/RSPDriver/src/GetWeightsCmd.cc b/MAC/APL/PIC/RSPDriver/src/GetWeightsCmd.cc index 52592597ce7f0819b32b3c111e3448948f0ce063..76dcd221ebc3ef06709c3bba8448e1ac03d571a2 100644 --- a/MAC/APL/PIC/RSPDriver/src/GetWeightsCmd.cc +++ b/MAC/APL/PIC/RSPDriver/src/GetWeightsCmd.cc @@ -61,9 +61,9 @@ void GetWeightsCmd::ack(CacheBuffer& cache) m_event->rcumask.count(), MEPHeader::N_BEAMLETS); - // copy from offset N_XLETS in the cache - Range src_range = Range(MEPHeader::N_XLETS, - MEPHeader::N_XLETS + MEPHeader::N_BEAMLETS - 1); + // copy from offset N_LOCAL_XLETS in the cache + Range src_range = Range(MEPHeader::N_LOCAL_XLETS, + MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS - 1); int result_rcu = 0; for (int cache_rcu = 0; diff --git a/MAC/APL/PIC/RSPDriver/src/RCURead.cc b/MAC/APL/PIC/RSPDriver/src/RCURead.cc index b2118f1ef053158eb649bfa278a618ca3f15e197..3e2217cdbeb0099c13c016a6cd29f9491d810f38 100644 --- a/MAC/APL/PIC/RSPDriver/src/RCURead.cc +++ b/MAC/APL/PIC/RSPDriver/src/RCURead.cc @@ -85,7 +85,7 @@ GCFEvent::TResult RCURead::handleack(GCFEvent& event, GCFPortInterface& /*port*/ if (0 == GET_CONFIG("RSPDriver.LOOPBACK_MODE", i)) { - EPA_Protocol::RCUHandler cachedvalue = { x.getSpecinv(), y.getSpecinv(), 0, x.getDelay(), 0, y.getDelay(), 0 }; + EPA_Protocol::RCUHandler cachedvalue = { x.getDelay(), 0, y.getDelay(), 0 }; if (memcmp(&cachedvalue, &rcusettings.ap, sizeof(EPA_Protocol::RCUHandler))) { LOG_WARN("LOOPBACK CHECK FAILED: RCURead mismatch "); @@ -93,8 +93,6 @@ GCFEvent::TResult RCURead::handleack(GCFEvent& event, GCFPortInterface& /*port*/ } else { - x.setSpecinv(rcusettings.ap.spec_inv_x); - y.setSpecinv(rcusettings.ap.spec_inv_y); x.setDelay(rcusettings.ap.input_delay_x); y.setDelay(rcusettings.ap.input_delay_y); } diff --git a/MAC/APL/PIC/RSPDriver/src/RCUWrite.cc b/MAC/APL/PIC/RSPDriver/src/RCUWrite.cc index 81cc1453f81bb086ce08c0731da982ae8d0cc152..eedf51c02ad349664b2bd098b1eab0139ae74b19 100644 --- a/MAC/APL/PIC/RSPDriver/src/RCUWrite.cc +++ b/MAC/APL/PIC/RSPDriver/src/RCUWrite.cc @@ -67,8 +67,6 @@ void RCUWrite::sendrequest() EPARcuSettingsEvent rcusettings; rcusettings.hdr.set(MEPHeader::RCU_SETTINGS_HDR, 1 << getCurrentIndex()); // also sets payload_length rcusettings.ap = EPA_Protocol::RCUHandler(); - rcusettings.ap.spec_inv_x = x.getSpecinv(); - rcusettings.ap.spec_inv_y = y.getSpecinv(); rcusettings.ap.input_delay_x = x.getDelay(); rcusettings.ap.input_delay_y = y.getDelay(); @@ -98,7 +96,7 @@ GCFEvent::TResult RCUWrite::handleack(GCFEvent& event, GCFPortInterface& /*port* } uint8 global_blp = (getBoardId() * StationSettings::instance()->nrBlpsPerBoard()) + getCurrentIndex(); - Cache::getInstance().getBack().getRCUSettings().getState().confirmed(global_blp); + //Cache::getInstance().getBack().getRCUSettings().getState().applied(global_blp); return GCFEvent::HANDLED; } diff --git a/MAC/APL/PIC/RSPDriver/src/RSPDriver.cc b/MAC/APL/PIC/RSPDriver/src/RSPDriver.cc index 191658190759be55d6c4482467a3838780b11547..a5f80f84358da2cbf1fcc1f958a0b36c564d935d 100644 --- a/MAC/APL/PIC/RSPDriver/src/RSPDriver.cc +++ b/MAC/APL/PIC/RSPDriver/src/RSPDriver.cc @@ -304,6 +304,16 @@ void RSPDriver::addAllSyncActions() */ for (int boardid = 0; boardid < StationSettings::instance()->nrRspBoards(); boardid++) { + /* + * Clear the board if needed + */ + if (1 == GET_CONFIG("RSPDriver.WRITE_RSU", i)) + { + RSUWrite* rsuwrite = new RSUWrite(m_board[boardid], boardid); + ASSERT(rsuwrite); + m_scheduler.addSyncAction(rsuwrite); + } + if (1 == GET_CONFIG("RSPDriver.WRITE_TDS_PROTOCOL", i)) { TDSProtocolWrite* tdsprotocolwrite = new TDSProtocolWrite(m_board[boardid], boardid); @@ -332,16 +342,6 @@ void RSPDriver::addAllSyncActions() m_scheduler.addSyncAction(versionread); } - /* - * Clear the board if needed - */ - if (1 == GET_CONFIG("RSPDriver.WRITE_RSU", i)) - { - RSUWrite* rsuwrite = new RSUWrite(m_board[boardid], boardid); - ASSERT(rsuwrite); - m_scheduler.addSyncAction(rsuwrite); - } - /* * Schedule register writes for soft PPS if configured. * diff --git a/MAC/APL/PIC/RSPDriver/src/RSPDriver.conf.in b/MAC/APL/PIC/RSPDriver/src/RSPDriver.conf.in index fb0b6a74b9948336e11f1dac4b78c22b9e49a09a..57a6144279499fdb44732a99d3a3e2f2f0e85362 100644 --- a/MAC/APL/PIC/RSPDriver/src/RSPDriver.conf.in +++ b/MAC/APL/PIC/RSPDriver/src/RSPDriver.conf.in @@ -42,7 +42,7 @@ RSPDriver.SOFTPPS=0 #RSPDriver.MAC_ADDR_0=00:00:00:00:00:08 # lofar27:eth2:00:50:04:32:B8:5C #RSPDriver.MAC_ADDR_0=00:50:04:32:B8:5C -RSPDriver.MAC_ADDR_0=00:00:00:00:00:13 +RSPDriver.MAC_ADDR_0=10:FA:00:00:13:00 RSPDriver.MAC_ADDR_1=00:00:00:00:00:FD RSPDriver.MAC_ADDR_2=00:00:00:00:00:03 RSPDriver.MAC_ADDR_3=00:00:00:00:00:04 diff --git a/MAC/APL/PIC/RSPDriver/src/SSRead.cc b/MAC/APL/PIC/RSPDriver/src/SSRead.cc index eb730e59c7576b98a9e7f4f0e2490dab88859b1d..0035adc82367d4880902f78813a54468ffd491fd 100644 --- a/MAC/APL/PIC/RSPDriver/src/SSRead.cc +++ b/MAC/APL/PIC/RSPDriver/src/SSRead.cc @@ -90,7 +90,7 @@ GCFEvent::TResult SSRead::handleack(GCFEvent& event, GCFPortInterface& /*port*/) // create array point to data in the response event Array<uint16, 2> subbands((uint16*)&ss.subbands, - shape(MEPHeader::N_XBLETS, MEPHeader::N_POL), + shape(MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS, MEPHeader::N_POL), neverDeleteData); if (0 == GET_CONFIG("RSPDriver.LOOPBACK_MODE", i)) diff --git a/MAC/APL/PIC/RSPDriver/src/SSWrite.cc b/MAC/APL/PIC/RSPDriver/src/SSWrite.cc index 7b9f26d5c290d93ec4d510987dcfd067a99b48d4..540a8d6eb834b8a6c81fc3d25180260612c4ffb0 100644 --- a/MAC/APL/PIC/RSPDriver/src/SSWrite.cc +++ b/MAC/APL/PIC/RSPDriver/src/SSWrite.cc @@ -63,7 +63,7 @@ void SSWrite::sendrequest() // create array to contain the subband selection Array<uint16, 2> subbands((uint16*)&ss.subbands, - shape(MEPHeader::N_XBLETS, MEPHeader::N_POL), + shape(MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS, MEPHeader::N_POL), neverDeleteData); // copy the actual values from the cache diff --git a/MAC/APL/PIC/RSPDriver/src/SetSubbandsCmd.cc b/MAC/APL/PIC/RSPDriver/src/SetSubbandsCmd.cc index 56af421239d9f0c9d6c837b01d9e296749346fb2..081136cf032b5c24364c037323c33c7178906712 100644 --- a/MAC/APL/PIC/RSPDriver/src/SetSubbandsCmd.cc +++ b/MAC/APL/PIC/RSPDriver/src/SetSubbandsCmd.cc @@ -68,7 +68,7 @@ void SetSubbandsCmd::apply(CacheBuffer& cache, bool /*setModFlag*/) case SubbandSelection::BEAMLET: { - dst_range = Range(MEPHeader::N_XLETS, MEPHeader::N_XLETS + MEPHeader::N_BEAMLETS - 1); + dst_range = Range(MEPHeader::N_LOCAL_XLETS, MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS - 1); for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { @@ -86,7 +86,7 @@ void SetSubbandsCmd::apply(CacheBuffer& cache, bool /*setModFlag*/) case SubbandSelection::XLET: { - dst_range = Range(0, MEPHeader::N_XLETS - 1); + dst_range = Range(0, MEPHeader::N_LOCAL_XLETS - 1); for (int cache_rcu = 0; cache_rcu < StationSettings::instance()->nrRcus(); cache_rcu++) { if (m_event->rcumask[cache_rcu]) diff --git a/MAC/APL/PIC/RSPDriver/src/SetWeightsCmd.cc b/MAC/APL/PIC/RSPDriver/src/SetWeightsCmd.cc index c71d62e817b761c0f896ec2790f8836586730cbc..2b881b4d29c1d6561c65d35ace0ca33d7a09cd40 100644 --- a/MAC/APL/PIC/RSPDriver/src/SetWeightsCmd.cc +++ b/MAC/APL/PIC/RSPDriver/src/SetWeightsCmd.cc @@ -76,9 +76,9 @@ void SetWeightsCmd::ack(CacheBuffer& /*cache*/) void SetWeightsCmd::apply(CacheBuffer& cache, bool /*setModFlag*/) { - // copy to offset N_XLETS in the cache - Range dst_range = Range(MEPHeader::N_XLETS, - MEPHeader::N_XLETS + MEPHeader::N_BEAMLETS - 1); + // copy to offset N_LOCAL_XLETS in the cache + Range dst_range = Range(MEPHeader::N_LOCAL_XLETS, + MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS - 1); int input_rcu = 0; for (int cache_rcu = 0; diff --git a/MAC/APL/PIC/RSPDriver/src/StatusRead.cc b/MAC/APL/PIC/RSPDriver/src/StatusRead.cc index 3a5672d82a80bf260be3b6db94df94c276f0e7ec..91d00208e65e6188606e5cea4825356ae2a214b6 100644 --- a/MAC/APL/PIC/RSPDriver/src/StatusRead.cc +++ b/MAC/APL/PIC/RSPDriver/src/StatusRead.cc @@ -85,8 +85,6 @@ GCFEvent::TResult StatusRead::handleack(GCFEvent& event, GCFPortInterface& /*por // copy board status memcpy(&status.board()(getBoardId()), &ack.board, sizeof(BoardStatus)); - LOG_DEBUG_STR("RSR_STATUS[" << getBoardId() << "]=" << ack.board); - // sanity check on SYNC status, status for all AP's must be the same if (ack.board.ap0_sync.sample_offset != ack.board.ap1_sync.sample_offset || ack.board.ap0_sync.sample_offset != ack.board.ap2_sync.sample_offset diff --git a/MAC/APL/PIC/RSPDriver/src/Tuner.cc b/MAC/APL/PIC/RSPDriver/src/Tuner.cc index fdf180473fc97522269340ca7c35e4c88fff9c38..44bde9d9a3a2d2cedb40e2ce4907043d3053b1c0 100644 --- a/MAC/APL/PIC/RSPDriver/src/Tuner.cc +++ b/MAC/APL/PIC/RSPDriver/src/Tuner.cc @@ -182,7 +182,7 @@ GCFEvent::TResult Tuner::initialize(GCFEvent& e, GCFPortInterface& port) ss.rcumask.set(i); // all rcu's } - ss.subbands().resize(1, MEPHeader::N_XBLETS); + ss.subbands().resize(1, MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS); ss.subbands() = 0; if (!m_server.send(ss)) @@ -278,7 +278,7 @@ GCFEvent::TResult Tuner::tunein(GCFEvent& e, GCFPortInterface& port) ss.rcumask = m_device_set; - ss.subbands().resize(1, MEPHeader::N_XBLETS); + ss.subbands().resize(1, MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS); ss.subbands() = 0; int s = 0; diff --git a/MAC/APL/PIC/RSPDriver/src/UpdSubbandsCmd.cc b/MAC/APL/PIC/RSPDriver/src/UpdSubbandsCmd.cc index 529db269f80ca557cdf2679ef5372c5f15b11ff2..19702ce756de30ab36df6584cabb467c74095f7d 100644 --- a/MAC/APL/PIC/RSPDriver/src/UpdSubbandsCmd.cc +++ b/MAC/APL/PIC/RSPDriver/src/UpdSubbandsCmd.cc @@ -93,12 +93,12 @@ void UpdSubbandsCmd::complete(CacheBuffer& cache) switch (m_event->type) { case SubbandSelection::BEAMLET: ack.subbands().resize(m_event->rcumask.count(), MEPHeader::N_BEAMLETS); - src_range = Range(MEPHeader::N_XLETS, MEPHeader::N_XLETS + MEPHeader::N_BEAMLETS - 1); + src_range = Range(MEPHeader::N_LOCAL_XLETS, MEPHeader::N_LOCAL_XLETS + MEPHeader::N_BEAMLETS - 1); break; case SubbandSelection::XLET: - ack.subbands().resize(m_event->rcumask.count(), MEPHeader::N_XLETS); - src_range = Range(0, MEPHeader::N_XLETS - 1); + ack.subbands().resize(m_event->rcumask.count(), MEPHeader::N_LOCAL_XLETS); + src_range = Range(0, MEPHeader::N_LOCAL_XLETS - 1); break; default: diff --git a/MAC/APL/PIC/RSPDriver/src/VersionsRead.cc b/MAC/APL/PIC/RSPDriver/src/VersionsRead.cc index fd7417548b04c664b1ac37ae87a93b57013ddf89..d57f17063d0bc32b8d33bbed614c138b3bbe0914 100644 --- a/MAC/APL/PIC/RSPDriver/src/VersionsRead.cc +++ b/MAC/APL/PIC/RSPDriver/src/VersionsRead.cc @@ -78,22 +78,10 @@ GCFEvent::TResult VersionsRead::handleack(GCFEvent& event, GCFPortInterface& por if (MEPHeader::DST_RSP == ack.hdr.m_fields.addr.dstid) { - LOG_DEBUG(formatString("Version information for '%s' is [rsp_version:%d, fpga_version:%d.%d, fpga_id:%d]", - port.getName().c_str(), - ack.version.rsp, - ack.version.fpga_maj, ack.version.fpga_min, - ack.version.fpga_id)); - Cache::getInstance().getBack().getVersions().bp()(getBoardId()) = ack.version; } else { - LOG_DEBUG(formatString("Version information for '%s' is [fpga_version:%d.%d, fpga_id:%d, board_pos:%d]", - port.getName().c_str(), - ack.version.fpga_maj, ack.version.fpga_min, - ack.version.fpga_id, - ack.version.board_pos)); - int ap_index = -1; switch (ack.hdr.m_fields.addr.dstid) { case MEPHeader::DST_BLP0: diff --git a/MAC/APL/PIC/RSPDriver/src/XstRead.cc b/MAC/APL/PIC/RSPDriver/src/XstRead.cc index a4a1cde0980a4c763411bc76f9d996cd1913bbef..65d769af47c9b44d55b767ca04bd100c645e8bb5 100644 --- a/MAC/APL/PIC/RSPDriver/src/XstRead.cc +++ b/MAC/APL/PIC/RSPDriver/src/XstRead.cc @@ -55,7 +55,7 @@ void XstRead::sendrequest() uint16 offset = (getCurrentIndex() % XST_N_FRAGMENTS) * MEPHeader::XST_FRAGMENT_SIZE; // firmware now indexes from 1 instead of 0 - offset += (GET_CONFIG("RSPDriver.XST_FIRST_RSP_BOARD", i) + 1) * MEPHeader::N_XLETS * MEPHeader::N_POL * sizeof(complex<uint32>); + offset += (GET_CONFIG("RSPDriver.XST_FIRST_RSP_BOARD", i) + 1) * MEPHeader::N_LOCAL_XLETS * MEPHeader::N_POL * sizeof(complex<uint32>); LOG_DEBUG_STR("XstRead::offset=" << offset); diff --git a/MAC/APL/PIC/RSPDriver/src/rspctl.cc b/MAC/APL/PIC/RSPDriver/src/rspctl.cc index 2658e716f285c38529c213d827fa7d3ab428e322..08bb52370f8e8bd07b7394889ab1d9554d7c8d40 100644 --- a/MAC/APL/PIC/RSPDriver/src/rspctl.cc +++ b/MAC/APL/PIC/RSPDriver/src/rspctl.cc @@ -774,9 +774,12 @@ GCFEvent::TResult StatusCommand::ack(GCFEvent& event) } BoardStatus& board = ack.sysstatus.board()(0); - logMessage(cout,formatString("1.2 V: %3.2f , 2.5 V: %3.2f", - 0.013 * board.rsp.voltage_1_5, - 0.0172 * board.rsp.voltage_3_3)); + logMessage(cout,formatString("1.2 V: %3.2f , 2.5 V: %3.2f, 3.3 V: %3.2f", + (2.5/192.0) * board.rsp.voltage_1_2, + (3.3/192.0) * board.rsp.voltage_2_5, + (5.0/192.0) * board.rsp.voltage_3_3)); + logMessage(cout,formatString("PCB_temp: %2d ", + board.rsp.pcb_temp)); logMessage(cout,formatString("BP_temp: %2d , BP_clock: %3d", board.rsp.bp_temp, board.rsp.bp_clock)); logMessage(cout,formatString("Temp AP0: %3d , AP1: %3d , AP2: %3d , AP3: %3d", @@ -797,7 +800,6 @@ GCFEvent::TResult StatusCommand::ack(GCFEvent& event) board.diag.ap3_ri_errors)); logMessage(cout,formatString("Sync diff count samples slices")); for (int blp = 0; blp < 4; blp++) { -// BSStatus* bs= &(board.ap0_sync)+(blp*sizeof(BSStatus)); BSStatus* bs= &(board.ap0_sync)+blp; logMessage(cout,formatString("%d: %9ld %9ld %9ld %9ld", blp, bs->ext_count, bs->sync_count, @@ -805,8 +807,7 @@ GCFEvent::TResult StatusCommand::ack(GCFEvent& event) } logMessage(cout,formatString("Status pllX pllY overflowX overflowY")); for (int ap = 0; ap < 4; ap++) { -// APStatus* as= &(board.ap0_rcu)+(ap*sizeof(APStatus)); - APStatus* as= &(board.ap0_rcu)+ap; + RCUStatus* as= &(board.blp0_rcu)+ap; logMessage(cout,formatString("%d: %9ld %9ld %9ld %9ld", ap, as->pllx, as->plly, as->nof_overflowx, as->nof_overflowy)); @@ -1321,8 +1322,9 @@ GCFEvent::TResult VersionCommand::ack(GCFEvent& e) { for (int rsp=0; rsp < get_ndevices(); rsp++) { - logMessage(cout,formatString("RSP[%02d] BP version = %d.%d, AP version = %d.%d", + logMessage(cout,formatString("RSP[%02d] RSP version = %d, BP version = %d.%d, AP version = %d.%d", rsp, + ack.versions.bp()(rsp).rsp_version, ack.versions.bp()(rsp).fpga_maj, ack.versions.bp()(rsp).fpga_min, ack.versions.ap()(rsp).fpga_maj, diff --git a/MAC/APL/PIC/RSPDriver/test/EPAStub.cc b/MAC/APL/PIC/RSPDriver/test/EPAStub.cc index d86f5c9c168631b2018412a08ac16f37831967dd..ab757f9101a77020038c051e2a128e2ed091bb96 100644 --- a/MAC/APL/PIC/RSPDriver/test/EPAStub.cc +++ b/MAC/APL/PIC/RSPDriver/test/EPAStub.cc @@ -122,8 +122,12 @@ EPAStub::EPAStub(string name) m_reg[MEPHeader::RCU][MEPHeader::RCU_RESULTY].size = MEPHeader::RCU_RESULT_SIZE; // CR_CONTROL register for all AP's and the BP (hence the + 1) - m_reg[MEPHeader::CR][MEPHeader::CR_CONTROL].addr = new char[MEPHeader::CR_CONTROL_SIZE * (GET_CONFIG("EPAStub.N_BLPS", i) + 1)]; - m_reg[MEPHeader::CR][MEPHeader::CR_CONTROL].size = MEPHeader::CR_CONTROL_SIZE; + m_reg[MEPHeader::CR][MEPHeader::CR_SOFTCLEAR].addr = new char[MEPHeader::CR_CONTROL_SIZE * (GET_CONFIG("EPAStub.N_BLPS", i) + 1)]; + m_reg[MEPHeader::CR][MEPHeader::CR_SOFTCLEAR].size = MEPHeader::CR_CONTROL_SIZE; + m_reg[MEPHeader::CR][MEPHeader::CR_SOFTSYNC].addr = new char[MEPHeader::CR_CONTROL_SIZE * (GET_CONFIG("EPAStub.N_BLPS", i) + 1)]; + m_reg[MEPHeader::CR][MEPHeader::CR_SOFTSYNC].size = MEPHeader::CR_CONTROL_SIZE; + m_reg[MEPHeader::CR][MEPHeader::CR_SYNCDISABLE].addr = new char[MEPHeader::CR_CONTROL_SIZE * (GET_CONFIG("EPAStub.N_BLPS", i) + 1)]; + m_reg[MEPHeader::CR][MEPHeader::CR_SYNCDISABLE].size = MEPHeader::CR_CONTROL_SIZE; m_reg[MEPHeader::XST][MEPHeader::XST_0_X].addr = new char[MEPHeader::XST_STATS_SIZE * GET_CONFIG("EPAStub.N_BLPS", i)]; m_reg[MEPHeader::XST][MEPHeader::XST_0_X].size = MEPHeader::XST_STATS_SIZE; diff --git a/MAC/APL/PIC/RSPDriver/test/RSPTest.cc b/MAC/APL/PIC/RSPDriver/test/RSPTest.cc index ecf00e39e1ebef0440cf2f49954e6fa8a82d1860..4415a30731a28169fc5e2f17d3b0386668dd047e 100644 --- a/MAC/APL/PIC/RSPDriver/test/RSPTest.cc +++ b/MAC/APL/PIC/RSPDriver/test/RSPTest.cc @@ -435,7 +435,7 @@ GCFEvent::TResult RSPTest::test006(GCFEvent& e, GCFPortInterface& port) TESTC_ABORT(ack.status == SUCCESS, RSPTest::final); LOG_INFO_STR("ack.time=" << ack.timestamp); - LOG_INFO_STR("board=" << ack.sysstatus.board()); + // << no longer supported LOG_INFO_STR("board=" << ack.sysstatus.board()); TRAN(RSPTest::test007); } @@ -721,7 +721,7 @@ GCFEvent::TResult RSPTest::test010(GCFEvent& e, GCFPortInterface& port) LOG_INFO_STR("upd.time=" << upd.timestamp); LOG_INFO_STR("upd.handle=" << upd.handle); - LOG_INFO_STR("upd.sysstatus.board=" << upd.sysstatus.board()); + // << no longer supported LOG_INFO_STR("upd.sysstatus.board=" << upd.sysstatus.board()); if (updcount++ > 4) // four seconds { diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BeamletWeights.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BeamletWeights.h index bf77adb7558cc5cead0b71752fcfce02e23373cb..48585bd76e4424637ca8d2f03dc4f2f8ec032a22 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BeamletWeights.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BeamletWeights.h @@ -69,7 +69,7 @@ namespace LOFAR { * The beamlet weights. * Dimension 1: nr_timesteps (>1) * Dimension 2: count(rcumask) - * Dimension 3: N_BEAMLETS (or N_XBLETS in Cache.cc) + * Dimension 3: N_LOCAL_XLETS + N_BEAMLETS * REMOVED Dimension 4, now using rcumask... */ blitz::Array<std::complex<int16>, NDIM> m_weights; diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPHeader.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPHeader.h index e82b04459524985686b8acefe876a0bb2343f2de..36ce7ff0754fdc3bcc66a7b44c040c8a729844d4 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPHeader.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/MEPHeader.h @@ -163,7 +163,9 @@ namespace LOFAR { static const uint8 RCU_PROTOCOLY = 0x03; static const uint8 RCU_RESULTY = 0x04; - static const uint8 CR_CONTROL = 0x00; + static const uint8 CR_SOFTCLEAR = 0x00; + static const uint8 CR_SOFTSYNC = 0x01; + static const uint8 CR_SYNCDISABLE = 0x02; static const uint8 XST_STATS = 0x00; static const uint8 XST_0_X = XST_STATS + 0; // 8 registers, two for each AP @@ -182,7 +184,7 @@ namespace LOFAR { * settings to set interleaving of beamlets. */ static const uint8 CDO_SETTINGS = 0x00; - static const uint8 CDO_HEADER = 0x01; + static const uint8 CDO_HEADER = 0x01; static const uint8 BS_NOF_SAMPLES_PER_SYNC = 0x00; @@ -214,15 +216,15 @@ namespace LOFAR { * The N_BEAMLETS are a selection from this * number of beamlets. */ - static const uint16 N_SUBBANDS = 512; - static const uint16 N_GLOBAL_XLETS = 54; // Total number of crosslets over whole station (FTS-1.5 spec) - static const uint16 N_XLETS = 4; // Number of crosslets per RSP board - static const uint16 N_BEAMLETS = 54; // FTS-1.5 spec, final design will have > 200 BEAMLETS + N_XLETS - static const uint16 N_XBLETS = N_XLETS + N_BEAMLETS; // RSP registers combine XLETS and BEAMLETS - static const uint16 N_POL = 2; // number of polarizations - static const uint16 N_PHASE = 2; // number of phases in a complex number - static const uint16 N_PHASEPOL = N_PHASE * N_POL; // number of phase polarizations - static const uint16 XLET_SIZE = N_POL * sizeof(std::complex<uint32>); + static const uint16 N_SUBBANDS = 512; + static const uint16 N_REMOTE_XLETS = 54; + static const uint16 N_LOCAL_XLETS = 4; + static const uint16 N_BEAMLETS = 216; + static const uint16 N_LOCAL_BEAMLETS = 54; + static const uint16 N_POL = 2; // number of polarizations + static const uint16 N_PHASE = 2; // number of phases in a complex number + static const uint16 N_PHASEPOL = N_PHASE * N_POL; // number of phase polarizations + static const uint16 XLET_SIZE = N_POL * sizeof(std::complex<uint32>); // // Registers too large to send in a single ethernet frame @@ -231,11 +233,11 @@ namespace LOFAR { static const uint16 FRAGMENT_SIZE = 1024; // - // XST register will be too large to get in one message when N_GLOBAL_XLETS = 96 - // When 96 crosslets are supported, the XST_FRAGMENT_SIZE should be divided by 2. + // XST register is too large to read in one Ethernet frame + // These constants are used to read the fragments. // static const uint16 MAX_XLETS_PER_FRAGMENT = FRAGMENT_SIZE / XLET_SIZE; - static const uint16 XST_FRAGMENT_SIZE = MIN(N_GLOBAL_XLETS, MAX_XLETS_PER_FRAGMENT) * XLET_SIZE; + static const uint16 XST_FRAGMENT_SIZE = MIN(N_REMOTE_XLETS, MAX_XLETS_PER_FRAGMENT) * XLET_SIZE; /*@}*/ @@ -243,7 +245,7 @@ namespace LOFAR { /** * Define size of each register. */ - static const uint16 RSR_STATUS_SIZE = 164; + static const uint16 RSR_STATUS_SIZE = 200; static const uint16 RSR_VERSION_SIZE = 2; static const uint16 RSU_FLASHRW_SIZE = 1024; @@ -259,14 +261,14 @@ namespace LOFAR { static const uint16 DIAG_RESULTS_SIZE = 4096; static const uint16 DIAG_SELFTEST_SIZE = 4; - static const uint16 SS_SELECT_SIZE = N_XBLETS * N_POL * sizeof(uint16); + static const uint16 SS_SELECT_SIZE = (N_LOCAL_XLETS + N_BEAMLETS) * N_POL * sizeof(uint16); - static const uint16 BF_XROUT_SIZE = N_XBLETS * N_PHASEPOL * sizeof(int16); - static const uint16 BF_XIOUT_SIZE = N_XBLETS * N_PHASEPOL * sizeof(int16); - static const uint16 BF_YROUT_SIZE = N_XBLETS * N_PHASEPOL * sizeof(int16); - static const uint16 BF_YIOUT_SIZE = N_XBLETS * N_PHASEPOL * sizeof(int16); + static const uint16 BF_XROUT_SIZE = (N_LOCAL_XLETS + N_BEAMLETS) * N_PHASEPOL * sizeof(int16); + static const uint16 BF_XIOUT_SIZE = (N_LOCAL_XLETS + N_BEAMLETS) * N_PHASEPOL * sizeof(int16); + static const uint16 BF_YROUT_SIZE = (N_LOCAL_XLETS + N_BEAMLETS) * N_PHASEPOL * sizeof(int16); + static const uint16 BF_YIOUT_SIZE = (N_LOCAL_XLETS + N_BEAMLETS) * N_PHASEPOL * sizeof(int16); - static const uint16 BST_POWER_SIZE = N_BEAMLETS * N_POL * sizeof(uint32); // TODO: should this be N_XBLETS too? + static const uint16 BST_POWER_SIZE = N_LOCAL_BEAMLETS * N_POL * sizeof(uint32); static const uint16 SST_POWER_SIZE = N_SUBBANDS * N_POL * sizeof(uint32); @@ -276,14 +278,14 @@ namespace LOFAR { static const uint16 CR_CONTROL_SIZE = 1; - static const uint16 XST_STATS_SIZE = (N_GLOBAL_XLETS + N_XLETS) * XLET_SIZE; + static const uint16 XST_STATS_SIZE = (N_LOCAL_XLETS + N_REMOTE_XLETS) * XLET_SIZE; /** * The CDO register will be extended to * allow setting the UDP/IP header and some * settings to set interleaving of beamlets. */ - static const uint16 CDO_SETTINGS_SIZE = 16; + static const uint16 CDO_SETTINGS_SIZE = 16; static const uint16 CDO_HEADER_SIZE = 32; static const uint16 BS_NOF_SAMPLES_PER_SYNC_SIZE = 4; diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Makefile.am b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Makefile.am index 2b0a35bbd8093a64c1405b0e42d4d120568fd513..5044f74a2599487059761264b4d26987752de255 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Makefile.am +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Makefile.am @@ -1,4 +1,3 @@ - INSTHDRS = \ MEPHeader.h \ MEPData.h \ diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SubbandSelection.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SubbandSelection.h index bdbe0c31f28cd7adc0e95debbf82acc0d14da953..7a2c0039728c25275540ef9dea652eef4f477c5a 100644 --- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SubbandSelection.h +++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SubbandSelection.h @@ -40,7 +40,7 @@ namespace LOFAR { * - subbands[1][nr_selected_subbands]. * * When used in the Cache the dimensions should be: - * - subbands[N_RCUS][N_XBLETS] (combined crosslet and beamlet selection) + * - subbands[N_RCUS][N_LOCAL_XLETS + N_BEAMLETS] (combined crosslet and beamlet selection) * * The values in the subbands array should be 0 <= value < N_SUBBANDS * EPA_Protocol::N_POL */ @@ -77,7 +77,7 @@ namespace LOFAR { /** * Set the type of the subbands selection. - * @param type Type of the subband selection, valid values are SubbandSelection::BEAMLET (array should have 1 to N_BEAMLETS values) or + * @param type Type of the subband selection, valid values are SubbandSelection::BEAMLET (array should have 1 to N_LOCAL_XLETS + N_BEAMLETS values) or * SubbandSelection::XLET (array should have 1 value). */ void setType(int type) { m_type = (uint16)type; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/EPA_Protocol.prot b/MAC/APL/PIC/RSP_Protocol/src/EPA_Protocol.prot index d14ccb57c80820e6fa5dd1a13997265bf84f884d..bddfe169c8ba02cc2249d9c3fc12ad02605baa7d 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/EPA_Protocol.prot +++ b/MAC/APL/PIC/RSP_Protocol/src/EPA_Protocol.prot @@ -39,21 +39,24 @@ prelude = << PRELUDE_END static const int SST_N_FRAGMENTS = MEPHeader::SST_POWER_SIZE / MEPHeader::FRAGMENT_SIZE; static const int N_SST_STATS = MEPHeader::FRAGMENT_SIZE / sizeof(uint32); static const int N_BST_STATS = MIN(MEPHeader::FRAGMENT_SIZE, MEPHeader::BST_POWER_SIZE) / sizeof(uint32); - static const int XST_N_FRAGMENTS = (MEPHeader::N_GLOBAL_XLETS > MEPHeader::MAX_XLETS_PER_FRAGMENT ? 2 : 1); + static const int XST_N_FRAGMENTS = (MEPHeader::N_REMOTE_XLETS > MEPHeader::MAX_XLETS_PER_FRAGMENT ? 2 : 1); static const int N_XST_STATS = MEPHeader::XST_FRAGMENT_SIZE / sizeof(uint32); /*@}*/ - typedef struct RSPStatus // total size 8 bytes + typedef struct RSPStatus // total size 12 bytes { - uint8 voltage_1_5; // measured voltage on 1.5V circuit - uint8 voltage_3_3; // measured voltage on 3.3V circuit - uint8 bp_temp; // board processor temperature - uint8 ap0_temp; // antenna processor 0 temperature - uint8 ap1_temp; // antenna processor 1 temperature - uint8 ap2_temp; // antenna processor 2 temperature - uint8 ap3_temp; // antenna processor 3 temperature - uint8 bp_clock; // board processor system clock speed + uint8 voltage_1_2; // measured 1.2V supply voltage + uint8 voltage_2_5; // measured 2.5V supply voltage + uint8 voltage_3_3; // measured 3.3V supply voltage + uint8 pcb_temp; // RSP board temperature + uint8 bp_temp; // board processor temperature + uint8 ap0_temp; // antenna processor 0 temperature + uint8 ap1_temp; // antenna processor 1 temperature + uint8 ap2_temp; // antenna processor 2 temperature + uint8 ap3_temp; // antenna processor 3 temperature + uint8 bp_clock; // board processor system clock speed + uint16 ffi0; }; typedef struct ETHStatus // total size 12 bytes @@ -87,10 +90,10 @@ prelude = << PRELUDE_END uint16 ap1_ri_errors; // Number of detected errors uint16 ap2_ri_errors; // Number of detected errors uint16 ap3_ri_errors; // Number of detected errors - uint16 ffi; + uint16 ffi0; }; - typedef struct BSStatus // total size 64 bytes + typedef struct BSStatus // total size 16 bytes x 4 = 64 bytes { uint32 ext_count; // number of cycles between external and internal sync, reset uint32 sync_count; // number of internal sync events @@ -98,16 +101,16 @@ prelude = << PRELUDE_END uint32 slice_count; // number of slices in the previous internal sync interval }; - typedef struct APStatus // total size 48 bytes + typedef struct RCUStatus // total size 12 bytes x 4 = 48 bytes { struct { uint8 pllx:1; uint8 plly:1; - uint8 ffi :6; + uint8 ffi0:6; }; - uint8 ffi0; uint8 ffi1; uint8 ffi2; + uint8 ffi3; uint32 nof_overflowx; uint32 nof_overflowy; }; @@ -125,6 +128,12 @@ prelude = << PRELUDE_END uint8 ffi:1; // not used }; + typedef struct ADOStatus // total size 8 bytes + { + uint32 adc_offset_x; + uint32 adc_offset_y; + }; + typedef struct BoardStatus // total size 164 bytes { RSPStatus rsp; @@ -135,20 +144,25 @@ prelude = << PRELUDE_END BSStatus ap1_sync; BSStatus ap2_sync; BSStatus ap3_sync; - APStatus ap0_rcu; - APStatus ap1_rcu; - APStatus ap2_rcu; - APStatus ap3_rcu; + RCUStatus blp0_rcu; + RCUStatus blp1_rcu; + RCUStatus blp2_rcu; + RCUStatus blp3_rcu; RSUStatus cp_status; + ADOStatus blp0_adc_offset; + ADOStatus blp1_adc_offset; + ADOStatus blp2_adc_offset; + ADOStatus blp3_adc_offset; }; typedef struct RSRVersion { - uint8 rsp; // RSP hardware version, undefined for AP's + union { + uint8 rsp_version; // RSP hardware version + uint8 ap_id; // AP identification + }; uint8 fpga_min :4; // FPGA firmware version (minor) uint8 fpga_maj :4; // FPGA firmware version (major) - uint8 fpga_id :4; // 4 bits for FPGA identifier number (0..3) - uint8 board_pos:4; // 4 remaining bits for board_pos (0..1) }; typedef struct RSUReconfig @@ -168,22 +182,30 @@ prelude = << PRELUDE_END typedef struct DIAGBypass { - uint8 ffi0:1; - uint8 pfs :1; // bypass PFS - uint8 pft :1; // bypass PFT - uint8 bf :1; // bypass BF - uint8 ffi1:4; + uint8 dc_disable:1; // enable DC block (high pass filter processing) + uint8 pfs_bypass:1; // bypass PFS + uint8 pft_bypass:1; // bypass PFT + uint8 bf_bypass :1; // bypass BF + uint8 si_enable :1; // enable spectral inversion processing + uint8 ffi0 :1; + uint8 use_sync :1; // use (soft)sync, useful when WG single slice mode is used + uint8 use_resync:1; // use (soft)sync realigned to BLP output sync to preserve X,Y order in DIAG results buffer + }; + + typedef struct DIAGSelftest + { + uint8 interface; // 0=ring, 1=rcux, 2=rcuy, 3=lcu, 4=cep, 5=serdes + uint8 mode; // 1=local loopback, 2=remote loopback, 3=transmit, 4=receive, 5=lane, 6=lane single + uint8 duration; // 0=debug, 1=short, 2=normal, 3=long + uint8 lane; // Ring LVDS bit lane index, raning from 0 to 13 }; typedef struct RCUHandler { - uint8 spec_inv_x :1; // spectral inversion bit for X-receiver - uint8 spec_inv_y :1; // spectral inversion bit for Y-receiver - uint8 ffi0 :6; uint8 input_delay_x:7; // input delay for X-receiver - uint8 ffi1 :1; + uint8 ffi0 :1; uint8 input_delay_y:7; // input delay for Y-receiver - uint8 ffi2 :1; + uint8 ffi1 :1; }; typedef struct CRControl @@ -194,89 +216,6 @@ prelude = << PRELUDE_END uint8 ffi :5; }; - /*@{*/ - /** - * Output operators for the system status types. - */ - inline std::ostream& operator<<(std::ostream& s, const BoardStatus& stat) - { -#if 0 - return s; -#else - return s << "[" << std::endl - << "voltage_1_5 =" << int(stat.rsp.voltage_1_5) << std::endl - << "voltage_3_3 =" << int(stat.rsp.voltage_3_3) << std::endl - << "bp_temp = " << int(stat.rsp.bp_temp) << std::endl - << "ap0_temp = " << int(stat.rsp.ap0_temp) << std::endl - << "ap1_temp = " << int(stat.rsp.ap1_temp) << std::endl - << "ap2_temp = " << int(stat.rsp.ap2_temp) << std::endl - << "ap3_temp = " << int(stat.rsp.ap3_temp) << std::endl - << "bp_clock = " << int(stat.rsp.bp_clock) << std::endl - << "nof_frames = " << stat.eth.nof_frames << std::endl - << "nof_error = " << stat.eth.nof_errors << std::endl - << "last_error = " << int(stat.eth.last_error) << std::endl - << "seqnr = " << stat.mep.seqnr << std::endl - << "error = " << int(stat.mep.error) << std::endl - << std::endl - << "ap0_sync.ext_count = " << stat.ap0_sync.ext_count << std::endl - << "ap0_sync.sync_count = " << stat.ap0_sync.sync_count << std::endl - << "ap0_sync.sample_offset = " << stat.ap0_sync.sample_offset << std::endl - << "ap0_sync.slice_count = " << stat.ap0_sync.slice_count << std::endl - << "ap1_sync.ext_count = " << stat.ap1_sync.ext_count << std::endl - << "ap1_sync.sync_count = " << stat.ap1_sync.sync_count << std::endl - << "ap1_sync.sample_offset = " << stat.ap1_sync.sample_offset << std::endl - << "ap1_sync.slice_count = " << stat.ap1_sync.slice_count << std::endl - << "ap2_sync.ext_count = " << stat.ap2_sync.ext_count << std::endl - << "ap2_sync.sync_count = " << stat.ap2_sync.sync_count << std::endl - << "ap2_sync.sample_offset = " << stat.ap2_sync.sample_offset << std::endl - << "ap2_sync.slice_count = " << stat.ap2_sync.slice_count << std::endl - << "ap3_sync.ext_count = " << stat.ap3_sync.ext_count << std::endl - << "ap3_sync.sync_count = " << stat.ap3_sync.sync_count << std::endl - << "ap3_sync.sample_offset = " << stat.ap3_sync.sample_offset << std::endl - << "ap3_sync.slice_count = " << stat.ap3_sync.slice_count << std::endl - << std::endl - << "diag.interface = " << int(stat.diag.interface) << std::endl - << "diag.mode = " << int(stat.diag.mode) << std::endl - << "diag.ri_errors = " << stat.diag.ri_errors << std::endl - << "diag.rcux_errors = " << stat.diag.rcux_errors << std::endl - << "diag.rcuy_errors = " << stat.diag.rcuy_errors << std::endl - << "diag.lcu_errors = " << stat.diag.lcu_errors << std::endl - << "diag.cep_errors = " << stat.diag.cep_errors << std::endl - << "diag.serdes_errors = " << stat.diag.serdes_errors << std::endl - << "diag.ap0_ri_errors = " << stat.diag.ap0_ri_errors << std::endl - << "diag.ap1_ri_errors = " << stat.diag.ap1_ri_errors << std::endl - << "diag.ap2_ri_errors = " << stat.diag.ap2_ri_errors << std::endl - << "diag.ap3_ri_errors = " << stat.diag.ap3_ri_errors << std::endl - << std::endl - << "ap0_rcu.pllx = " << (int)stat.ap0_rcu.pllx << std::endl - << "ap0_rcu.plly = " << (int)stat.ap0_rcu.plly << std::endl - << "ap0_rcu.nof_overflowx = " << stat.ap0_rcu.nof_overflowx << std::endl - << "ap0_rcu.nof_overflowy = " << stat.ap0_rcu.nof_overflowy << std::endl - << "ap1_rcu.pllx = " << (int)stat.ap1_rcu.pllx << std::endl - << "ap1_rcu.plly = " << (int)stat.ap1_rcu.plly << std::endl - << "ap1_rcu.nof_overflowx = " << (int)stat.ap1_rcu.nof_overflowx << std::endl - << "ap1_rcu.nof_overflowy = " << stat.ap1_rcu.nof_overflowy << std::endl - << "ap2_rcu.pllx = " << (int)stat.ap2_rcu.pllx << std::endl - << "ap2_rcu.plly = " << (int)stat.ap2_rcu.plly << std::endl - << "ap2_rcu.nof_overflowx = " << stat.ap2_rcu.nof_overflowx << std::endl - << "ap2_rcu.nof_overflowy = " << stat.ap2_rcu.nof_overflowy << std::endl - << "ap3_rcu.pllx = " << (int)stat.ap3_rcu.pllx << std::endl - << "ap3_rcu.plly = " << (int)stat.ap3_rcu.plly << std::endl - << "ap3_rcu.nof_overflowx = " << stat.ap3_rcu.nof_overflowx << std::endl - << "ap3_rcu.nof_overflowy = " << stat.ap3_rcu.nof_overflowy << std::endl - << std::endl - << "cp_status.rdy = " << int(stat.cp_status.rdy) << std::endl - << "cp_status.err = " << int(stat.cp_status.err) << std::endl - << "cp_status.fpga = " << int(stat.cp_status.fpga) << std::endl - << "cp_status.im = " << int(stat.cp_status.im) << std::endl - << "cp_status.trig = " << int(stat.cp_status.trig) << ", " << std::endl - - << "]" << std::endl; -#endif - } - - /*@}*/ - PRELUDE_END; // @@ -605,46 +544,9 @@ event = { type = "MEPHeader"; userdefined; }; - param = { - // - // interface - // 0: ring - // 1: rcu x - // 2: rcu y - // 3: lcu (control) - // 4: cep (output) - // 5: serdes (b2b = board2board) - // - name = "interface"; - type = "uint8"; - }; - param = { - // - // testmode - // 1: local loopback - // 2: remote loopback - // 3: transmit - // 4: receive - // 5: lane - // 6: lane single - // - name = "mode"; - type = "uint8"; - }; - param = { - // - // selftest duration - // 0:debug - // 1:short - // 2:normal - // 3:long - // - name = "duration"; - type = "uint8"; - }; - param = { - name = "lane"; // LVDS ring bit lane index - type = "uint8"; + parm = { + name = "selftest"; + type = "DIAGSelftest"; }; }; @@ -759,13 +661,13 @@ event = { signal = CR_CONTROL; dir = OUT; // write-only register param = { - name = "hdr"; + name = "hdr"; // hdr indicates SOFTCLEAR, SOFTSYNC or SYNCDISABLE type = "MEPHeader"; userdefined; }; param = { - name = "control"; // should always have value 0x1 - type = "CRControl"; + name = "control"; + type = "uint8"; }; }; diff --git a/MAC/APL/PIC/RSP_Protocol/src/MEPHeader.cc b/MAC/APL/PIC/RSP_Protocol/src/MEPHeader.cc index ec9fb5a591c9e15d48ae5592ab9971bb42c371f7..e0dc4620beb7bf4b6fd05082cc2af0092d797ebc 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/MEPHeader.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/MEPHeader.cc @@ -67,7 +67,7 @@ const MEPHeader::FieldsType MEPHeader::RCU_RESULTX_HDR = { READ, 0, 0, { const MEPHeader::FieldsType MEPHeader::RCU_PROTOCOLY_HDR = { WRITE, 0, 0, { DST_BLP0, RCU, RCU_PROTOCOLY }, 0, RCU_PROTOCOL_SIZE, 0, 0 }; const MEPHeader::FieldsType MEPHeader::RCU_RESULTY_HDR = { READ, 0, 0, { DST_BLP0, RCU, RCU_RESULTY }, 0, RCU_RESULT_SIZE, 0, 0 }; -const MEPHeader::FieldsType MEPHeader::CR_CONTROL_HDR = { WRITE, 0, 0, { DST_RSP, CR, CR_CONTROL }, 0, CR_CONTROL_SIZE, 0, 0 }; +const MEPHeader::FieldsType MEPHeader::CR_CONTROL_HDR = { WRITE, 0, 0, { DST_RSP, CR, CR_SOFTSYNC /*default*/ }, 0, CR_CONTROL_SIZE, 0, 0 }; const MEPHeader::FieldsType MEPHeader::XST_STATS_HDR = { READ, 0, 0, { DST_RSP, XST, XST_STATS }, 0, XST_STATS_SIZE, 0, 0 }; @@ -81,46 +81,6 @@ const MEPHeader::FieldsType MEPHeader::TDS_RESULT_HDR = { READ, 0, 0, { const MEPHeader::FieldsType MEPHeader::TBB_CONTROL_HDR = { WRITE, 0, 0, { DST_RSP, TBB, TBB_CONTROL }, 0, TBB_CONTROL_SIZE, 0, 0 }; -/* OLD REGISTER - -const MEPHeader::FieldsType MEPHeader::RSR_STATUS_HDR = { READ, 0, 0, { DST_RSP, RSR, RSR_STATUS, 0 }, 0, RSR_STATUS_SIZE }; -const MEPHeader::FieldsType MEPHeader::RSR_VERSION_HDR = { READ, 0, 0, { DST_RSP, RSR, RSR_VERSION, 0 }, 0, RSR_VERSION_SIZE }; - -const MEPHeader::FieldsType MEPHeader::TST_SELFTEST_HDR = { WRITE, 0, 0, { DST_RSP, TST, TST_SELFTEST, 0 }, 0, TST_SELFTEST_SIZE }; - -const MEPHeader::FieldsType MEPHeader::CFG_REPROGRAM_HDR = { WRITE, 0, 0, { DST_RSP, CFG, CFG_REPROGRAM, 0 }, 0, CFG_REPROGRAM_SIZE }; - -const MEPHeader::FieldsType MEPHeader::WG_XSETTINGS_HDR = { WRITE, 0, 0, { DST_BLP, WG, WG_XSETTINGS, 0 }, 0, WG_XSETTINGS_SIZE }; -const MEPHeader::FieldsType MEPHeader::WG_YSETTINGS_HDR = { WRITE, 0, 0, { DST_BLP, WG, WG_YSETTINGS, 0 }, 0, WG_YSETTINGS_SIZE }; -const MEPHeader::FieldsType MEPHeader::WG_XWAVE_HDR = { WRITE, 0, 0, { DST_BLP, WG, WG_XWAVE, 0 }, 0, WG_XWAVE_SIZE }; -const MEPHeader::FieldsType MEPHeader::WG_YWAVE_HDR = { WRITE, 0, 0, { DST_BLP, WG, WG_YWAVE, 0 }, 0, WG_YWAVE_SIZE }; - -const MEPHeader::FieldsType MEPHeader::SS_SELECT_HDR = { WRITE, 0, 0, { DST_BLP, SS, SS_SELECT, 0 }, 0, SS_SELECT_SIZE }; - -const MEPHeader::FieldsType MEPHeader::BF_XROUT_HDR = { WRITE, 0, 0, { DST_BLP, BF, BF_XROUT, 0 }, 0, BF_XROUT_SIZE }; -const MEPHeader::FieldsType MEPHeader::BF_XIOUT_HDR = { WRITE, 0, 0, { DST_BLP, BF, BF_XIOUT, 0 }, 0, BF_XIOUT_SIZE }; -const MEPHeader::FieldsType MEPHeader::BF_YROUT_HDR = { WRITE, 0, 0, { DST_BLP, BF, BF_YROUT, 0 }, 0, BF_YROUT_SIZE }; -const MEPHeader::FieldsType MEPHeader::BF_YIOUT_HDR = { WRITE, 0, 0, { DST_BLP, BF, BF_YIOUT, 0 }, 0, BF_YIOUT_SIZE }; - -const MEPHeader::FieldsType MEPHeader::BST_POWER_HDR = { READ, 0, 0, { DST_RSP, BST, BST_POWER, 0 }, 0, BST_POWER_SIZE }; - -const MEPHeader::FieldsType MEPHeader::SST_POWER_HDR = { READ, 0, 0, { DST_BLP, SST, SST_POWER, 0 }, 0, SST_POWER_SIZE }; - -const MEPHeader::FieldsType MEPHeader::RCU_SETTINGS_HDR = { WRITE, 0, 0, { DST_BLP, RCU, RCU_SETTINGS, 0 }, 0, RCU_SETTINGS_SIZE }; - -const MEPHeader::FieldsType MEPHeader::CRR_SOFTRESET_HDR = { WRITE, 0, 0, { DST_RSP, CRR, CRR_SOFTRESET, 0 }, 0, CRR_SOFTRESET_SIZE }; -const MEPHeader::FieldsType MEPHeader::CRR_SOFTPPS_HDR = { WRITE, 0, 0, { DST_RSP, CRR, CRR_SOFTPPS, 0 }, 0, CRR_SOFTPPS_SIZE }; - -const MEPHeader::FieldsType MEPHeader::CRB_SOFTRESET_HDR = { WRITE, 0, 0, { DST_BLP, CRB, CRB_SOFTRESET, 0 }, 0, CRB_SOFTRESET_SIZE }; -const MEPHeader::FieldsType MEPHeader::CRB_SOFTPPS_HDR = { WRITE, 0, 0, { DST_BLP, CRB, CRB_SOFTPPS, 0 }, 0, CRB_SOFTPPS_SIZE }; - -const MEPHeader::FieldsType MEPHeader::CDO_SETTINGS_HDR = { WRITE, 0, 0, { DST_RSP, CDO, CDO_SETTINGS, 0 }, 0, CDO_SETTINGS_SIZE }; -const MEPHeader::FieldsType MEPHeader::CDO_HEADER_HDR = { WRITE, 0, 0, { DST_RSP, CDO, CDO_HEADER, 0 }, 0, CDO_HEADER_SIZE }; - -const MEPHeader::FieldsType MEPHeader::XST_STATS_HDR = { READ, 0, 0, { DST_RSP, XST, XST_STATS, 0 }, 0, XST_STATS_SIZE }; - -*/ - unsigned int MEPHeader::getSize() { return MEPHeader::SIZE;