Skip to content

Commit ae03471

Browse files
David Schalldhschall
authored andcommitted
Added new tests
1 parent 3b00993 commit ae03471

7 files changed

Lines changed: 59 additions & 108 deletions

File tree

.github/workflows/build-and-run.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
#
2424
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
2525
matrix:
26-
os: [ubuntu-latest]
26+
os: [ubuntu-latest, ubuntu-20.04, ubuntu-22.04]
2727
build_type: [Release]
2828
c_compiler: [gcc, clang]
2929
include:
@@ -37,6 +37,7 @@ jobs:
3737

3838
- name: Cache CMake build
3939
uses: actions/cache@v4
40+
if: ${{ matrix.os == 'ubuntu-latest' }}
4041
with:
4142
path: build
4243
key: ${{ matrix.os }}-${{ matrix.c_compiler }}-build

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ The framework supports a timing approximation by clocking the predictor for ever
2929

3030
## Prerequisites
3131

32-
The infrastructure has been tested with the following system configuration:
32+
The infrastructure and following commands have been tested with the following system configuration:
3333

3434
* Ubuntu 22.04.2 LTS
3535
* gcc 11.4.0
3636
* cmake 3.22.1
3737

38+
> See the [CI pipeline](https://github.com/dhschall/LLBP/actions/workflows/build-and-run.yml) for other tested system configurations.
39+
40+
3841

3942
## Install Dependencies
4043

@@ -62,7 +65,7 @@ cmake --build ./build -j 8
6265

6366
## Server traces
6467

65-
The traces use to evaluate LLBP collected by running the server applications on gem5 in full-system mode. The OS of the disk image is Ubuntu 20.04 and the kernel version is 5.4.84. The traces are in the [ChampSim](https://github.com/ChampSim/ChampSim) format and contains both user and kernel space instructions. The traces are available on Zenodo at [10.5281/zenodo.13133243](https://doi.org/10.5281/zenodo.13133243).
68+
The traces use to evaluate LLBP collected by running the server applications on gem5 in full-system mode. The OS of the disk image is Ubuntu 20.04 and the kernel version is 5.4.84. The traces are in the [ChampSim](https://github.com/ChampSim/ChampSim) format and contains both user and kernel space instructions. The traces are available on Zenodo at [10.5281/zenodo.13133242](https://doi.org/10.5281/zenodo.13133242).
6669

6770
The `download_traces.sh` script in the utils folder will download all traces from Zenodo and stores them into the `traces` directory.:
6871

analysis/mpki.ipynb

Lines changed: 17 additions & 69 deletions
Large diffs are not rendered by default.

bpmodels/llbp/llbp.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,12 @@ LLBP::LLBP(LLBPConfig cfg)
8484
: TageSCL(cfg.tsclConfig),
8585
llbpStorage(cfg.numContexts, cfg.numPatterns,
8686
cfg.ctxAssoc, cfg.ptrnAssoc),
87-
rcr(HASHVALS,14),
87+
rcr(HASHVALS,cfg.CTWidth),
8888
patternBuffer(cfg.pbSize, cfg.pbAssoc),
8989

9090
numContexts(cfg.numContexts),
9191
numPatterns(cfg.numPatterns),
9292
TTWidth(cfg.TTWidth),
93-
CTWidth(cfg.CTWidth),
9493
CtrWidth(cfg.CtrWidth),
9594
ReplCtrWidth(cfg.ReplCtrWidth),
9695
CtxReplCtrWidth(cfg.CtxReplCtrWidth),

bpmodels/llbp/llbp.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ class LLBP : public TageSCL {
151151
patterns(n, assoc)
152152
{}
153153

154-
// Before a pattern in the pattern set is replaced, the patterns are
155-
// sorted from the highest to the lowest confidence. This is done to
154+
// Before a pattern in the pattern set is replaced, the patterns are
155+
// sorted from the highest to the lowest confidence. This is done to
156156
// determine which pattern should be evicted.
157157
void sortPatters(const uint64_t key) {
158158
auto& set = patterns.getSet(key);
@@ -171,7 +171,7 @@ class LLBP : public TageSCL {
171171
* LLBPs high-capacity structure to store all pattern sets.
172172
* It's implemented as a set associative cache.
173173
* The Context directory (CD) can be thought of as the tag array while the
174-
* LLBPStorage is the data array. In this simulation model, both LLBP
174+
* LLBPStorage is the data array. In this simulation model, both LLBP
175175
* and CD are represented with a single data structure.
176176
********************************************************************/
177177
class LLBPStorage : public BaseCache<uint64_t, Context>{
@@ -399,8 +399,6 @@ class LLBP : public TageSCL {
399399
const int numPatterns;
400400
// Bit width for pattern tag.
401401
const int TTWidth;
402-
// Bit width for context tag.
403-
const int CTWidth;
404402
// Constants for the patterns counter widths
405403
const int CtrWidth;
406404
const int ReplCtrWidth;

eval_all.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ cmake --build ./build --target predictor -j $(nproc)
5959

6060

6161
OUT=results/
62-
POSTFIX="ae-AlwaysUD"
63-
POSTFIX="ae-CorrectedNT"
64-
POSTFIX="ae-New2-noBucket-D5clk"
62+
POSTFIX="ae"
6563

6664

6765

@@ -115,4 +113,4 @@ echo "Running ${#commands[@]} simulations"
115113
parallel --jobs $(nproc) ::: "${commands[@]}"
116114

117115
wait
118-
echo "Simulation complete. Go reap the results, you deserve it!!!!!!"
116+
echo "Simulation complete."

utils/histogram.h

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -59,30 +59,29 @@ class Histogram {
5959
panic_if(bs <= 0, "Bucket size must be positive");
6060

6161
buckets.resize(bins + 2);
62-
buckets[0] = Bucket{
63-
boost::str(boost::format("< %.1f") % lower), 0, 0};
64-
buckets[bins + 1] = Bucket{
65-
boost::str(boost::format("> %.1f") % upper), 0, 0};
62+
{
63+
std::ostringstream oss;
64+
oss << "< " << std::fixed << std::setprecision(1) << lower;
65+
buckets[0] = Bucket{oss.str(), 0, 0};
66+
}
67+
{
68+
std::ostringstream oss;
69+
oss << "> " << std::fixed << std::setprecision(1) << upper;
70+
buckets[bins + 1] = Bucket{oss.str(), 0, 0};
71+
}
6672

6773
for (int i = 1; i <= bins; ++i) {
74+
std::ostringstream oss;
6875
if (bs == 1) {
69-
buckets[i] = Bucket{
70-
boost::str(boost::format("%d") %
71-
(lower + bs * static_cast<T>(i-1))),
72-
0,
73-
0
74-
};
76+
oss << (lower + bs * static_cast<T>(i-1));
77+
buckets[i] = Bucket{oss.str(), 0, 0};
7578
} else {
76-
buckets[i] = Bucket{
77-
boost::str(boost::format("%.1f-%.1f") %
78-
(lower + bs * static_cast<T>(i-1)) %
79-
(lower + bs * static_cast<T>(i))),
80-
0,
81-
0
82-
};
79+
oss << std::fixed << std::setprecision(1)
80+
<< (lower + bs * static_cast<T>(i-1)) << "-"
81+
<< (lower + bs * static_cast<T>(i));
82+
buckets[i] = Bucket{oss.str(), 0, 0};
8383
}
8484
}
85-
8685
}
8786

8887
void insert(T value, int count=1) {
@@ -133,27 +132,32 @@ class Histogram {
133132
}
134133

135134
std::ostringstream res;
136-
res << boost::format("N:%d Min:%d, Max:%d, Sum:%d, Avg:%.2f\n")
137-
% samples % min % max % sum
138-
% getAvg();
135+
136+
res << "N:" << samples
137+
<< " Min:" << min
138+
<< " Max:" << max
139+
<< " Sum:" << sum
140+
<< " Avg:" << std::fixed << std::setprecision(2) << getAvg()
141+
<< "\n";
139142

140143

141144
int cum = 0;
142145
for (const auto& b : buckets) {
143146
int barLen = _max > 0 ? static_cast<int>((b.count * width + _max / 2) / _max) : 0;
144147

145-
res << boost::format("%-10s [%-4d]\t") % b.mark % b.count;
148+
res << std::left << std::setw(10) << b.mark
149+
<< " [" << std::setw(4) << b.count << "]\t";
146150

147151
if (perc) {
148-
res << boost::format("%.1f%%\t") % (100.0 * b.count / samples);
152+
res << std::fixed << std::setprecision(1) << (100.0 * b.count / samples) << "%\t";
149153
}
150154

151155
if (cdf) {
152156
cum += b.count;
153-
res << boost::format("%.1f%%\t") % (100.0 * cum / samples);
157+
res << std::fixed << std::setprecision(1) << (100.0 * cum / samples) << "%\t";
154158
}
155159

156-
res << boost::format("|%s\n") % std::string(barLen, '*');
160+
res << "|" << std::string(barLen, '*') << "\n";
157161

158162
}
159163
return res.str();

0 commit comments

Comments
 (0)