Skip to content

Commit a304a97

Browse files
Fix correctness test timings
1 parent 2070db4 commit a304a97

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

run_correctness.cpp

+14-7
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,20 @@
1313

1414
using namespace ssd;
1515

16-
#define GARBAGEPATH "/home/silverwolf/workspace/randomgarbage2"
16+
#define GARBAGEPATH "/home/silverwolf/garbage"
17+
18+
double timings = 0.0;
1719

1820
double do_seq(Ssd *ssd, event_type type, void *test, unsigned int file_size)
1921
{
2022
unsigned int adr, i = 0;
2123
double result = 0;
2224
for (adr = 0; adr < file_size;adr += PAGE_SIZE)
2325
{
24-
double iotime = ssd->event_arrive(type, i, 1, (double) adr, (char*)test + adr);
26+
double iotime = ssd->event_arrive(type, i, 1, timings, (char*)test + adr);
2527
//printf("IO Execution time: %f\n", iotime);
2628
result += iotime;
29+
timings += iotime;
2730
if (type == READ)
2831
{
2932
if (ssd->get_result_buffer() == NULL)
@@ -43,11 +46,14 @@ double do_seq_backward(Ssd *ssd, event_type type, void *test, unsigned int file_
4346
double result = 0;
4447
for (adr = file_size; adr > 0;adr -= PAGE_SIZE)
4548
{
46-
result += ssd->event_arrive(type, j+i, 1, file_size-(double) adr, (char*)test + adr - PAGE_SIZE);
49+
double iotime = ssd->event_arrive(type, j+i, 1, timings, (char*)test + adr - PAGE_SIZE);
4750

4851
if (type == READ && memcmp(ssd->get_result_buffer(), (char*)test + adr - PAGE_SIZE, PAGE_SIZE) != 0)
4952
fprintf(stderr, "Err. Data does not compare. i: %i\n", j+i);
5053

54+
result += iotime;
55+
timings += iotime;
56+
5157
i--;
5258

5359
if (i == -1u)
@@ -56,7 +62,6 @@ double do_seq_backward(Ssd *ssd, event_type type, void *test, unsigned int file_
5662
j += BLOCK_SIZE;
5763
}
5864
}
59-
6065
return result;
6166
}
6267

@@ -116,10 +121,12 @@ int main()
116121

117122
printf("Test 1. Write sequential test data.\n");
118123
result += do_seq(ssd, WRITE, test_data, st.st_size);
124+
//
125+
// printf("Test 1. Trim data.\n");
126+
// result += do_seq(ssd, TRIM, test_data, st.st_size);
119127

120-
printf("Test 1. Trim data.\n");
121-
result += do_seq(ssd, TRIM, test_data, st.st_size);
122-
128+
printf("Test 1. Write sequential test data.\n");
129+
result += do_seq(ssd, WRITE, test_data, st.st_size);
123130

124131
printf("Test 2. Read sequential test data.\n");
125132
result += do_seq(ssd, READ, test_data, st.st_size);

ssd.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ BLOCK_ERASE_DELAY 2000
7474
# Size of pages (in bytes)
7575
PAGE_READ_DELAY 25
7676
PAGE_WRITE_DELAY 300
77-
PAGE_ENABLE_DATA 2048
77+
PAGE_ENABLE_DATA 1
7878

7979
# MAPPING
8080
# Specify reservation of
@@ -83,7 +83,7 @@ MAP_DIRECTORY_SIZE 100
8383

8484
# FTL Implementation to use 0 = Page, 1 = BAST,
8585
# 2 = FAST, 3 = DFTL, 4 = Bimodal
86-
FTL_IMPLEMENTATION 2
86+
FTL_IMPLEMENTATION 4
8787

8888
# LOG Page limit for BAST
8989
BAST_LOG_PAGE_LIMIT 1024

0 commit comments

Comments
 (0)