예제 #1
0
def model():
    for format in casm.allInstructions:
        for insn in casm.Formatted(format):
            i = 0
            for asmString in testString(insn[0], insn[1]):
                time.sleep(0.01)
                if insn[1] != None and insn[1] != "":
                    if i == 0:
                        notes = "cc TRUE"
                    else:
                        notes = "cc FALSE"
                else:
                    notes = ""
                i += 1

                issAsmString = "%s; %s; %s" % (asmString, insn[0], issueTiming)
                latAsmString = "%s; %s" % (asmString, latencyTiming)
                issprogramcode = createTestProgramCode(issAsmString)
                latprogramcode = createTestProgramCode(latAsmString)
                isstiming = measure(issprogramcode)
                time.sleep(0.01)
                lattiming = measure(latprogramcode)

                if (type(isstiming) != float):
                    notes = "%s; issue timing error: %s" % (notes, isstiming)
                    isstiming = -1
                else:
                    isstiming = isstiming / 2
                if (type(lattiming) != float):
                    notes = "%s; latency timing error: %s" % (notes, lattiming)
                    lattiming = -1
                logModel.log(insn[0], isstiming, lattiming, notes)
        print "tested format: %s" % format
예제 #2
0
def model():
    for format in casm.allInstructions:
        for insn in casm.Formatted(format):
            i = 0
            for asmString in testString(insn[0], insn[1]):
                time.sleep(0.01)
                if insn[1] != None and insn[1] != "":
                    if i == 0:
                        notes = "cc TRUE"
                    else:
                        notes = "cc FALSE"
                else:
                    notes = ""
                i += 1

                latAsmStringNoMove = asmString.replace("mov r7, #1; ", "")

                issAsmString = "%s; %s" % (asmString, issueTiming
                                           )  #iss: aux, young, Pold, timing
                latAsmString = "%s; %s" % (latAsmStringNoMove, latencyTiming
                                           )  #lat: aux, Pold, young, timing
                issprogramcode = createTestProgramCode(issAsmString)
                latprogramcode = createTestProgramCode(latAsmString)
                isstiming = measure(issprogramcode)
                time.sleep(0.01)
                lattiming = measure(latprogramcode)

                if (type(isstiming) != float):
                    notes = "%s; issue timing error: %s" % (notes, isstiming)
                    isstiming = -1
                if (type(lattiming) != float):
                    notes = "%s; latency timing error: %s" % (notes, lattiming)
                    lattiming = -1
                logModel.log(insn[0], isstiming, lattiming, notes)
        print "tested format: %s" % format
예제 #3
0
def model():
    for format in casm.allInstructions:
        for insn in casm.Formatted(format):
            i = 0
            for asmString in testString(insn[0], insn[1]):
                time.sleep(0.01)
                if insn[1] != None and insn[1] != "":
                    if i == 0:
                        notes = "cc TRUE"
                    else:
                        notes = "cc FALSE"
                else:
                    notes = ""
                i += 1

                issAsmString = "%s %s;" % (issueTiming, asmString)
                latAsmString = "%s %s;" % (latencyTiming, asmString)
                r3AsmString = "%s %s;" % (r3Timing, asmString)
                r4AsmString = "%s %s;" % (r4Timing, asmString)
                issprogramcode = createTestProgramCode(issAsmString)
                latprogramcode = createTestProgramCode(latAsmString)
                r3programcode = createTestProgramCode(r3AsmString)
                r4programcode = createTestProgramCode(r4AsmString)
                isstiming = measure(issprogramcode)
                time.sleep(0.01)
                lattiming = measure(latprogramcode)
                time.sleep(0.01)
                r3timing = measure(r3programcode)
                time.sleep(0.01)
                r4timing = measure(r4programcode)

                if (type(isstiming) != float):
                    notes = "%s; issue timing error: %s" % (notes, isstiming)
                    isstiming = -100
                else:
                    isstiming = isstiming - 1
                if (type(lattiming) != float):
                    notes = "%s; latency timing error: %s" % (notes, lattiming)
                    lattiming = -100
                else:
                    lattiming = lattiming - 1
                if (type(r3timing) != float):
                    notes = "%s; r3 timing error: %s" % (notes, r3timing)
                    r3timing = -100
                else:
                    r3timing -= 1

                if (type(r4timing) != float):
                    notes = "%s; r3 timing error: %s" % (notes, r4timing)
                    r4timing = -100
                else:
                    r4timing -= 1

                logModel.log(
                    insn[0], isstiming, lattiming,
                    "r3: %.1f;; r4: %.1f;; notes: %s" %
                    (r3timing, r4timing, notes))
        print "tested format: %s" % format
예제 #4
0
def model():
    for format in casm.allInstructions:
        for insn in casm.Formatted(format):
            i = 0
            for aux in testString(insn[0], insn[1]):
                time.sleep(0.01)
                if insn[1] != None and insn[1] != "":
                    if i == 0:
                        notes = "cc TRUE"
                    else:
                        notes = "cc FALSE"
                else:
                    notes = ""
                i += 1

                issAsmString = " %s; nop; nop; %s; %s; %s; nop; nop;" % (
                    aux, issueTiming, insn[0], issueTiming
                )  #todo: add the correct surrounding code
                latAsmString = " %s; nop; nop; %s; %s; %s; nop; nop;" % (
                    aux, latencyTiming, insn[0], latencyTiming
                )  #todo: add the correct surrounding code
                issprogramcode = createTestProgramCode(issAsmString)
                latprogramcode = createTestProgramCode(latAsmString)
                isstiming = measure(issprogramcode)
                time.sleep(0.01)
                lattiming = measure(latprogramcode)

                if (type(isstiming) != float):
                    notes = "%s; issue timing error: %s" % (notes, isstiming)
                    isstiming = -1
                else:
                    isstiming = isstiming / 2
                if (type(lattiming) != float):
                    notes = "%s; latency timing error: %s" % (notes, lattiming)
                    lattiming = -1

                if "!" in format:
                    wrbackAsmString = " %s; nop; nop; %s; %s; %s; %s; nop; nop;" % (
                        aux, writebackTiming, insn[0], writebackTiming,
                        re.sub(",[^\]]", switchplusminus,
                               insn[0]), writebackTiming)
                    wrbackprogramcode = createTestProgramCode(wrbackAsmString)
                    wrbacktiming = measure(wrbackprogramcode)
                    if (type(wrbacktiming) != float):
                        notes = "%s; wrback timing error: %s" % (notes,
                                                                 wrbacktiming)
                        wrbacktiming = -1
                    else:
                        wrbacktiming = (wrbacktiming - 1) / 2
                        notes = "%s; wrbackTiming:: %0.1f ::" % (notes,
                                                                 wrbacktiming)
                logModel.log(insn[0], isstiming, lattiming, notes)
        print "tested format: %s" % format