[转载]ubuntu下安装disksim 4.0及SSD扩展
(2013-11-15 13:15:14)
转载▼
标签: 转载 |
原文地址:ubuntu下安装disksim 4.0及SSD扩展作者:vincent
一、DiskSim 以及 SSD扩展插件简介
DiskSim is a low-level storage simulation tool, which can generate timing-accurate simulation result. It is developed by Greg Ganger. Current version is 4.0 and it is out in June 2008.
SSD extension for DiskSim is an extensional module of DiskSim which implments SSD I/O Models. It is implemented by Microsoft Research.
二、安装须知
1. 目前DiskSim还木有64位版,故请在32位OS下安装使用DiskSim!
2. DiskSim使用lex和yacc进行词法及语法分析,故linux如没安装flex、bison的话,先要安装。
$ sudo apt-get install bison flex
3. 下载源码安装包
disksim 4.0:http://www.pdl.cmu.edu/DiskSim/
SSD extension:http://research.microsoft.com/en-us/downloads/b41019e2-1d2b-44d8-b512-ba35ab814cd4/
三、安装步骤
Step 1. Download and unzip.
Sources can be downloaded from the links above. I downloaded DiskSim 4.0 with dixtrac.
$ tar xfz disksim-4.0-with-dixtrac.tar.gz
$ cd disksim-4.0
$ unzip ../ssd-add-on.zip
Step 2. Apply SSD add on patch.
$ patch -p1 < ssdmodel/ssd-patch
Step 3. Modify Makefile to support math library
a. 修改memsmodel/Makefile
ems_seektest: mems_seektest.o libmems_internals.a
$(CC) -o $@ mems_seektest.o $(LDFLAGS) $(CFLAGS) -lmems_internals
将$(LDFLAGS)放置最后;
b.修改dixtrac/Makefile
LDFLAGS = -L. -lm -l$(LIBNAME) -ldxtools
$(LIBDISKSIM_LDFLAGS)
$(MEMSMODEL_LDFLAGS)
$(DISKMODEL_LDFLAGS)
$(LIBPARAM_LDFLAGS)
$(LIBDDBG_LDFLAGS)
$(ST_LDFLAGS)
将-lm放置最后;
c.修改src/Makefile
LDFLAGS = -lm -L. -ldisksim $(DISKMODEL_LDFLAGS) $(MEMSMODEL_LDFLAGS)
$(LIBPARAM_LDFLAGS) $(LIBDDBG_LDFLAGS)
将-lm放置最后;
Step 4. Append SSD model library path to dixtrac.
add these lines to dixtrac/.paths
# path to ssdmodel
export SSDMODEL_PREFIX=../ssdmodel
export SSDMODEL_INCL=$(SSDMODEL_PREFIX)/include
export SSDMODEL_CFLAGS=-I$(SSDMODEL_INCL)
export SSDMODEL_LDPATH=$(SSDMODEL_PREFIX)/lib
export SSDMODEL_LDFLAGS=-L$(SSDMODEL_LDPATH) -lssdmodel
modify dixtrac/Makefile like this :
$(LIBDISKSIM_LDFLAGS)
$(MEMSMODEL_LDFLAGS)
$(DISKMODEL_LDFLAGS)
$(SSDMODEL_LDFLAGS)
$(LIBPARAM_LDFLAGS)
$(LIBDDBG_LDFLAGS)
$(ST_LDFLAGS)
CFLAGS = -Wall -g -MD -I. $(DEFINES) -I$(STHREADS) $(DMINCLUDES)
$(LIBDISKSIM_CFLAGS)
$(DISKMODEL_CFLAGS) $(LIBPARAM_CFLAGS) $(LIBDDBG_CFLAGS)
$(SSDMODEL_CFLAGS)
Step 5. Compile!
$ make
Step 6. Check if it works well.
$ cd valid; ./runvalid
$ chmod a+x ../ssdmodel/valid/runvalid
$ cd ../ssdmodel/valid; ./runvalid
Good luck, have fun!