Skip to content
Snippets Groups Projects
Commit 2b3d652b authored by Arno Schoenmakers's avatar Arno Schoenmakers
Browse files

Task #6845: Undo changes to RSPDriver in trunk

parents a1cbd9e6 d2020583
Branches
Tags
No related merge requests found
Showing
with 1563 additions and 1533 deletions
...@@ -735,16 +735,55 @@ GCFEvent::TResult CalServer::handle_cal_start(GCFEvent& e, GCFPortInterface &por ...@@ -735,16 +735,55 @@ GCFEvent::TResult CalServer::handle_cal_start(GCFEvent& e, GCFPortInterface &por
// //
// set the control register of the RCU's // set the control register of the RCU's
// if in HBA mode turn on HBAs in groups to prevent resetting of boards
//
RSPSetrcuEvent setrcu; RSPSetrcuEvent setrcu;
bitset<MAX_RCUS> testmask;
Timestamp timeStamp;
// #define N_PWR_RCUS_PER_STEP 12
#define N_PWR_RCUS_PER_STEP 8
int nPwrRCUs = m_n_rcus / 2; // only the even rcus deliver power to the HBAs
int steps = nPwrRCUs / N_PWR_RCUS_PER_STEP; // 4 steps for NL stations, 8 steps for IS stations
int jump = m_n_rcus / N_PWR_RCUS_PER_STEP; // jump = 8 for NL stations and 16 for IS stations
if (steps == 0) { steps = 1; } // limit for test cabinet
if (jump < 2) { jump = 2; } // limit for test cabinet
// if LBA mode select all rcus in one step
if (start.rcumode()(0).getMode() <= 4) {
steps = 1;
jump = 2;
}
int delay(0);
for (int step = 0; step < steps; ++step) {
validmask.reset();
// select 12 even(X) rcus and 12 odd(Y) rcus
for (uint rcu = (step * 2); rcu < m_n_rcus; rcu += jump) {
validmask.set(rcu); // select X (HBA power supply)
validmask.set(rcu+1); // select Y
}
// if any rcus in this masker send command
testmask = start.subset & validmask;
if (testmask.any()) {
delay = SCHEDULING_DELAY + step;
timeStamp.setNow(delay);
setrcu.timestamp = timeStamp; // in steps of 1 second
//TODO: Step20.2: might have to send 2 settings e.g. when using all X-pols
setrcu.timestamp = Timestamp(0,0);
setrcu.rcumask = start.subset & validmask; setrcu.rcumask = start.subset & validmask;
setrcu.settings().resize(1); setrcu.settings().resize(1);
setrcu.settings()(0) = start.rcumode()(0); setrcu.settings()(0) = start.rcumode()(0);
LOG_DEBUG(formatString("Sending RSP_SETRCU(%08X)", start.rcumode()(0).getRaw())); LOG_DEBUG(formatString("Sending RSP_SETRCU(%08X)", start.rcumode()(0).getRaw()));
itsRSPDriver->send(setrcu); itsRSPDriver->send(setrcu);
_enableRCUs(subarray, SCHEDULING_DELAY + 4); } // if in mask
} // for steps
_enableRCUs(subarray, delay + 4);
} // conflict? } // conflict?
} }
} }
......
...@@ -40,84 +40,6 @@ using namespace RSP; ...@@ -40,84 +40,6 @@ using namespace RSP;
using namespace RSP_Protocol; using namespace RSP_Protocol;
using namespace RTC; using namespace RTC;
// default settings
// sdo_ss=295:330,331:366,367:402,403:438
blitz::Array<uint16, 2> str2blitz(const char* str, int max)
{
string inputstring(str);
char* start = (char*)inputstring.c_str();
char* end = 0;
bool range = false;
long prevval = 0;
blitz::Array<uint16, 2> ss(4,36); // ss = subband select
int bank_nr = 0;
int sb_nr = 0;
long i;
ss = 0;
while (start) {
long val = strtol(start, &end, 10); // read decimal numbers
start = (end ? (*end ? end + 1 : 0) : 0); // advance
if (val >= max || val < 0) {
LOG_WARN(formatString("Error: value %ld out of range",val));
ss = 0;
return ss;
}
LOG_INFO_STR("val=" << val << " prevval=" << prevval);
if (end) {
switch (*end) {
case ',':
case 0: {
if (range) {
if (0 == prevval && 0 == val) {
val = max - 1;
}
if (val < prevval) {
LOG_WARN("Error: invalid range specification");
ss = 0;
return ss;
}
for (i = prevval; i <= val; i++) {
//LOG_INFO(formatString("add value %ld to ss(%d,%d)", i, bank_nr, sb_nr));
ss(bank_nr, sb_nr) = (uint16)i;
sb_nr++;
if (sb_nr >= 36) {
bank_nr++;
sb_nr = 0;
}
}
}
else {
ss(bank_nr, sb_nr) = (uint16)val;
sb_nr++;
if (sb_nr >= 36) {
bank_nr++;
sb_nr = 0;
}
}
range=false;
} break;
case ':': {
range=true;
} break;
default: {
LOG_WARN(formatString("Error: invalid character %c",*end));
ss = 0;
return ss;
} break;
} // switch
} // if (end)
prevval = val;
} // while
return (ss);
}
/** /**
* Instance pointer for the Cache singleton class. * Instance pointer for the Cache singleton class.
*/ */
...@@ -370,9 +292,6 @@ void CacheBuffer::reset(void) ...@@ -370,9 +292,6 @@ void CacheBuffer::reset(void)
m_bypasssettings().resize(StationSettings::instance()->nrBlps()); m_bypasssettings().resize(StationSettings::instance()->nrBlps());
BypassSettings::Control control; BypassSettings::Control control;
m_bypasssettings() = control; m_bypasssettings() = control;
for (int blp_nr = 0; blp_nr < StationSettings::instance()->nrBlps(); blp_nr += 4) {
m_bypasssettings()(blp_nr).setSDO(1);
}
// clear rawdatablock // clear rawdatablock
itsRawDataBlock.address = 0; itsRawDataBlock.address = 0;
...@@ -409,35 +328,18 @@ void CacheBuffer::reset(void) ...@@ -409,35 +328,18 @@ void CacheBuffer::reset(void)
bitmodeinfo.bm_max = 0; bitmodeinfo.bm_max = 0;
itsBitModeInfo() = bitmodeinfo; itsBitModeInfo() = bitmodeinfo;
// SDO default Mode selection // SDOMode
int sdo_mode = 0;
int bits_per_sample = GET_CONFIG("RSPDriver.SDO_MODE", i);
if (bits_per_sample == 8) { sdo_mode = 1; }
else if (bits_per_sample == 5) { sdo_mode = 2; }
else if (bits_per_sample == 4) { sdo_mode = 3; }
itsSDOModeInfo().resize(StationSettings::instance()->nrRspBoards()); itsSDOModeInfo().resize(StationSettings::instance()->nrRspBoards());
RSRSDOMode sdomodeinfo; RSRSDOMode sdomodeinfo;
sdomodeinfo.bm_select = sdo_mode; sdomodeinfo.bm_select = 0;
sdomodeinfo.bm_max = 3; sdomodeinfo.bm_max = 0;
itsSDOModeInfo() = sdomodeinfo; itsSDOModeInfo() = sdomodeinfo;
// SDO default subband selection
itsSDOSelection.subbands().resize(StationSettings::instance()->nrRcus(), itsSDOSelection.subbands().resize(StationSettings::instance()->nrRcus(),
(MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE), (MAX_BITS_PER_SAMPLE/MIN_BITS_PER_SAMPLE),
MEPHeader::N_SDO_SUBBANDS); MEPHeader::N_SDO_SUBBANDS);
char select_str[64]; itsSDOSelection.subbands() = 0;
blitz::Array<uint16, 2> select(4,36); //TODO: itsSDOSelection() = 0;
strncpy(select_str, GET_CONFIG_STRING("RSPDriver.SDO_SS"), 64);
select = str2blitz(select_str, 512);
for (int rcu = 0; rcu < StationSettings::instance()->nrRcus(); rcu++) {
for (int bank = 0; bank < (MAX_BITS_PER_SAMPLE / MIN_BITS_PER_SAMPLE); bank++) {
itsSDOSelection.subbands()(rcu, bank, Range::all()) = 0;
for (int sb = 0; sb < 36; sb++) {
itsSDOSelection.subbands()(rcu, bank, sb) = (select(bank, sb) * 2) + (rcu % 2);
} // for each subband
} // for each bank
}
} }
...@@ -477,7 +379,7 @@ Cache::Cache() : m_front(0), m_back(0) ...@@ -477,7 +379,7 @@ Cache::Cache() : m_front(0), m_back(0)
StationSettings::instance()->nrRcus()); StationSettings::instance()->nrRcus());
// start by writing the correct clock setting // start by writing the correct clock setting
Sequencer::getInstance().startSequence(Sequencer::SEQ_STARTUP); Sequencer::getInstance().startSequence(Sequencer::SEQ_SETCLOCK);
} }
Cache::~Cache() Cache::~Cache()
...@@ -525,4 +427,3 @@ void Cache::resetI2Cuser() ...@@ -525,4 +427,3 @@ void Cache::resetI2Cuser()
((busUser == RCU_R) ? "RCU_R" : "RCU_W")))); ((busUser == RCU_R) ? "RCU_R" : "RCU_W"))));
} }
...@@ -200,7 +200,6 @@ private: ...@@ -200,7 +200,6 @@ private:
// Direct construction not allowed. // Direct construction not allowed.
Cache(); Cache();
// Keep register update state. // Keep register update state.
AllRegisterState m_allstate; // communication status of all register AllRegisterState m_allstate; // communication status of all register
......
...@@ -46,11 +46,6 @@ namespace LOFAR { ...@@ -46,11 +46,6 @@ namespace LOFAR {
const int RCUProtocolWrite::RESULT_READ_SIZE; const int RCUProtocolWrite::RESULT_READ_SIZE;
uint8 RCUProtocolWrite::i2c_protocol_write[] = { uint8 RCUProtocolWrite::i2c_protocol_write[] = {
0x12, // PROTOCOL_C_WAIT
0x00, // <<< replace with data, wait byte 0 >>>
0x00, // <<< replace with data, wait byte 1 >>>
0x00, // <<< replace with data, wait byte 2 >>>
0x00, // <<< replace with data, wait byte 3 >>>
0x0F, // PROTOCOL_C_SEND_BLOCK 0x0F, // PROTOCOL_C_SEND_BLOCK
0x01, // I2C address for RCU 0x01, // I2C address for RCU
0x03, // size 0x03, // size
...@@ -71,7 +66,6 @@ namespace LOFAR { ...@@ -71,7 +66,6 @@ namespace LOFAR {
}; };
uint8 RCUProtocolWrite::i2c_result_write[] = { uint8 RCUProtocolWrite::i2c_result_write[] = {
0x00, // PROTOCOL_C_WAIT OK
0x00, // PROTOCOL_C_SEND_BLOCK OK 0x00, // PROTOCOL_C_SEND_BLOCK OK
0xAA, // <<< replace with expected data >>> 0xAA, // <<< replace with expected data >>>
0xAA, // <<< replace with expected data >>> 0xAA, // <<< replace with expected data >>>
...@@ -143,21 +137,8 @@ void RCUProtocolWrite::sendrequest() ...@@ -143,21 +137,8 @@ void RCUProtocolWrite::sendrequest()
if (writeCmdRequested) { if (writeCmdRequested) {
// reverse and copy control bytes into i2c_protocol_write // reverse and copy control bytes into i2c_protocol_write
RCUSettings::Control& rcucontrol = Cache::getInstance().getBack().getRCUSettings()()((global_rcu)); RCUSettings::Control& rcucontrol = Cache::getInstance().getBack().getRCUSettings()()((global_rcu));
// add waits while turning on hbas to reduce power peaks.
// if RCU enable changed or rcumode changed
// if rcumode > 0
if (rcucontrol.isModeModified()) {
// wait between two RCUs is set to maximum, so that an international station
// running on 160MHz clock can finisch the job in 1 second.
// in clock ticks, 1500000 = 7.5msec on 200MHz, 9.4msec on 160MHz
uint32 wait = 660000 * global_rcu;
LOG_INFO_STR(formatString("RCUProtocolWrite add wait rcu %d = %f sec", global_rcu, wait * (1./200e6)));
memcpy(i2c_protocol_write+1, &wait, 4);
}
uint32 control = htonl(rcucontrol.getRaw()); uint32 control = htonl(rcucontrol.getRaw());
memcpy(i2c_protocol_write+8, &control, 3); memcpy(i2c_protocol_write+3, &control, 3);
EPARcuProtocolEvent rcuprotocol; EPARcuProtocolEvent rcuprotocol;
rcuprotocol.hdr.set(hdr, 1 << (getCurrentIndex() / (N_POL * N_WRITES)), MEPHeader::WRITE, sizeof(i2c_protocol_write)); rcuprotocol.hdr.set(hdr, 1 << (getCurrentIndex() / (N_POL * N_WRITES)), MEPHeader::WRITE, sizeof(i2c_protocol_write));
......
...@@ -55,9 +55,9 @@ private: ...@@ -55,9 +55,9 @@ private:
friend class RCUResultRead; friend class RCUResultRead;
static const int PROTOCOL_WRITE_SIZE = 15; static const int PROTOCOL_WRITE_SIZE = 10;
static const int PROTOCOL_READ_SIZE = 4; static const int PROTOCOL_READ_SIZE = 4;
static const int RESULT_WRITE_SIZE = 7; static const int RESULT_WRITE_SIZE = 6;
static const int RESULT_READ_SIZE = 5; static const int RESULT_READ_SIZE = 5;
// construct i2c sequence // construct i2c sequence
......
...@@ -71,7 +71,7 @@ void RCUWrite::sendrequest() ...@@ -71,7 +71,7 @@ void RCUWrite::sendrequest()
rcusettings.hdr.set(MEPHeader::RCU_SETTINGS_HDR, 1 << getCurrentIndex()); // also sets payload_length rcusettings.hdr.set(MEPHeader::RCU_SETTINGS_HDR, 1 << getCurrentIndex()); // also sets payload_length
rcusettings.ap = EPA_Protocol::RCUHandler(); rcusettings.ap = EPA_Protocol::RCUHandler();
rcusettings.ap.input_delay_x = x.getDelay(); rcusettings.ap.input_delay_x = x.getDelay();
rcusettings.ap.enable_x = x.getEnable(); rcusettings.ap.enable_x = y.getEnable();
rcusettings.ap.input_delay_y = y.getDelay(); rcusettings.ap.input_delay_y = y.getDelay();
rcusettings.ap.enable_y = y.getEnable(); rcusettings.ap.enable_y = y.getEnable();
......
...@@ -43,7 +43,7 @@ SDOModeWrite::SDOModeWrite(GCFPortInterface& board_port, int board_id) ...@@ -43,7 +43,7 @@ SDOModeWrite::SDOModeWrite(GCFPortInterface& board_port, int board_id)
: SyncAction(board_port, board_id, 1) : SyncAction(board_port, board_id, 1)
{ {
memset(&itsHdr, 0, sizeof(MEPHeader)); memset(&itsHdr, 0, sizeof(MEPHeader));
//doAtInit(); doAtInit();
} }
SDOModeWrite::~SDOModeWrite() SDOModeWrite::~SDOModeWrite()
......
...@@ -45,7 +45,7 @@ SDOWrite::SDOWrite(GCFPortInterface& board_port, int board_id) ...@@ -45,7 +45,7 @@ SDOWrite::SDOWrite(GCFPortInterface& board_port, int board_id)
{ {
memset(&m_hdr, 0, sizeof(MEPHeader)); memset(&m_hdr, 0, sizeof(MEPHeader));
//doAtInit(); doAtInit();
} }
SDOWrite::~SDOWrite() SDOWrite::~SDOWrite()
......
This diff is collapsed.
...@@ -40,9 +40,9 @@ class Sequencer : public GCFFsm ...@@ -40,9 +40,9 @@ class Sequencer : public GCFFsm
public: public:
typedef enum { typedef enum {
SEQ_NONE = 0, SEQ_NONE = 0,
SEQ_STARTUP, // done at initialization SEQ_SETCLOCK, // done at initialization
SEQ_SETCLOCK, // if clock switch
SEQ_RSPCLEAR, SEQ_RSPCLEAR,
SEQ_SDOPRESET,
} Sequence; } Sequence;
// //
// Constructor/destructor // Constructor/destructor
...@@ -68,18 +68,20 @@ public: ...@@ -68,18 +68,20 @@ public:
// The states of the statemachine. // The states of the statemachine.
// //
GCFEvent::TResult idle_state (GCFEvent& event, GCFPortInterface& port); GCFEvent::TResult idle_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult disableClock_state(GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult readDisabledClock_state(GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult writePLL_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult readPLL_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult RSUpreclear_state (GCFEvent& event, GCFPortInterface& port); GCFEvent::TResult RSUpreclear_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult clearClock_state (GCFEvent& event, GCFPortInterface& port); GCFEvent::TResult clearClock_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult writeClock_state (GCFEvent& event, GCFPortInterface& port); GCFEvent::TResult writeClock_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult readClock_state (GCFEvent& event, GCFPortInterface& port); GCFEvent::TResult readClock_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult RCUdisable_state (GCFEvent& event, GCFPortInterface& port); GCFEvent::TResult RCUdisable_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult RSUclear_state (GCFEvent& event, GCFPortInterface& port); GCFEvent::TResult RSUclear_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult setAll_state (GCFEvent& event, GCFPortInterface& port); GCFEvent::TResult setBlocksync_state(GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult RADwrite_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult PPSsync_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult RCUenable_state (GCFEvent& event, GCFPortInterface& port); GCFEvent::TResult RCUenable_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult CDOenable_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult SDObitmode_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult SDOselect_state (GCFEvent& event, GCFPortInterface& port);
GCFEvent::TResult SDOenable_state (GCFEvent& event, GCFPortInterface& port);
/*@}*/ /*@}*/
private: private:
...@@ -95,7 +97,6 @@ private: ...@@ -95,7 +97,6 @@ private:
bool itsIdle; // In idle-state or not bool itsIdle; // In idle-state or not
Sequence itsCurSeq; // currently executing sequence Sequence itsCurSeq; // currently executing sequence
int itsClockRequest;// requested clock freq
int itsTimer; // timer used to delay some actions int itsTimer; // timer used to delay some actions
bool itsFinalState; // final state of sequence (used by rcudisable_state) bool itsFinalState; // final state of sequence (used by rcudisable_state)
......
...@@ -85,15 +85,6 @@ void SetRCUCmd::apply(CacheBuffer& cache, bool setModFlag) ...@@ -85,15 +85,6 @@ void SetRCUCmd::apply(CacheBuffer& cache, bool setModFlag)
// Apply delays and attenuation when mode was changed. // Apply delays and attenuation when mode was changed.
if (newMode) { if (newMode) {
// if mode changed be sure RCU is enabled, is needed to reduce poweron current on hba's
/*
if (mode > 0) {
cache.getRCUSettings()()(cache_rcu).setEnable(1);
}
else {
cache.getRCUSettings()()(cache_rcu).setEnable(0);
}
*/
cache.getRCUSettings()()(cache_rcu).setDelay( cache.getRCUSettings()()(cache_rcu).setDelay(
(uint8) ((delayStep/2.0 + cableSettings->getDelay(cache_rcu, mode)) / delayStep)); (uint8) ((delayStep/2.0 + cableSettings->getDelay(cache_rcu, mode)) / delayStep));
cache.getRCUSettings()()(cache_rcu).setAttenuation( cache.getRCUSettings()()(cache_rcu).setAttenuation(
......
...@@ -42,9 +42,6 @@ StatusRead::StatusRead(GCFPortInterface& board_port, int board_id) ...@@ -42,9 +42,6 @@ StatusRead::StatusRead(GCFPortInterface& board_port, int board_id)
: SyncAction(board_port, board_id, 1) : SyncAction(board_port, board_id, 1)
{ {
memset(&m_hdr, 0, sizeof(MEPHeader)); memset(&m_hdr, 0, sizeof(MEPHeader));
// this action should be performed at initialisation
//doAtInit();
} }
StatusRead::~StatusRead() StatusRead::~StatusRead()
...@@ -113,19 +110,16 @@ GCFEvent::TResult StatusRead::handleack(GCFEvent& event, GCFPortInterface& /*por ...@@ -113,19 +110,16 @@ GCFEvent::TResult StatusRead::handleack(GCFEvent& event, GCFPortInterface& /*por
// if cache value different from hardware reported value, make equal // if cache value different from hardware reported value, make equal
switch (ack.board.rsp.bp_clock) { switch (ack.board.rsp.bp_clock) {
case 125:
case 160: case 160:
case 200: case 200:
if (0 == getBoardId()) { if (0 == getBoardId()) {
if (0 == Cache::getInstance().getBack().getClock()) { if (0 == Cache::getInstance().getBack().getClock()) {
#if 0 #if 0
LOG_INFO_STR(formatString("Receiving initial clock setting from RSP board: %d MHz. Adjusting cache value.", LOG_INFO_STR(formatString("Receiving initial clock setting from RSP board: %d MHz. Adjusting cache value.",
ack.board.rsp.bp_clock)); ack.board.rsp.bp_clock));
Cache::getInstance().getFront().getClock() = ack.board.rsp.bp_clock; Cache::getInstance().getFront().getClock() = ack.board.rsp.bp_clock;
Cache::getInstance().getBack().getClock() = ack.board.rsp.bp_clock; Cache::getInstance().getBack().getClock() = ack.board.rsp.bp_clock;
#endif #endif
} else if (ack.board.rsp.bp_clock != Cache::getInstance().getBack().getClock()) { } else if (ack.board.rsp.bp_clock != Cache::getInstance().getBack().getClock()) {
LOG_WARN_STR(formatString("Reported clock (%d MHz) is different from cache settings (%d MHz) on RSP board %d", LOG_WARN_STR(formatString("Reported clock (%d MHz) is different from cache settings (%d MHz) on RSP board %d",
ack.board.rsp.bp_clock, Cache::getInstance().getBack().getClock(), getBoardId())); ack.board.rsp.bp_clock, Cache::getInstance().getBack().getClock(), getBoardId()));
......
...@@ -46,29 +46,19 @@ using namespace EPA_Protocol; ...@@ -46,29 +46,19 @@ using namespace EPA_Protocol;
namespace LOFAR { namespace LOFAR {
namespace RSP { namespace RSP {
static uint8 tds_pll[
TDS_INIT_SIZE
+ TDS_PROGRAMPLLS_SIZE] = {
// program pll
TDS_INIT,
TDS_PROGRAMPLLS,
};
uint8 tds_pll_result[
TDS_INIT_RESULT_SIZE
+ TDS_PROGRAMPLLS_RESULT_SIZE] = {
TDS_INIT_RESULT,
TDS_PROGRAMPLLS_RESULT,
};
static uint8 tds_160MHz[ static uint8 tds_160MHz[
TDS_160MHZ_SIZE #ifndef DISABLE_PROGRAMPLL
TDS_INIT_SIZE
+ TDS_PROGRAMPLLS_SIZE
#endif
+ TDS_160MHZ_SIZE
+ TDS_C_END_SIZE] = { + TDS_C_END_SIZE] = {
// switch to 160MHz to backplane (using 10MHz reference at the front) // switch to 160MHz to backplane (using 10MHz reference at the front)
#ifndef DISABLE_PROGRAMPLL
TDS_INIT,
TDS_PROGRAMPLLS,
#endif
TDS_160MHZ, TDS_160MHZ,
TDS_C_END, TDS_C_END,
...@@ -76,28 +66,52 @@ namespace LOFAR { ...@@ -76,28 +66,52 @@ namespace LOFAR {
uint8 tds_160MHz_result[ uint8 tds_160MHz_result[
TDS_160MHZ_RESULT_SIZE #ifndef DISABLE_PROGRAMPLL
TDS_INIT_RESULT_SIZE
+ TDS_PROGRAMPLLS_RESULT_SIZE
#endif
+ TDS_160MHZ_RESULT_SIZE
+ TDS_C_END_RESULT_SIZE] = { + TDS_C_END_RESULT_SIZE] = {
#ifndef DISABLE_PROGRAMPLL
TDS_INIT_RESULT,
TDS_PROGRAMPLLS_RESULT,
#endif
TDS_160MHZ_RESULT, TDS_160MHZ_RESULT,
TDS_C_END_RESULT, TDS_C_END_RESULT,
}; };
static uint8 tds_200MHz[ static uint8 tds_200MHz[
TDS_200MHZ_SIZE #ifndef DISABLE_PROGRAMPLL
TDS_INIT_SIZE
+ TDS_PROGRAMPLLS_SIZE
#endif
+ TDS_200MHZ_SIZE
+ TDS_C_END_SIZE] = { + TDS_C_END_SIZE] = {
// switch to 200MHz to backplane (using 10MHz reference at the front) // switch to 200MHz to backplane (using 10MHz reference at the front)
#ifndef DISABLE_PROGRAMPLL
TDS_INIT,
TDS_PROGRAMPLLS,
#endif
TDS_200MHZ, TDS_200MHZ,
TDS_C_END, TDS_C_END,
}; };
uint8 tds_200MHz_result[ uint8 tds_200MHz_result[
#ifndef DISABLE_PROGRAMPLL
TDS_INIT_RESULT_SIZE
+ TDS_PROGRAMPLLS_RESULT_SIZE
#endif
+ TDS_200MHZ_RESULT_SIZE + TDS_200MHZ_RESULT_SIZE
+ TDS_C_END_RESULT_SIZE] = { + TDS_C_END_RESULT_SIZE] = {
#ifndef DISABLE_PROGRAMPLL
TDS_INIT_RESULT,
TDS_PROGRAMPLLS_RESULT,
#endif
TDS_200MHZ_RESULT, TDS_200MHZ_RESULT,
TDS_C_END_RESULT, TDS_C_END_RESULT,
...@@ -166,11 +180,6 @@ void TDSProtocolWrite::sendrequest() ...@@ -166,11 +180,6 @@ void TDSProtocolWrite::sendrequest()
size_t size = 0; size_t size = 0;
// select clock
// 160 or 200 [MHz] (extern td clock)
// 125 [MHz] (intern board clock)
// 0 programm pll
switch (Cache::getInstance().getBack().getClock()) { switch (Cache::getInstance().getBack().getClock()) {
case 160: case 160:
buf = (char*)tds_160MHz; buf = (char*)tds_160MHz;
...@@ -192,7 +201,7 @@ void TDSProtocolWrite::sendrequest() ...@@ -192,7 +201,7 @@ void TDSProtocolWrite::sendrequest()
tdsprotocol.hdr.set(MEPHeader::TDS_PROTOCOL_HDR, MEPHeader::DST_RSP, MEPHeader::WRITE, size, m_offset); tdsprotocol.hdr.set(MEPHeader::TDS_PROTOCOL_HDR, MEPHeader::DST_RSP, MEPHeader::WRITE, size, m_offset);
break; break;
case 125: default:
buf = (char*)tds_off; buf = (char*)tds_off;
if (0 == getCurrentIndex()) { if (0 == getCurrentIndex()) {
m_remaining = sizeof(tds_off); m_remaining = sizeof(tds_off);
...@@ -201,16 +210,6 @@ void TDSProtocolWrite::sendrequest() ...@@ -201,16 +210,6 @@ void TDSProtocolWrite::sendrequest()
size = MIN(TDS_CHUNK_SIZE, m_remaining); size = MIN(TDS_CHUNK_SIZE, m_remaining);
tdsprotocol.hdr.set(MEPHeader::TDS_PROTOCOL_HDR, MEPHeader::DST_RSP, MEPHeader::WRITE, size, m_offset); tdsprotocol.hdr.set(MEPHeader::TDS_PROTOCOL_HDR, MEPHeader::DST_RSP, MEPHeader::WRITE, size, m_offset);
break; break;
default:
buf = (char*)tds_pll;
if (0 == getCurrentIndex()) {
m_remaining = sizeof(tds_pll);
m_offset = 0;
}
size = MIN(TDS_CHUNK_SIZE, m_remaining);
tdsprotocol.hdr.set(MEPHeader::TDS_PROTOCOL_HDR, MEPHeader::DST_RSP, MEPHeader::WRITE, size, m_offset);
break;
} }
tdsprotocol.protocol.setBuffer((char*)buf + m_offset, size); tdsprotocol.protocol.setBuffer((char*)buf + m_offset, size);
......
...@@ -404,14 +404,20 @@ ...@@ -404,14 +404,20 @@
namespace LOFAR { namespace LOFAR {
namespace RSP { namespace RSP {
extern uint8 tds_160MHz_result[
extern uint8 tds_pll_result[ TDS_INIT_RESULT_SIZE #ifndef DISABLE_PROGRAMPLL
+ TDS_PROGRAMPLLS_RESULT_SIZE ]; TDS_INIT_RESULT_SIZE
+ TDS_PROGRAMPLLS_RESULT_SIZE
extern uint8 tds_160MHz_result[ TDS_160MHZ_RESULT_SIZE #endif
+ TDS_160MHZ_RESULT_SIZE
+ TDS_C_END_RESULT_SIZE]; + TDS_C_END_RESULT_SIZE];
extern uint8 tds_200MHz_result[ TDS_200MHZ_RESULT_SIZE extern uint8 tds_200MHz_result[
#ifndef DISABLE_PROGRAMPLL
TDS_INIT_RESULT_SIZE
+ TDS_PROGRAMPLLS_RESULT_SIZE
#endif
+ TDS_200MHZ_RESULT_SIZE
+ TDS_C_END_RESULT_SIZE]; + TDS_C_END_RESULT_SIZE];
extern uint8 tds_off_result[ TDS_VCXO_OFF_RESULT_SIZE extern uint8 tds_off_result[ TDS_VCXO_OFF_RESULT_SIZE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment