Skip to content

Commit 16886fa

Browse files
committed
[sc] No reset in constructors
1 parent 406df24 commit 16886fa

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

apps/AlfLibClient.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class AlfLibClient : public AliceO2::Common::Program
6363
if (mOptions.sca) {
6464
std::cout << "Running SCA test" << std::endl;
6565
auto sca = Sca(mOptions.cardId, mOptions.link);
66+
sca.reset();
6667

6768
std::cout << "Running simple SCA operation" << std::endl;
6869
try {
@@ -150,6 +151,7 @@ class AlfLibClient : public AliceO2::Common::Program
150151
if (mOptions.ic) {
151152
std::cout << "Running IC test" << std::endl;
152153
auto ic = Ic(mOptions.cardId, mOptions.link);
154+
ic.reset();
153155

154156
std::cout << "Running Simple IC operations" << std::endl;
155157
try {

include/Alf/Ic.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ class Ic
7878
/// \throws o2::alf::IcException if no IC channel selected
7979
void checkChannelSet();
8080

81+
/// Executes an SC reset
82+
void reset();
83+
8184
/// Performs an IC read
8285
/// \param address IC address to read from
8386
/// \return IC data requested
@@ -131,7 +134,6 @@ class Ic
131134

132135
private:
133136
void init(const roc::Parameters::CardIdType& cardId, int linkId);
134-
void reset();
135137
void barWrite(uint32_t offset, uint32_t data);
136138
uint32_t barRead(uint32_t index);
137139

include/Alf/Sca.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ class Sca
7676
/// \throws o2::alf::ScaException if no SCA channel selected
7777
void checkChannelSet();
7878

79+
/// Executes an SC reset
80+
void reset();
81+
7982
/// Executes an SCA command
8083
/// \param commandData SCA command, data pair
8184
/// \param lock Boolean enabling implicit locking

include/Alf/Swt.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ class Swt
7474
/// \param linkId The link ID to set the channel to (optional).
7575
Swt(std::string cardId, int linkId = -1);
7676

77-
/// Resets the SWT channel selected
78-
void reset();
79-
8077
/// Sets the SWT channel
8178
/// \param gbtChannel The channel to set
8279
void setChannel(int gbtChannel);
@@ -85,6 +82,9 @@ class Swt
8582
/// \throws o2::alf::SwtException if no SWT channel selected
8683
void checkChannelSet();
8784

85+
/// Executes an SC reset
86+
void reset();
87+
8888
/// Writes an SWT word
8989
/// \param swtWord The SWT word to write
9090
/// \param wordSize The size of the SWT word to be written

src/Ic.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ void Ic::init(const roc::Parameters::CardIdType& cardId, int linkId)
8787

8888
mLlaSession = std::make_unique<LlaSession>("DDT", card.sequenceId);
8989

90-
reset();
91-
9290
// Set CFG to 0x3 by default
9391
barWrite(ic_regs::IC_WR_CFG.index, 0x3);
9492
}

src/Sca.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ Sca::Sca(AlfLink link)
4646
ScaException() << ErrorInfo::Message("Maximum link number exceeded"));
4747
}
4848

49-
barWrite(sc_regs::SC_RESET.index, 0x1);
50-
barWrite(sc_regs::SC_RESET.index, 0x0);
51-
5249
mLlaSession = std::make_unique<LlaSession>("DDT", link.cardSequence);
5350
}
5451

@@ -75,9 +72,6 @@ void Sca::init(const roc::Parameters::CardIdType& cardId, int linkId)
7572
roc::CardType::Cru
7673
};
7774

78-
barWrite(sc_regs::SC_RESET.index, 0x1);
79-
barWrite(sc_regs::SC_RESET.index, 0x0);
80-
8175
mLlaSession = std::make_unique<LlaSession>("DDT", card.sequenceId);
8276
}
8377

@@ -100,6 +94,12 @@ void Sca::checkChannelSet()
10094
}
10195
}
10296

97+
void Sca::reset()
98+
{
99+
barWrite(sc_regs::SC_RESET.index, 0x1);
100+
barWrite(sc_regs::SC_RESET.index, 0x0);
101+
}
102+
103103
Sca::CommandData Sca::executeCommand(uint32_t command, uint32_t data, bool lock)
104104
{
105105
if (lock) {

0 commit comments

Comments
 (0)