Skip to content

Commit 7c9468d

Browse files
committed
[swt] Remove obsolete SWT sequence checks
1 parent 7cfc40e commit 7c9468d

File tree

4 files changed

+1
-35
lines changed

4 files changed

+1
-35
lines changed

include/Alf/Swt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ class Swt
125125
AlfLink mLink;
126126
std::unique_ptr<LlaSession> mLlaSession;
127127

128-
int mWordSequence = 0; //start from 0, as after the reset the counter starts at 1
129128
static constexpr int DEFAULT_SWT_TIMEOUT_MS = 10;
130129
};
131130

include/Alf/SwtWord.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,16 @@ class SwtWord
4949
void setLow(uint32_t low);
5050
void setMed(uint32_t med);
5151
void setHigh(uint16_t high);
52-
void setSequence(uint16_t high);
5352
void setSize(Size size);
5453
uint32_t getLow() const;
5554
uint32_t getMed() const;
5655
uint16_t getHigh() const;
5756
Size getSize() const;
58-
int getSequence() const;
5957

6058
private:
6159
uint32_t mLow;
6260
uint32_t mMed;
6361
uint16_t mHigh;
64-
int mSequence;
6562
Size mSize;
6663
};
6764

src/Swt.cxx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ void Swt::reset()
8484
{
8585
barWrite(sc_regs::SC_RESET.index, 0x1);
8686
barWrite(sc_regs::SC_RESET.index, 0x0); //void cmd to sync clocks
87-
mWordSequence = 0;
8887
}
8988

9089
void Swt::checkChannelSet()
@@ -128,26 +127,8 @@ std::vector<SwtWord> Swt::read(SwtWord::Size wordSize, TimeOut msTimeOut)
128127
tempWord.setMed(barRead(sc_regs::SWT_RD_WORD_M.index));
129128
}
130129

131-
if (wordSize == SwtWord::Size::High) { // Sequence set with high part of the word
130+
if (wordSize == SwtWord::Size::High) {
132131
tempWord.setHigh(barRead(sc_regs::SWT_RD_WORD_H.index));
133-
} else { // Only set sequence if smaller word requested
134-
tempWord.setSequence(barRead(sc_regs::SWT_RD_WORD_H.index));
135-
}
136-
137-
mWordSequence = (mWordSequence + 1) % 16;
138-
139-
// If we get the same counter as before it means the FIFO wasn't updated; drop the word
140-
if (tempWord.getSequence() != mWordSequence) {
141-
142-
if (std::chrono::steady_clock::now() > timeOut) {
143-
BOOST_THROW_EXCEPTION(SwtException() << ErrorInfo::Message("Timed out: not enough words in SWT READ FIFO"));
144-
}
145-
146-
Logger::get().warn() << "SWT word sequence duplicate" << endm;
147-
148-
mWordSequence = tempWord.getSequence(); //roll mWordSequence back by one
149-
numWords++; //will have to read one more time
150-
continue;
151132
}
152133

153134
//wordMonPairs.push_back(std::make_pair(tempWord, barRead(sc_regs::SWT_MON.index)));

src/SwtWord.cxx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,13 @@ void SwtWord::setMed(uint32_t med)
7979
void SwtWord::setHigh(uint16_t high)
8080
{
8181
mHigh = high & 0xfff;
82-
mSequence = (high & 0xf000) >> 12;
8382
}
8483

8584
void SwtWord::setSize(Size size)
8685
{
8786
mSize = size;
8887
}
8988

90-
void SwtWord::setSequence(uint16_t high)
91-
{
92-
mSequence = (high & 0xf000) >> 12;
93-
}
94-
9589
uint32_t SwtWord::getLow() const
9690
{
9791
return mLow;
@@ -107,11 +101,6 @@ uint16_t SwtWord::getHigh() const
107101
return mHigh & 0xfff;
108102
}
109103

110-
int SwtWord::getSequence() const
111-
{
112-
return mSequence;
113-
}
114-
115104
SwtWord::Size SwtWord::getSize() const
116105
{
117106
return mSize;

0 commit comments

Comments
 (0)