
disksim_global Global { 
  Init Seed = 42,
  Real Seed = 42,
  # Statistic warm-up period = 0.0 seconds,
  Stat definition file = statdefs,
  Detailed execution trace = exectrace
  # Output file for trace of I/O requests simulated =
}

disksim_stats Stats {
  iodriver stats = disksim_iodriver_stats {
    Print driver size stats = 1,
    Print driver locality stats = 1,
    Print driver blocking stats = 1,
    Print driver interference stats = 0,
    Print driver queue stats = 1,
    Print driver crit stats = 1,
    Print driver idle stats = 1,
    Print driver intarr stats = 1,
    Print driver streak stats = 1,
    Print driver stamp stats = 1,
    Print driver per-device stats = 1 
  },
  bus stats = disksim_bus_stats {
    Print bus idle stats = 0,
    Print bus arbwait stats = 0 
  },
  ctlr stats = disksim_ctlr_stats {
    Print controller cache stats = 1,
    Print controller size stats = 1,
    Print controller locality stats = 1,
    Print controller blocking stats = 1,
    Print controller interference stats = 1,
    Print controller queue stats = 1,
    Print controller crit stats = 1,
    Print controller idle stats = 1,
    Print controller intarr stats = 1,
    Print controller streak stats = 1,
    Print controller stamp stats = 1,
    Print controller per-device stats = 1 
  },
  device stats = disksim_device_stats {
    Print device queue stats = 0,
    Print device crit stats = 0,
    Print device idle stats = 1,
    Print device intarr stats = 0,
    Print device size stats = 0,
    Print device seek stats = 1,
    Print device latency stats = 1,
    Print device xfer stats = 1,
    Print device acctime stats = 1,
    Print device interfere stats = 1,
    Print device buffer stats = 1 
  }, 
  process flow stats = disksim_pf_stats {
    Print per-process stats =  0,
    Print per-CPU stats =  0,
    Print all interrupt stats =  0,
    Print sleep stats =  0
  }
} # end of stats block


disksim_iodriver DRIVER0 {
  type = 1,
  Constant access time = 0.0,
  Scheduler = disksim_ioqueue {
    Scheduling policy = 1,
    Cylinder mapping strategy = 1,
    Write initiation delay = 0.0,
    Read initiation delay = 0.0,
    Sequential stream scheme = 0,
    Maximum concat size = 128,
    Overlapping request scheme = 0,
    Sequential stream diff maximum = 0,
    Scheduling timeout scheme = 0,
    Timeout time/weight = 6,
    Timeout scheduling = 4,
    Scheduling priority scheme = 0,
    Priority scheduling = 4
  }, # end of Scheduler
  Use queueing in subsystem = 1
} # end of DRV0 spec

disksim_bus BUS_DR2C {
  type = 1,
  Arbitration type = 1,
  Arbitration time = 0.0,
  Read block transfer time = 0.0,
  Write block transfer time = 0.0,
  Print stats =  0
} # end of BUS0 spec

disksim_bus BUS_C2DI {
  type = 1,
  Arbitration type = 1,
  Arbitration time = 0.0,
  Read block transfer time = 0.0,
  Write block transfer time = 0.0,
  Print stats =  1
} # end of BUS1 spec

# anjo
disksim_bus BUS_C2F {
	type = 2,
	Arbitration type = 1,
	Arbitration time = 0.001,
	Read block transfer time = 0.0002384,
	Write block transfer time = 0.0002384,
	Print stats =  1
} # end of BUS_C2F spec
#anjo

#disksim_ctlr CTLR0 {
#  type = 1,
#  Scale for delays = 0.0,
#  Bulk sector transfer time = 0.0,
#  Maximum queue length = 0,
#  Print stats =  1,
  # anjo
#  Replication Factor = 1
  # anjo
#} # end of CTLR0 spec


