Skip to content

Commit bf1c52b

Browse files
committed
Add roundtrip latency of vset counnter
1 parent f34225b commit bf1c52b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

core/Decode.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ namespace olympia
5252
vector_config_(new VectorConfig(p->init_vl, p->init_sew, p->init_lmul, p->init_vta)),
5353
vset_blocking_count_(&unit_stat_set_, "vset_blocking_count",
5454
"Number of times that the Decode unit blocks execution",
55-
sparta::Counter::COUNT_NORMAL)
55+
sparta::Counter::COUNT_NORMAL),
56+
vset_blocking_stall_latency_(&unit_stat_set_, "vset_blocking_stall_latency",
57+
"Accumulated between roundtrip vset decode and processing",
58+
sparta::Counter::COUNT_NORMAL)
5659
{
5760
initializeFusion_();
5861

@@ -157,6 +160,8 @@ namespace olympia
157160
// if rs1 != 0, VL = x[rs1], so we assume there's an STF field for VL
158161
if (waiting_on_vset_)
159162
{
163+
const auto vset_block_end = getClock()->currentCycle();
164+
vset_blocking_stall_latency_ += (vset_block_end - vset_block_start_);
160165
// schedule decode, because we've been stalled on vset
161166
waiting_on_vset_ = false;
162167
ev_decode_insts_event_.schedule(sparta::Clock::Cycle(0));
@@ -230,6 +235,8 @@ namespace olympia
230235
else if (uid == MAVIS_UID_VSETVLI || uid == MAVIS_UID_VSETVL)
231236
{
232237
vset_blocking_count_++;
238+
239+
vset_block_start_ = getClock()->currentCycle();
233240
// block for vsetvl or vsetvli when rs1 of vsetvli is NOT 0
234241
waiting_on_vset_ = true;
235242
// need to indicate we want a signal sent back at execute

core/Decode.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "sparta/simulation/TreeNode.hpp"
2121
#include "sparta/simulation/ParameterSet.hpp"
2222

23+
#include <cstdint>
2324
#include <limits>
2425
#include <map>
2526
#include <memory>
@@ -342,6 +343,9 @@ namespace olympia
342343
uint32_t getNumVecUopsRemaining() const;
343344

344345
sparta::Counter vset_blocking_count_;
346+
sparta::Counter vset_blocking_stall_latency_;
347+
348+
uint64_t vset_block_start_;
345349

346350
//////////////////////////////////////////////////////////////////////
347351
// Decoder callbacks

0 commit comments

Comments
 (0)