@@ -75,20 +75,19 @@ FtlImpl_Bast::FtlImpl_Bast(Controller &controller):
75
75
{
76
76
77
77
// Detect required number of bits for logical address size
78
- addressSize = log (SSD_SIZE * PACKAGE_SIZE * DIE_SIZE * PLANE_SIZE )/log (2 );
78
+ addressSize = log (NUMBER_OF_ADDRESSABLE_BLOCKS )/log (2 );
79
79
addressShift = log (BLOCK_SIZE)/log (2 );
80
80
81
81
// Find required number of bits for block size
82
82
printf (" Total required bits for representation: %i (Address: %i Block: %i) \n " , addressSize + addressShift, addressSize, addressShift);
83
83
84
84
// Initialise block mapping table.
85
- uint numBlocks = SSD_SIZE * PACKAGE_SIZE * DIE_SIZE * PLANE_SIZE;
86
- data_list = new long [numBlocks];
85
+ data_list = new long [NUMBER_OF_ADDRESSABLE_BLOCKS];
87
86
88
- for (uint i=0 ;i<numBlocks ;i++)
87
+ for (uint i=0 ;i<NUMBER_OF_ADDRESSABLE_BLOCKS ;i++)
89
88
data_list[i] = -1 ;
90
89
91
- printf (" Total mapping table size: %luKB\n " , numBlocks * sizeof (uint ) / 1024 );
90
+ printf (" Total mapping table size: %luKB\n " , NUMBER_OF_ADDRESSABLE_BLOCKS * sizeof (uint ) / 1024 );
92
91
printf (" Using BAST FTL.\n " );
93
92
}
94
93
@@ -287,7 +286,7 @@ bool FtlImpl_Bast::is_sequential(LogPageBlock* logBlock, long lba, Event &event)
287
286
288
287
// Is block switch possible? i.e. log block switch
289
288
bool isSequential = true ;
290
- for (uint i=0 ;i<BLOCK_SIZE;i++) if (logBlock->pages [i] != i)
289
+ for (uint i=0 ;i<BLOCK_SIZE;i++) if (logBlock->pages [i] != ( int ) i)
291
290
{
292
291
isSequential = false ;
293
292
break ;
@@ -329,8 +328,6 @@ bool FtlImpl_Bast::random_merge(LogPageBlock *logBlock, long lba, Event &event)
329
328
Address eventAddress = Address (event.get_logical_address (), PAGE);
330
329
Address newDataBlock = Block_manager::instance ()->get_free_block (DATA, event);
331
330
332
- Block *b1 = controller.get_block_pointer (logBlock->address );
333
-
334
331
int t=0 ;
335
332
for (uint i=0 ;i<BLOCK_SIZE;i++)
336
333
{
@@ -378,7 +375,6 @@ bool FtlImpl_Bast::random_merge(LogPageBlock *logBlock, long lba, Event &event)
378
375
if (data_list[lba] != -1 )
379
376
{
380
377
Address a = Address (data_list[lba], PAGE);
381
- Block *b2 = controller.get_block_pointer (a);
382
378
Block_manager::instance ()->erase_and_invalidate (event, a, DATA);
383
379
}
384
380
0 commit comments