# anjo
disksim_ctlr CTLR0 {
	type = 3,
	Scale for delays = 0.0,
	Bulk sector transfer time = 0.0,
	Maximum queue length = 0,
	Print stats =  1,
	Scheduler = disksim_ioqueue {
	     Scheduling policy = 3,
	     Cylinder mapping strategy = 1,
	     Write initiation delay = 0.0,
	     Read initiation delay = 0.0,
	     Sequential stream scheme = 3,
	     Maximum concat size = 128,
	     Overlapping request scheme = 0,
	     Sequential stream diff maximum = 0,
	     Scheduling timeout scheme = 0,
	     Timeout time/weight = 6,
	     Timeout scheduling = 4,
	     Scheduling priority scheme = 0,
	     Priority scheduling = 4
	},  # end of ioqueue spec 
	Cache = disksim_cachemem { 
	     Cache size = 8192,
	     SLRU segments = [ 1.0 ],
	     Line size = 64,
	     Bit granularity = 1,
	     Lock granularity = 64,
	     Shared read locks = 1,
	     Max request size = 512,
	     Replacement policy = 2,
	     Allocation policy = 0,
	     Write scheme = 3,
	     Flush policy = 0,
	     Flush period = 0.0,
	     Flush idle delay = -1.0,
	     Flush max line cluster = 8,
	     Read prefetch type  = 0,
	     Write prefetch type = 0,
	     Line-by-line fetches = 0,
	     Max gather = 7
	},  # end of cachemem spec 
	Max per-disk pending count = 1
  # anjo
  #Replication = 1
  # anjo
} # end of CTLR0 spec
# anjo

# anjo
ssdmodel_ssd SSD {
     # vp - this is a percentage of total pages in the ssd
     Reserve pages percentage = 15,

     # vp - min percentage of free blocks needed. if the free 
     # blocks drop below this, cleaning kicks in
     Minimum free blocks percentage = 5,

     # vp - a simple read-modify-erase-write policy = 1 (no longer supported)
     # vp - osr write policy = 2
     Write policy = 2,

     # vp - random = 1 (not supp), greedy = 2, wear-aware = 3
     Cleaning policy = 2,

     # vp - number of planes in each flash package (element)
     Planes per package = 8,

     # vp - number of flash blocks in each plane
     Blocks per plane = 2048,

     # vp - how the blocks within an element are mapped on a plane
     # simple concatenation = 1, plane-pair stripping = 2 (not tested),
     # full stripping = 3
     Plane block mapping = 3,

     # vp - copy-back enabled (1) or not (0)
     Copy back = 1,

     # how many parallel units are there?
     # entire elem = 1, two dies = 2, four plane-pairs = 4
     Number of parallel units = 1,

     # vp - we use diff allocation logic: chip/plane
     # each gang = 0, each elem = 1, each plane = 2
     Allocation pool logic = 1,

     # elements are grouped into a gang
     Elements per gang = 1,

     # shared bus (1) or shared control (2) gang
     Gang share = 1,

     # when do we want to do the cleaning?
     Cleaning in background = 0,

     Command overhead =  0.00,
     Bus transaction latency =  0.0,

#    Assuming PCI-E, with 8 lanes with 8b/10b encoding.
#    This gives 2.0 Gbps per lane and with 8 lanes we get about
#    2.0 GBps. So, bulk sector transfer time is about 0.238 us.
#    Use the "Read block transfer time" and "Write block transfer time"
#    from disksim_bus above.
     Bulk sector transfer time =  0,

     Flash chip elements = 8,

     Page size = 8,

     Pages per block = 64,

     # vp - changing the no of blocks from 16184 to 16384
     Blocks per element = 16384,

     Element stride pages = 1,

     Never disconnect =  1,
     Print stats =  1,
     Max queue length =  20,
     Scheduler = disksim_ioqueue {
       Scheduling policy =  1,
       Cylinder mapping strategy =  0,
       Write initiation delay =  0,
       Read initiation delay =  0.0,
       Sequential stream scheme =  0,
       Maximum concat size =  0,
       Overlapping request scheme =  0,
       Sequential stream diff maximum =  0,
       Scheduling timeout scheme =  0,
       Timeout time/weight =  0,
       Timeout scheduling =  0,
       Scheduling priority scheme =  0,
       Priority scheduling =  1
     },
     Timing model = 1,

     # vp changing the Chip xfer latency from per sector to per byte
     Chip xfer latency = 0.000025,

     Page read latency = 0.025,
     Page write latency = 0.200,
     Block erase latency = 1.5
}  # end of SSD spec

