亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? g4_analysis.py

?? disksim是一個非常優秀的磁盤仿真工具
?? PY
字號:
#!/usr/bin/python# diskmodel (version 1.1)# Authors: John Bucy, Greg Ganger# Contributors: John Griffin, Jiri Schindler, Steve Schlosser## Copyright (c) of Carnegie Mellon University, 2003-2005## This software is being provided by the copyright holders under the# following license. By obtaining, using and/or copying this# software, you agree that you have read, understood, and will comply# with the following terms and conditions:## Permission to reproduce, use, and prepare derivative works of this# software is granted provided the copyright and "No Warranty"# statements are included with all reproductions and derivative works# and associated documentation. This software may also be# redistributed without charge provided that the copyright and "No# Warranty" statements are included in all redistributions.## NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS.# CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER# EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED# TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY# OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE# MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH# RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT# INFRINGEMENT.  COPYRIGHT HOLDERS WILL BEAR NO LIABILITY FOR ANY USE# OF THIS SOFTWARE OR DOCUMENTATION.  import sys;import cPickle;import layout;import copyfrom sets import Settry:    infile = open(sys.argv[1], "r");except IOError:    print "open %s" % [sys.argv[1]]try:    loutfilename = sys.argv[2]    loutfile = open(loutfilename, "w")except IOError:    print "open %s" % [loutfilename]try:    moutfilename = sys.argv[3]    moutfile = open(moutfilename, "w")except IOError:    print "open %s" % [moutfilename]cname = sys.argv[4]lin = layout.Layout();lin = cPickle.load(infile);lout = copy.copy(lin)lout.rects = []lout.rinsts = []# default is 2 * heads -- too small for cylrange sparing# could manage this adaptively?max_rect = 2 * lin.headsassert(max_rect > 0)# XXX I'm sure there's a slicker way to do thisdef idx(x,y):    res = None    i = 0    for j in y:        if j == x:            res = i            break        else:            i += 1    return res# Try matching r starting at e0.  Return (good, inst).  Good number# of extents matched successfully.def matchRect(l, r, e0):    good = bad = 0    lastgood = e0    basecyl0 = reduce(lambda x,y: min(x,y.cyl), r.exts, r.exts[0].cyl)    basecyl = min(map(lambda x: x.cyl, l.exts[e0:e0+r.len()]))#    print "matchrect basecyl0 %d basecyl %d cw %d" % (basecyl0, basecyl, r.cylwidth)        for off in range(0,r.len()):        if e0 + off >= len(l.exts):            break                ext0i = r.exts[off]        exti = l.exts[e0 + off]                if ext0i.head == exti.head \               and (ext0i.cyl - basecyl0) == ((exti.cyl - basecyl) % r.cylwidth)\               and ext0i.tp[0] == exti.tp[0] \               and ext0i.tp[1] == exti.tp[1]:            lastgood += 1            good += 1#            print "matched (%s) (%s)" % (ext0i, exti)        else:#            print "broke (rlen %d) (%s) (%s)" % (r.len(), ext0i, exti)            return (0, None, 0)            return (good, layout.RectInst(r, l.exts[e0], l.exts[e0 + off], off+1), lastgood-1)    def breakcond(bad,good):    return bad+good > 100 and bad * 3 > good# See how well a rect of size rlen starting at e0 works.  Return# (good, inst list).  good is number of extents matched succesfully.def tryRect(l, r, e0):    inst = 0    goodtot = 0    badtot = 0    insts = []    lastgood = e0        inst0 = e0    i = 0    nextcyl = l.exts[inst0].cyl    while inst0+r.len() < len(l.exts):        # Make them be contiguous/monotonic in cyls.        # Fails for LBNs because of slips.  Not necessary anyway since the         # input is in ascending LBN order.        if l.exts[inst0].cyl != nextcyl:            break        (good, inst, lastgoodr) = matchRect(l, r, inst0)        goodtot += good        badtot += r.len() - good        if inst != None:            lastgood = lastgoodr            insts.append(inst)        else:            break;#            i = inst0#            if i + r.len() <= len(l.exts): max = i+r.len()#            else: max = r.len()#            for i in range(inst0,max):#                insts.append(layout.RectInst(None, l.exts[i], l.exts[i], 1))        i += 1        inst0 += r.len()        nextcyl += r.cylwidth    return (goodtot, insts, lastgood)# Come up with a leaf with len runsdef getLeaf(l, e0, llen):    ei = e0       # ith run    eij = e0      # loop counter     eijprev = e0  # one before eij    dir = 0       # 1 or -1    origlen = llen    res = layout.Rect()        while llen > 0:        if ei+1 >= len(l.exts):            break        if l.exts[ei].head == l.exts[ei+1].head:            dir = l.exts[ei+1].cyl - l.exts[ei].cyl            if dir == 1 or dir == -1:                eij = ei + 1                eijprev = ei                # accumulate a cyl run on a given surface#                print "new run %s" % (l.exts[ei])                while eij < len(l.exts) \                          and l.exts[eij].head == l.exts[ei].head \                          and l.exts[eij].cyl == l.exts[eijprev].cyl + dir \                          and l.exts[eij].tp == l.exts[eijprev].tp:#                    print "add to run %s" % (l.exts[eij])                    eij += 1                    eijprev += 1                # runs must be of len > 2                if eij - ei < 3:                    eij = ei                else:                    eij -= 1                    cylrunlen = abs(l.exts[eij].cyl - l.exts[ei].cyl) + 1                    res.ents.append((l.exts[ei], \                                     cylrunlen * (l.exts[ei].tp[1] - l.exts[ei].tp[0]),                                    dir * cylrunlen))        llen -= 1        eij += 1        ei = eij         if ei > e0:        res.exts = l.exts[e0:ei]        # if no runs -- all ents are singletons, we have to make this up here        if ei - e0 == origlen:            res.ents = map(lambda x: (x,x.tp[1]-x.tp[0],1), res.exts)        res.cylwidth = max(map((lambda (x): x.cyl), res.exts)) - min(map((lambda (x): x.cyl), res.exts)) + 1         res.lbnwidth = reduce((lambda x,y: x + y.tp[1]), res.exts, 0)#        print "getLeaf %d - %d" % (e0,ei)    else:        res = None            return res# Find a rect in layout l starting at extent e0. Return# a pair of (Rect, RectInst) if we find one or () otherwise.def findRect(l, e0, rects):    ext0 = l.exts[e0]    bestinsts = 0    bestrlen = 0    bestrect = None    bestrectinsts = None    bestlastgood = 0    # Try known ones.    for ri in rects:        if ri.exts == []: # placeholder            continue                            (good, insts, lastgood) = tryRect(l, ri, e0)        if good > 2 * ri.len() and good > bestinsts:            bestlastgood = lastgood            bestrect = ri            bestrectinsts = insts            bestinsts = good + ri.len()            bestrlen = ri.len()    rlen = max_rect    # Try to find a new one.    # loop over rect lengths    for rlen in range(1,max_rect+1):        if e0 + rlen > len(l.exts): break        #        print "rlen %d" % (rlen)        # Special case (e.g. ST318451FC):        # don't do run compression of unit rects.                ri = getLeaf(l,e0,rlen)        if not ri:            break#        print "rlen %d cylwidth %d lbnwidth %d" % (rlen, cylwidth, lbnwidth)                # loop over instances -- keep going until it        # breaks or we get to the end        (good, insts, lastgood) = tryRect(l, ri, e0)        if good > 2 * rlen:            if good >= bestinsts:#                print "rlen %d better (or smaller) than %d (good %d)" % (rlen, bestrlen, good)                bestlastgood = lastgood                bestrect = ri                bestrectinsts = insts                bestinsts = good # + rlen                bestrlen = rlen#            else:#               print "rlen %d ok (good %d)" % (rlen, good)#c        else:#            print "rlen %d bad %d" % (rlen,good)    if bestrect != None and bestinsts > bestrect.len():#        print "Best rect len %d matched %d exts" % (bestrlen, bestinsts)#        print "Rect:"#        for (e,cylrunlen,runlen) in bestrect.ents:#            print "ext %s runlen %d cylrunlen %d" % (e,runlen,cylrunlen)#        print "Insts:"#        for i in bestrectinsts:#            if i.rect == None:#                print "junk %s" % (i.start)#            else:#                print i.start#        print bestrectinsts[0].start#        print bestrectinsts[-1].start        return (bestrect, bestrectinsts, bestlastgood)    else:        return None    # find the point between low and high where it switches from# "bad" to "good"def printIDX(l, op, insts, e0, newidx):    lowcyl = reduce(lambda x,y: min(x,y.cyl), op.exts, op.exts[0].cyl)    highcyl = reduce(lambda x,y: max(x,y.cyl), op.exts, op.exts[-1].cyl)    lowlbn = reduce(lambda x,y: min(x,y.lbn), op.exts, op.exts[0].lbn)    highlbn = reduce(lambda x,y: max(x,y.lbn), op.exts, op.exts[-1].lbn)#    print "printIDX (newidx %d)" % (newidx)#    print "lowcyl %d highcyl %d l0 %d ln %d" % (lowcyl,highcyl,lowlbn,highlbn)    if newidx:        ln = []        for j in op.ents:#            print "foo %s" % (j)            (ei,lbnlen,cyllen) = j            li = [ ei.lbn - lowlbn,     # loff \                    ei.cyl - lowcyl,     # coff \                    0.0,                 # aoff \                    ei.tp[1] - ei.tp[0], # llen \                    1,                   # clen \                    0.0,                 # alen \                    lbnlen,              # lrunlen \                     cyllen,              # cylrunlen \                    "TRACK",                    idx(ei.tp, lin.tps),\                    ei.head ]#            print li            ln += li    else:        ln = []            #    ei = op.ents[0][0]    l0 = l.exts[e0].lbn - (op.ents[0][0].lbn - lowlbn)    c0 = l.exts[e0].cyl - (op.ents[0][0].cyl - lowcyl)    return ([l0, c0, 0.0, op.lbnwidth, op.cylwidth, 0.0,\             insts * op.lbnwidth, insts * op.cylwidth, "IDX", 0 ], ln)      def makejunkrent(l):    lowcyl = reduce(lambda x,y: min(x,y.cyl), l.exts, l.exts[0].cyl)    highcyl = reduce(lambda x,y: max(x,y.cyl), l.exts, l.exts[-1].cyl)    lowlbn = reduce(lambda x,y: min(x,y.lbn), l.exts, l.exts[0].lbn)    highlbn = reduce(lambda x,y: max(x,y.lbn), l.exts, l.exts[-1].lbn)    llen = reduce(lambda x,y: x + y.tp[1] - y.tp[0], l.exts, 0)#    print "makejunkrect"    print "lowcyl %d highcyl %d l0 %d ln %d llen %d" % (lowcyl,highcyl,lowlbn,highlbn, llen)    ln = []    for ei in l.exts:#        print ei        extlen = ei.tp[1] - ei.tp[0]        li = [ ei.lbn - lowlbn, # loff \                ei.cyl - lowcyl, # coff \                0.0,    # aoff \                extlen, # llen \                1,      # clen \                0.0,    # alen \                extlen, # lrunlen \                 1,      # cylrunlen \                "TRACK",                idx(ei.tp, lin.tps),\                ei.head ]        ln += li    return ([ lowlbn, lowcyl, 0.0, \              llen, highcyl - lowcyl + 1, 0.0, \              llen, highcyl - lowcyl + 1, "IDX", 0 ], ln)root = []def outer(l):    # result list of index nodes     idxen = []     i = 0    junkleaf = None    while i < len(l.exts):        res = findRect(l, i, lout.rects)        if res != None:            if junkleaf:                (rent,li) = makejunkrent(junkleaf)#                print "junk rent %d %d" % (rent[3], rent[6])#                print rent                rent[-1] = len(lout.rects)#                print "Junk leaf (len %d)" % (len(junkleaf.exts))                root.append(rent)                assert(li != [])                idxen.append(libparam.List(li, 11))                # placeholder for idx                lout.rects.append(layout.Rect([]))                junkleaf = None                            (r,inst,lastgood) = res            newidx = not(r in lout.rects)            if newidx:                lout.rects.append(r)#            for e in r.exts: print e            (rent,li) = printIDX(lout, r, len(inst), i, newidx)            rent[-1] = idx(r,lout.rects)                        if newidx:                assert(li != [])                idxen.append(libparam.List(li, 11))            root.append(rent)            i = lastgood + 1#            print "next ext %d" % (i)        else:            if not junkleaf:                junkleaf = layout.Rect([l.exts[i]])            else:                junkleaf.exts.append(l.exts[i])            #            print "gave up on %s" % (l.exts[i])            i += 1            sys.stdout.flush()    if i > lastgood+1:        junkleaf = layout.Rect(l.exts[lastgood+1:i])        (rent,li) = makejunkrent(junkleaf)#        print "junk rent %d %d" % (rent[3], rent[6])        rent[-1] = len(lout.rects)        assert(li != [])        idxen.append(libparam.List(li, 11))        root.append(rent)    ln = []    for i in range(0,len(root)):        (loff,coff,aoff,llen,clen,alen,lrunlen,crunlen,childtype,child) = root[i]        if i == len(root) - 1:            slips = reduce(lambda x,y: x+y.tp[1], lin.slips, 0)            slips *= 2 # XXX magic            llen += slips            lrunlen += slips                    ln += [loff,coff,aoff,llen,clen,alen,lrunlen,crunlen,childtype,child]    assert(ln != [])    idxen.append(libparam.List(ln, 10))    return idxenimport libparam# dm_disk blockdmdisk = libparam.Block(typename = "dm_disk",\                        name = ("%s.model" % cname),\                        d = {"Block count" : lin.lbns,\                             "Number of data surfaces" : lin.heads,\                             "Number of cylinders" : lin.cyls,                             "Layout Model" : libparam.Source("layout.model")})# dm_layout_g4 blocklb = {}tps = []for (off,count) in lin.tps.keys():    spt = count  # XXX fake    tps += [off,count-1,spt]lb["TP"] = libparam.List(tps, 3)idx = outer(lin)lb["IDX"] = libparam.List(idx)slips = []for s in lin.slips:    lbn = s.lbn    count = s.tp[1]    slips += [lbn,count]# l is a list of (src ext, dest ext) pairsdef DoRemaps(l):    result = []    for (src,dest) in l:        len = src.tp[1]        result += [ src.lbn, len,                    dest.cyl, dest.head, dest.tp[0], len] # fake!       return resultlb["Slips"] = libparam.List(slips, 2)lb["Remaps"] = libparam.List(DoRemaps(lin.defects))layoutg4 = libparam.Block(typename="dm_layout_g4",                          d = lb)loutfile.write(libparam.marshal(layoutg4))moutfile.write(libparam.marshal(dmdisk))

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀久久久99精品久久久久久| 精品一区二区三区在线播放| 亚洲码国产岛国毛片在线| 亚洲精品乱码久久久久久 | 欧美午夜电影网| 7777精品伊人久久久大香线蕉完整版| 日韩视频免费直播| 亚洲视频一区二区在线观看| 午夜激情一区二区| 波波电影院一区二区三区| 欧美一区二区三区在线观看视频 | 综合久久久久久久| 伦理电影国产精品| 欧美中文字幕久久| 久久久影视传媒| 婷婷综合在线观看| 成人深夜福利app| 制服丝袜在线91| 95精品视频在线| 91精品国产品国语在线不卡| 一区二区三区在线视频观看 | 蜜臀av性久久久久蜜臀av麻豆| 色八戒一区二区三区| 日韩一区欧美小说| 欧美日韩国产高清一区二区三区| 亚洲日本在线视频观看| 99久久99久久精品免费观看| 国产精品免费网站在线观看| 国产高清视频一区| 国产日本欧美一区二区| 国产成人精品1024| 国产精品久久久久国产精品日日| 成人一区二区三区中文字幕| 国产亚洲成年网址在线观看| 成人91在线观看| 日韩毛片一二三区| 在线这里只有精品| 亚洲va欧美va人人爽午夜| 欧美日韩亚洲国产综合| 午夜伊人狠狠久久| 欧美一级二级三级蜜桃| 激情综合网av| 亚洲国产精品精华液ab| 99久久综合精品| 一区二区在线观看免费| 在线不卡中文字幕播放| 蜜臀av国产精品久久久久| 久久综合色之久久综合| 高清成人免费视频| 一区二区三区日本| 91精品午夜视频| 国产麻豆成人传媒免费观看| 国产精品高潮呻吟久久| 欧美在线免费观看亚洲| 日韩电影免费一区| 国产女同互慰高潮91漫画| 播五月开心婷婷综合| 亚洲成人自拍偷拍| 久久久久久久综合色一本| 色综合天天综合| 蜜桃视频第一区免费观看| 国产日产精品1区| 欧美最猛黑人xxxxx猛交| 看电影不卡的网站| 亚洲色图视频网站| 日韩欧美在线123| 99国产欧美另类久久久精品| 日本v片在线高清不卡在线观看| 亚洲精品在线观看网站| 99国产精品一区| 久久国产欧美日韩精品| 亚洲天堂av一区| 欧美精品一区二区三| 色噜噜夜夜夜综合网| 激情久久五月天| 亚洲激情自拍视频| 久久久久久日产精品| 欧美日本一道本| 成人国产一区二区三区精品| 日产精品久久久久久久性色| 日韩毛片视频在线看| 精品国产乱码久久久久久老虎| 91福利区一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 一区二区在线免费| 首页亚洲欧美制服丝腿| 亚洲人吸女人奶水| 日韩你懂的在线观看| 欧美午夜免费电影| 972aa.com艺术欧美| 国产91精品一区二区| 老司机免费视频一区二区| 一区二区三区四区在线播放| 国产精品麻豆网站| 国产日韩欧美精品综合| 91精品国产91久久综合桃花| 91国产免费观看| 99久久久精品免费观看国产蜜| 国产乱码精品一区二区三| 日本亚洲电影天堂| 水蜜桃久久夜色精品一区的特点| 亚洲欧美另类小说视频| 综合久久一区二区三区| 国产精品久久久爽爽爽麻豆色哟哟| 日韩色在线观看| 日韩精品一区二区三区四区| 制服丝袜亚洲精品中文字幕| 色天使色偷偷av一区二区| 不卡视频一二三四| av电影在线观看一区| 成人国产一区二区三区精品| 国产精品996| 国产大片一区二区| 国产一区二区视频在线| 国产呦精品一区二区三区网站| 蜜臀av在线播放一区二区三区| 免费成人在线网站| 久久电影国产免费久久电影| 久久99九九99精品| 国内成人自拍视频| 丰满岳乱妇一区二区三区| 成人性生交大片免费看中文| 成人国产免费视频| 色八戒一区二区三区| 欧美怡红院视频| 日韩视频一区二区三区在线播放| 精品国产乱码久久久久久久久 | 69久久99精品久久久久婷婷| 欧美日韩国产高清一区二区 | 在线看日本不卡| 欧美日本一区二区| 亚洲精品一区二区三区福利 | 精品噜噜噜噜久久久久久久久试看| 日韩美女在线视频| 欧美国产欧美亚州国产日韩mv天天看完整| 欧美国产日韩精品免费观看| 亚洲视频电影在线| 日韩av成人高清| 成人美女在线观看| 欧美三区免费完整视频在线观看| 7777精品伊人久久久大香线蕉| 精品国产成人系列| 国产精品国产成人国产三级| 五月开心婷婷久久| 国产91丝袜在线播放0| 91麻豆精品在线观看| 7777精品伊人久久久大香线蕉完整版 | 久久超碰97人人做人人爱| 国产精品自拍三区| 一本到高清视频免费精品| 欧美一区二区三区男人的天堂| 久久精品一区二区三区四区| 亚洲天堂久久久久久久| 男男视频亚洲欧美| 99久久精品国产麻豆演员表| 欧美一级黄色大片| 亚洲欧洲成人自拍| 韩国三级电影一区二区| 色综合天天天天做夜夜夜夜做| 日韩女优毛片在线| 樱桃视频在线观看一区| 国产乱一区二区| 91精品国产色综合久久ai换脸| 国产精品久久久久一区二区三区共 | 国模冰冰炮一区二区| 欧美综合亚洲图片综合区| 精品国产凹凸成av人网站| 亚洲国产精品久久久久婷婷884| 国产最新精品免费| 欧美丰满嫩嫩电影| 亚洲欧美日韩一区二区三区在线观看 | 欧美高清在线一区| 久久精品国产一区二区| 欧美少妇xxx| 亚洲人成在线观看一区二区| 国产精品影视网| 91精品啪在线观看国产60岁| 亚洲一区二区三区视频在线 | 国产69精品一区二区亚洲孕妇| 欧美一区日韩一区| 洋洋成人永久网站入口| 成人网在线播放| 国产人成亚洲第一网站在线播放| 美女免费视频一区二区| 欧美老人xxxx18| 亚洲成国产人片在线观看| 色哟哟一区二区| 中文字幕制服丝袜成人av| 国产高清精品网站| 久久综合色一综合色88| 国产在线不卡一卡二卡三卡四卡| 日韩欧美在线影院| 全国精品久久少妇| 91精品久久久久久久91蜜桃| 日韩国产欧美视频| 51精品视频一区二区三区| 日本在线播放一区二区三区| 欧美电影一区二区| 免费视频最近日韩| 欧美tickling挠脚心丨vk|