# Source the disk specs
source maxtor146g.diskspecs

# component instantiation
instantiate [ statfoo ]   as  Stats
instantiate [ bus_dr2c ]    as  BUS_DR2C
instantiate [ bus_c2di ]    as  BUS_C2DI
# anjo
instantiate [ bus_c2f ]    as  BUS_C2F
# anjo
instantiate [ disk0 ]   as  MAXTOR_ATLAS10K4_146SCA_B8DJ0SLM_00000
instantiate [ ssd0 ] as SSD
instantiate [ driver0 ] as  DRIVER0
instantiate [ ctlr0 ]   as  CTLR0


# system topology
topology disksim_iodriver driver0 [
   disksim_bus bus_dr2c [ 
      disksim_ctlr ctlr0 [ 
      	# anjo
         disksim_bus bus_c2f [
         	ssdmodel_ssd ssd0 []
         ], # end of bus_c2f
         # anjo
         disksim_bus bus_c2di [ 
            disksim_disk disk0 []
         ] # end of bus_c2di
      ] # end of ctlr0
   ] # end of bus_dr2c
] # end of system topology 

# no syncsets

disksim_logorg ORG1 {
   Addressing mode = Array,
   Distribution scheme = Striped,
   Redundancy scheme = Noredun,

   # vp - added more ssd elements
   devices = [ ssd0 ],

   Stripe unit  =  128,
   Synch writes for safety =  0,
   Number of copies =  2,
   Copy choice on read =  6,
   RMW vs. reconstruct =  0.5,
   Parity stripe unit =  128,
   Parity rotation type =  1,
   Time stamp interval =  0.000000,
   Time stamp start time =  60000.000000,
   Time stamp stop time =  10000000000.000000,
   Time stamp file name =  stamps
} # end of logorg org0 spec

disksim_logorg ORG0 {
   Addressing mode = Parts,
   Distribution scheme = Asis,
   Redundancy scheme = Noredun,
   devices = [ disk0 ],
   Stripe unit  =  286749479,
   Synch writes for safety =  0,
   Number of copies =  2,
   Copy choice on read =  6,
   RMW vs. reconstruct =  0.5,
   Parity stripe unit =  64,
   Parity rotation type =  1,
   Time stamp interval =  0.000000,
   Time stamp start time =  60000.000000,
   Time stamp stop time =  10000000000.000000
#   Time stamp file name =  stamps
} # end of logorg org0 spec



instantiate [ org0 ] as ORG0
instantiate [ org1 ] as ORG1


disksim_pf Proc {
   Number of processors =  2,
   Process-Flow Time Scale =  1.0
} # end of process flow spec


disksim_synthio Synthio {
  Number of I/O requests to generate =  10000,
  Maximum time of trace generated  = 10000000.0,
  System call/return with each request = 0,
  Think time from call to request =  0.0,
  Think time from request to return =  0.0,

  Generators = [
  disksim_synthgen { # generator 0 
    Storage capacity per device  = 6156008, # 286749479,
    devices = [ ssd0 ], 
    Blocking factor =  8,
    Probability of sequential access =  0.0,
    Probability of local access =  0.0,
    Probability of read access =  1.0,
    Probability of time-critical request = 1.0,
    Probability of time-limited request = 0.0,
    Time-limited think times  = [ normal, 30.0, 100.0  ],
    General inter-arrival times  = [ exponential, 0.0, 0.0  ],
    Sequential inter-arrival times  = [ normal, 0.0, 0.0  ],
    Local inter-arrival times  = [ exponential, 0.0, 0.0  ],
    Local distances  = [ normal, 0.0, 40000.0  ],
    Sizes  = [ exponential, 0.0, 8.0  ]
  }

] # end of generator list 
} # end of synthetic workload spec



