From 753038617e944e3640c2c329a89b297cacdf8548 Mon Sep 17 00:00:00 2001 From: Per Lindgren <per.lindgren@ltu.se> Date: Sat, 11 Jan 2020 23:36:47 +0100 Subject: [PATCH] ktest and runner wip --- .gitignore | 3 + Cargo.toml | 2 +- compile.txt | 0 examples/f401_break.rs | 32 ++ ktest/Cargo.lock | 6 + ktest/Cargo.toml | 9 + ktest/gdb.py | 812 +++++++++++++++++++++++++++++++++++++++++ ktest/src/README.md | 3 + ktest/src/main.rs | 78 ++++ ktest/test000001.ktest | Bin 0 -> 140 bytes runner/Cargo.lock | 732 +++++++++++++++++++++++++++++++++++++ runner/Cargo.toml | 11 + runner/src/main.rs | 3 + 13 files changed, 1690 insertions(+), 1 deletion(-) delete mode 100644 compile.txt create mode 100644 examples/f401_break.rs create mode 100644 ktest/Cargo.lock create mode 100644 ktest/Cargo.toml create mode 100644 ktest/gdb.py create mode 100644 ktest/src/README.md create mode 100644 ktest/src/main.rs create mode 100644 ktest/test000001.ktest create mode 100644 runner/Cargo.lock create mode 100644 runner/Cargo.toml create mode 100644 runner/src/main.rs diff --git a/.gitignore b/.gitignore index 53eaa21..36762cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ /target **/*.rs.bk + +ktest/target +runner/target \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 1d0a236..0bf009d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ klee-analysis = [ inline-asm = ["cortex-m/inline-asm"] # rtpro = [ "cortex-m-rtfm/klee-analysis", "cortex-m-rt/rtpro", "lm3s6965" ] -f4 = ["stm32f4/stm32f401", "stm32f4/rt", "cortex-m-semihosting", "cortex-m-rt"] +f4 = ["stm32f4/stm32f401", "stm32f4/rt", "cortex-m-semihosting", "cortex-m-rt", "cortex-m"] [profile.dev] panic = "abort" diff --git a/compile.txt b/compile.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/f401_break.rs b/examples/f401_break.rs new file mode 100644 index 0000000..90e5416 --- /dev/null +++ b/examples/f401_break.rs @@ -0,0 +1,32 @@ +// minimal example for the stm32-f401 (and the f4 series) +//! Prints "Hello, world!" on the host console using semihosting + +#![no_main] +#![no_std] + +extern crate panic_halt; + +use stm32f4::stm32f401 as stm32; + +use cortex_m::asm; +use cortex_m_rt::entry; + +#[entry] +fn main() -> ! { + asm::bkpt(); + + loop {} +} + +// See RM0368 Reference Manual for details +// https://www.st.com/content/ccc/resource/technical/document/reference_manual/5d/b1/ef/b2/a1/66/40/80/DM00096844.pdf/files/DM00096844.pdf/jcr:content/translations/en.DM00096844.pdf +// +// Memory map is given in `memory.x`, in particular we define: +// 96k RAM starting at 0x2000_0000, and +// 256k Flash starting at 0x0800_0000 +// +// Run in separate terminal: +// openocd -f openocd.cfg +// +// cargo run --example f401_minimal --features f4 --target thumbv7em-none-eabihf +// This is the way! diff --git a/ktest/Cargo.lock b/ktest/Cargo.lock new file mode 100644 index 0000000..ba62565 --- /dev/null +++ b/ktest/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ktest" +version = "0.1.0" + diff --git a/ktest/Cargo.toml b/ktest/Cargo.toml new file mode 100644 index 0000000..c275c38 --- /dev/null +++ b/ktest/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "ktest" +version = "0.1.0" +authors = ["Per Lindgren <per.lindgren@ltu.se>"] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + + diff --git a/ktest/gdb.py b/ktest/gdb.py new file mode 100644 index 0000000..fa25058 --- /dev/null +++ b/ktest/gdb.py @@ -0,0 +1,812 @@ +#!/usr/bin/env python +import gdb +import os +import sys +import struct +from subprocess import call +import subprocess +import glob + +""" ktest file version """ +version_no = 3 + +# debug = False +debug = True +autobuild = True + +debug_file = "resource" + +# klee_out_folder = 'target/x86_64-unknown-linux-gnu/debug/examples/' +klee_out_folder = 'target/x86_64-unknown-linux-gnu/release/examples/' +stm_out_folder = 'target/thumbv7em-none-eabihf/release/examples/' + +file_list = [] +file_index_current = -1 +object_index_current = 0 + +tasks = [] +priorities = [] +interarrival = [] + +task_name = "" +file_name = "" + +priority = 0 +first = True + +# [[ Test, Task, Cyccnt, priority/ceiling]] +outputdata = [] + +""" Max number of events guard """ +object_index_max = 100 + +""" Define the original working directory """ +original_pwd = os.getcwd() + + +""" taken from KLEE """ + + +class KTestError(Exception): + pass + + +class KTest: + + @staticmethod + def fromfile(path): + if not os.path.exists(path): + print("ERROR: file %s not found" % (path)) + sys.exit(1) + + f = open(path, 'rb') + hdr = f.read(5) + if len(hdr) != 5 or (hdr != b'KTEST' and hdr != b"BOUT\n"): + raise KTestError('unrecognized file') + version, = struct.unpack('>i', f.read(4)) + if version > version_no: + raise KTestError('unrecognized version') + numArgs, = struct.unpack('>i', f.read(4)) + args = [] + for i in range(numArgs): + size, = struct.unpack('>i', f.read(4)) + args.append(str(f.read(size).decode(encoding='ascii'))) + + if version >= 2: + symArgvs, = struct.unpack('>i', f.read(4)) + symArgvLen, = struct.unpack('>i', f.read(4)) + else: + symArgvs = 0 + symArgvLen = 0 + + numObjects, = struct.unpack('>i', f.read(4)) + objects = [] + for i in range(numObjects): + size, = struct.unpack('>i', f.read(4)) + name = f.read(size) + size, = struct.unpack('>i', f.read(4)) + bytes = f.read(size) + objects.append((name, bytes)) + + # Create an instance + b = KTest(version, args, symArgvs, symArgvLen, objects) + # Augment with extra filename field + b.filename = path + return b + + def __init__(self, version, args, symArgvs, symArgvLen, objects): + self.version = version + self.symArgvs = symArgvs + self.symArgvLen = symArgvLen + self.args = args + self.objects = objects + + # add a field that represents the name of the program used to + # generate this .ktest file: + program_full_path = self.args[0] + program_name = os.path.basename(program_full_path) + # sometimes program names end in .bc, so strip them + if program_name.endswith('.bc'): + program_name = program_name[:-3] + self.programName = program_name + +# Event handling + +# Ugly hack to avoid race condtitons in the python gdb API + + +class Executor: + def __init__(self, cmd): + self.__cmd = cmd + + def __call__(self): + gdb.execute(self.__cmd) + + +""" +Every time a breakpoint is hit this function is executed +""" + + +def stop_event(evt): + global outputdata + global task_name + global priority + global file_name + + imm = gdb_bkpt_read() + if debug: + print("Debug: stop event in file {}".format(file_name)) + print("Debug: evt %r" % evt) + print("Debug: imm = {}".format(imm)) + + if imm == 0: + print("Ordinary breakpoint, exiting!") + sys.exit(1) + + elif imm == 1 or imm == 2: + try: + ceiling = int(gdb.parse_and_eval( + "ceiling").cast(gdb.lookup_type('u8'))) + except gdb.error: + print("No ceiling found, exciting!") + sys.exit(1) + + if imm == 1: + action = "Enter" + elif imm == 2: + action = "Exit" + + if debug: + print("Debug: Append action {} at cycle {}".format( + action, gdb_cyccnt_read())) + + outputdata.append( + [file_name, task_name, gdb_cyccnt_read(), ceiling, action]) + + gdb.post_event(Executor("continue")) + + elif imm == 3: + if debug: + print("Debug: found finish bkpt_3 at cycle {}" + .format(gdb_cyccnt_read())) + + gdb.post_event(Executor("si")) + + elif imm == 4: + if debug: + print("Debug: found finish bkpt_4 at cycle {}" + .format(gdb_cyccnt_read())) + + gdb.post_event(posted_event_init) + + else: + print("Unexpected stop event, exiting") + sys.exit(1) + + +""" Loads each defined task """ + + +def posted_event_init(): + if debug: + print("\nDebug: Entering posted_event_init") + + global tasks + global task_name + global file_name + global file_index_current + global file_list + global outputdata + global priority + global priorities + + if file_index_current < 0: + if debug: + print("Debug: Skipped first measurement") + + else: + if debug: + print("Debug: Append Finish action at cycle {}" + .format(gdb_cyccnt_read())) + + outputdata.append( + [file_name, task_name, gdb_cyccnt_read(), priority, "Finish"]) + + """ loop to skip to next task *omitting the dummy* """ + while True: + file_index_current += 1 + if file_index_current == len(file_list): + """ finished """ + break + + task_to_test = ktest_setdata(file_index_current) + if 0 <= task_to_test < len(tasks): + """ next """ + break + + if file_index_current < len(file_list): + """ Load the variable data """ + + if debug: + print("Debug: Task number to test {}".format(task_to_test)) + + """ + Before the call to the next task, reset the cycle counter + """ + gdb_cyccnt_reset() + + file_name = file_list[file_index_current].split('/')[-1] + task_name = tasks[task_to_test] + priority = priorities[task_to_test] + + outputdata.append([file_name, task_name, + gdb_cyccnt_read(), priority, "Start"]) + + print('Task to call: %s \n' % ( + tasks[task_to_test] + "()")) + gdb.execute('call %s' % "stub_" + + tasks[task_to_test] + "()") + + else: + """ here we are done, call your analysis here """ + offset = 1 + print("\nFinished all ktest files!\n") + print("Claims:") + for index, obj in enumerate(outputdata): + if obj[4] == "Exit": + claim_time = (obj[2] - + outputdata[index - (offset)][2]) + print("%s Claim time: %s" % (obj, claim_time)) + offset += 2 + elif obj[4] == "Finish" and not obj[2] == 0: + offset = 1 + tot_time = obj[2] + print("%s Total time: %s" % (obj, tot_time)) + else: + print("%s" % (obj)) + # comment out to prevent gdb from quit on finish, useful to debugging + gdb.execute("quit") + + +def trimZeros(str): + for i in range(len(str))[::-1]: + if str[i] != '\x00': + return str[:i + 1] + + return '' + + +def ktest_setdata(file_index): + """ + Substitute every variable found in ktest-file + """ + global file_list + global debug + + if debug: + print("Debug: ktest_setdata on index{}".format(file_index)) + + b = KTest.fromfile(file_list[file_index]) + + if debug: + # print('ktest filename : %r' % filename) + print('Debug: ktest file: %r \n' % file_list[file_index]) + # print('args : %r' % b.args) + # print('num objects: %r' % len(b.objects)) + for i, (name, data) in enumerate(b.objects): + str = trimZeros(data) + + """ If Name is "task", skip it """ + if name.decode('UTF-8') == "task": + if debug: + print('Debug: object %4d: name: %r' % (i, name)) + print('Debug: object %4d: size: %r' % (i, len(data))) + # print(struct.unpack('i', str).repr()) + # task_to_test = struct.unpack('i', str)[0] + # print("str: ", str) + # print("str: ", str[0]) + task_to_test = struct.unpack('i', str)[0] + # task_to_test = int(str[0]) + if debug: + print("Debug: Task to test:", task_to_test) + else: + if debug: + print('Debug: object %4d: name: %r' % (i, name)) + print('Degug: object %4d: size: %r' % (i, len(data))) + print(str) + # if opts.writeInts and len(data) == 4: + obj_data = struct.unpack('i', str)[0] + if debug: + print('Dubug: object %4d: data: %r' % + (i, obj_data)) + # gdb.execute('whatis %r' % name.decode('UTF-8')) + # gdb.execute('whatis %r' % obj_data) + gdb.execute('set variable %s = %r' % + (name.decode('UTF-8'), obj_data)) + # gdb.write('Variable %s is:' % name.decode('UTF-8')) + # gdb.execute('print %s' % name.decode('UTF-8')) + # else: + # print('object %4d: data: %r' % (i, str)) + + if debug: + print("Dubug: Done with setdata") + return task_to_test + + +def ktest_iterate(): + """ Get the list of folders in current directory, sort and then grab the + last one. + """ + global debug + global autobuild + + curdir = os.getcwd() + if debug: + print("Debug: Current directory {}".format(curdir)) + + rustoutputfolder = curdir + "/" + klee_out_folder + try: + os.chdir(rustoutputfolder) + except IOError: + print(rustoutputfolder + "not found. Need to run\n") + print("xargo build --example " + example_name + " --features" + + " klee_mode --target x86_64-unknown-linux-gnu ") + if autobuild: + xargo_run("klee") + klee_run() + else: + print("Run the above commands before proceeding") + sys.exit(1) + + if os.listdir(rustoutputfolder) == []: + """ + The folder is empty, generate some files + """ + xargo_run("klee") + klee_run() + + dirlist = next(os.walk("."))[1] + dirlist.sort() + if debug: + print(dirlist) + + if not dirlist: + print("No KLEE output, need to run KLEE") + print("Running klee...") + klee_run() + + """ Ran KLEE, need to update the dirlist """ + dirlist = next(os.walk("."))[1] + dirlist.sort() + try: + directory = dirlist[-1] + except IOError: + print("No KLEE output, need to run KLEE") + print("Running klee...") + klee_run() + + print("Using ktest-files from directory:\n" + rustoutputfolder + directory) + + """ Iterate over all files ending with ktest in the "klee-last" folder """ + for filename in os.listdir(directory): + if filename.endswith(".ktest"): + file_list.append(os.path.join(rustoutputfolder + directory, + filename)) + else: + continue + + file_list.sort() + """ Return to the old path """ + os.chdir(curdir) + return file_list + + +def tasklist_get(): + """ Parse the automatically generated tasklist + """ + + if debug: + print(os.getcwd()) + with open('klee/tasks.txt') as fin: + for line in fin: + # print(line) + if not line == "// autogenerated file\n": + return [x.strip().strip("[]\"").split(' ') + for x in line.split(',')] + + +""" Run xargo for building """ + + +def xargo_run(mode): + + if "klee" in mode: + xargo_cmd = ("xargo build --release --example " + example_name + + " --features " + + "klee_mode --target x86_64-unknown-linux-gnu ") + elif "stm" in mode: + xargo_cmd = ("xargo build --release --example " + example_name + + " --features " + + "wcet_bkpt --target thumbv7em-none-eabihf") + else: + print("Provide either 'klee' or 'stm' as mode") + sys.exit(1) + + call(xargo_cmd, shell=True) + + +""" Stub for running KLEE on the LLVM IR """ + + +def klee_run(): + global debug + global original_pwd + + PWD = original_pwd + + user_id = subprocess.check_output(['id', '-u']).decode() + group_id = subprocess.check_output(['id', '-g']).decode() + + bc_file = (glob.glob(PWD + "/" + + klee_out_folder + + '*.bc', recursive=False))[-1].split('/')[-1].strip( + '\'') + if debug: + print(PWD + "/" + klee_out_folder) + print(bc_file) + + klee_cmd = ("klee %s" % bc_file) + if debug: + print(klee_cmd) + call(klee_cmd, shell=True) + + +def gdb_cyccnt_enable(): + # Enable cyccnt + gdb.execute("mon mww 0xe0001000 1") + + +def gdb_cyccnt_disable(): + # Disble cyccnt + gdb.execute("mon mww 0xe0001000 0") + + +def gdb_cyccnt_reset(): + # Reset cycle counter to 0 + gdb.execute("mon mww 0xe0001004 0") + + +def gdb_cyccnt_read(): + # Read cycle counter + return int(gdb.execute("mon mdw 0xe0001004", False, True).strip( + '\n').strip('0xe000012004:').strip(',').strip(), 16) + + +def gdb_cyccnt_write(num): + # Write to cycle counter + gdb.execute('mon mww 0xe0001004 %r' % num) + + +def gdb_bkpt_read(): + # Read imm field of the current bkpt + try: + return int(gdb.execute("x/i $pc", False, True). + split("bkpt")[1].strip("\t").strip("\n"), 0) + except: + if debug: + print("Debug: It is not a bkpt so return 4") + return 4 + + +print("\n\n\nStarting script") + +"""Used for making GDB scriptable""" +gdb.execute("set confirm off") +gdb.execute("set pagination off") +gdb.execute("set verbose off") +gdb.execute("set height 0") + +""" +Setup GDB for remote debugging +""" +gdb.execute("target remote :3333") +gdb.execute("monitor arm semihosting enable") + +""" +Check if the user passed a file to use as the source. + +If a file is given, use this as the example_name +""" +if gdb.progspaces()[0].filename: + """ A filename was given on the gdb command line """ + example_name = gdb.progspaces()[0].filename.split('/')[-1] + print("The resource used for debugging: %s" % example_name) + try: + os.path.exists(gdb.progspaces()[0].filename) + except IOError: + """ Compiles the given example """ + xargo_run("stm") + xargo_run("klee") +else: + example_name = debug_file + print("Defaulting to example '%s' for debugging." % example_name) + try: + if example_name not in os.listdir(stm_out_folder): + """ Compiles the default example """ + xargo_run("stm") + xargo_run("klee") + except IOError: + """ Compiles the default example """ + xargo_run("stm") + xargo_run("klee") + +""" Tell GDB to load the file """ +gdb.execute("file %s" % (stm_out_folder + example_name)) +gdb.execute("load %s" % (stm_out_folder + example_name)) + +""" Tell gdb-dashboard to hide """ +# gdb.execute("dashboard -enabled off") +# gdb.execute("dashboard -output /dev/null") + +""" Enable the cycle counter """ +gdb_cyccnt_enable() +gdb_cyccnt_reset() + +""" Save all ktest files into an array """ +file_list = ktest_iterate() + +""" Get all the tasks to jump to """ +task_list = tasklist_get() + +if debug: + print("Debug: file_list {}".format(file_list)) + print("Debug: task_list {}".format(task_list)) + +""" Split into tasks and priorities """ +for x in task_list: + interarrival.append(x.pop()) + priorities.append(x.pop()) + tasks.append(x.pop()) + +print("Available tasks:") +for t in tasks: + print(t) + +print("At priorities:") +for t in priorities: + print(t) + +print("At interarrivals:") +for t in interarrival: + print(t) + +""" Subscribe stop_event_ignore to Breakpoint notifications """ +gdb.events.stop.connect(stop_event) + +""" + continue until bkpt 3, + this will pick the next task (through a posted_event_init event) +""" +gdb.execute("continue") + + +# Home exam, response time analysis +# +# Assignment 1. +# Run the example and study the output. +# you may need to run xargo clean first +# +# It generates `output data`, a list of list, something like: +# Finished all ktest files! +# Claims: +# ['test000002.ktest', 'EXTI1', 0, '1', 'Start'] +# ['test000002.ktest', 'EXTI1', 15, 2, 'Enter'] +# ['test000002.ktest', 'EXTI1', 19, 3, 'Enter'] +# ['test000002.ktest', 'EXTI1', 28, 3, 'Exit'] Claim time: 9 +# ['test000002.ktest', 'EXTI1', 29, 2, 'Exit'] Claim time: 14 +# ['test000002.ktest', 'EXTI1', 36, '1', 'Finish'] Total time: 36 +# ['test000003.ktest', 'EXTI3', 0, '2', 'Start'] +# ['test000003.ktest', 'EXTI3', 8, '2', 'Finish'] Total time: 8 +# ['test000004.ktest', 'EXTI2', 0, '3', 'Start'] +# ['test000004.ktest', 'EXTI2', 11, '3', 'Finish'] Total time: 11 +# ['test000005.ktest', 'EXTI1', 0, '1', 'Start'] +# ['test000005.ktest', 'EXTI1', 15, 2, 'Enter'] +# ['test000005.ktest', 'EXTI1', 19, 3, 'Enter'] +# ['test000005.ktest', 'EXTI1', 29, 3, 'Exit'] Claim time: 10 +# ['test000005.ktest', 'EXTI1', 30, 2, 'Exit'] Claim time: 15 +# ['test000005.ktest', 'EXTI1', 37, '1', 'Finish'] Total time: 37 +# +# test000001.ktest is a dummy task and skipped +# ['test000002.ktest', 'EXTI1', 0, 1, 'Start'] +# ['test000002.ktest', 'EXTI2', 15, 2, 'Enter'] +# +# broken down, the first measurement +# -'test000002.ktest' the ktest file +# -'EXTI1' the task +# -'0' the time stamp (start from zero) +# -'1' the threshold (priority 1) +# -'Start' the 'Start' event +# +# broken down, the second measurement +# -'test000002.ktest' the ktest file +# -'EXTI1' the task +# -'15' the time stamp of the 'Enter' +# -'2' the threshold (ceiling 2) of X +# -'Enter' the 'Enter' event +# +# after 19 cycles we clam Y, raising threshold to 3 +# after 28 cycles we exit the Y claim, threshold 3 *before unlock Y* +# after 29 cycles we exit the X claim, threshold 2 *before unlock X* +# and finally we finish at 36 clock cycles +# +# The differences to the hand made measurements are due to details +# of the gdb integration regarding the return behavior. +# +# Verify that you can repeat the experiment. +# The order of tasks/test and cycles may differ but it should look similar. +# Two tests for EXTI1 and one for EXTI2 and one for EXTI3 +# +# Try follow what is going on in the test bed. +# +# +# Assignment 2. +# +# The vector +# interarrival = [100, 30, 40] +# should match the arrival time of EXTI1, EXTI2, and EXTI3 respectively +# you may need to change the order depending or your klee/tasks.txt file +# (in the future interarrival and deadlines will be in the RTFM model, +# but for now we introduce them by hand) +# +# Implement function that takes output data and computes the CPU demand +# (total utilization factor) Up of +# http://www.di.unito.it/~bini/publications/2003BinButBut.pdf +# +# For this example it should be +# EXTI1 = 37/100 +# EXTI2 = 11/30 +# EXTI3 = 8/40 +# ------------ +# sum = 0.93666 +# So we are inside the total utilization bound <1 +# +# Your implementation should be generic though +# Looking up the WCETs from the `output_data`. +# (It may be a good idea to make first pass and extract wcet per task) +# +# The total utilisation bound allows us to discard task sets that are +# obviously illegal (not the case here though) +# +# Assignment 3. +# +# Under SRP response time can be computed by equation 7.22 from +# https://doc.lagout.org/science/0_Computer%20Science/2_Algorithms/Hard%20Real-Time%20Computing%20Systems_%20Predictable%20Scheduling%20Algorithms%20and%20Applications%20%283rd%20ed.%29%20%5BButtazzo%202011-09-15%5D.pdf +# +# In general the response time is computed as. +# Ri = Ci + Bi + Ii +# Ci the WCET of task i +# Bi the blocking time task i is exposed to +# Ii the interference (preemptions) task is exposed to +# +# where +# Pi the priority of task i +# Ai the interarrival of task i +# +# We assign deadline = interarrival and priorities inverse to deadline +# (rate monotonic assignment, with fixed/static priorities) +# +# Lets start by looking at EXTI2 with the highest priority, +# so no interference (preemption) +# R_EXTI2 = 11 + B_EXTI2 + 0 +# +# In general Bi is the max time of any lower priority task +# (EXTI1, EXTI3 in our case) +# holds a resource with a ceiling > Pi (ceiling >= 3 in this case) +# B_EXTI2 = 10 (EXTI1 holding Y for 10 cycles) +# +# Notice 1, single blocking, we can only be blocked ONCE, +# so bound priority inversion +# +# Notice 2, `output_data` does not hold info on WHAT exact resource is held +# merely timestamp information on each Enter/Exit and associated level. +# This is however sufficient for the analysis. +# +# so +# R_EXTI2 = 11 + 10 = 21, well below our 30 cycle margin +# +# Let's look at EXTI3, our mid prio task. +# R_EXTI3 = C_EXTI3 + B_EXTI3 + I_EXTI3 +# where I_EXTI3 is the interference (preemptions) +# +# Here we can undertake a simple approach to start out. +# Assuming a deadline equal to our interarrival (40) +# I_EXTI3 is the sum of ALL preemptions until its deadline. +# in this case EXTI2 can preempt us 2 times (40/30 *rounded upwards*) +# I_EXTI3 = 2 * 11 +# +# The worst case blocking time is 15 +# (caused by the lower prio task EXTI1 holding X) +# R_EXTI3 = 8 + 2 * 11 + 15 = 45, already here we see that +# EXTI2 may miss our deadline (40) +# +# EXTI1 (our lowest prio task) +# R_EXTI1 = C_EXTI1 + B_EXTI1 + I_EXTI1 +# +# Here we cannot be blocked (as we have the lowest prio) +# I_EXTI1 is the sum of preemptions from EXTI2 and EXTI3 +# our deadline = interarrival is 100 +# we are exposed to 100/30 = 4 (rounded upwards) preemptions by EXTI2 +# and 100/40 = 3 (rounded upwards) preemptions by EXTI3 +# +# I_EXTI1 = 37 + 4 * 11 + 3 * 8 = 105 +# +# Ouch, even though we had only a WCET of 37 we might miss our deadline. +# However we might have overestimated the problem. +# +# Implement the algorithm in a generic manner +# Verify that that the results are correct by hand computation (or make an Excel) +# +# Assignment 4. +# +# Looking closer at 7.22 we see that its a recurrent equation. +# Ri(0) indicating the initial value +# Ri(0) = Ci + Bi +# while +# Ri(s) = Ci + Bi + sum ..(Ri(s-1)).. +# so Ri(1) is computed from Ri(0) and so forth, +# this requires a recursive or looping implementation. +# +# One can see that as initially setting a "busy period" to Ci+Bi +# and compute a new (longer) "busy period" by taking into account preemptions. +# +# Termination: +# Either Ri(s) = Ri(s-1), we have a fixpoint and have the exact response time +# or we hit Ri(s) > Ai, we have missed our deadline +# +# Your final assignment is to implement the exact method. +# +# Notice, we have not dealt with the case where tasks have equal priorities +# in theory this is not a problem (no special case needed) +# +# However, for exactly analysing the taskset as it would run on the +# real hardware requires some (minor) modifications. +# *Not part of this assignment* +# +# Examination for full score. +# Make a git repo of your solution. (With reasonable comments) +# +# It should be possible to compile and run, and for the example +# Print utilization according to Assignment 2 +# Print response times according to Assignment 3 +# Print response times according to Assignment 4 +# +# It should work with different assignments of the interarrival vector. +# test it also for +# [100, 40, 50] +# [80, 30, 40] +# (Verify that your results are correct by hand computations) +# +# Grading +# For this part 1/3 of the exam 35 points +# Assignment 2, 10 points +# Assignment 3, 10 points +# Assignment 4, 15 points +# +# To make sure the analysis works in the general case +# you can make further examles based on 'resource.rs' +# +# Notice, KLEE analysis does not work on hardware peripherals +# (this is not yet supported), so your new examples must NOT access +# any peripherals. +# +# HINTS +# You may start by cut and paste the output (table) to a file 'x.py' +# +# Implement the analysis in a seprate python file 'x.py' +# (reconstruct the 'outputdata' from the table) +# +# When you have your analysis working, +# integrate it in this script (operating on the real 'outputdata') +# +# diff --git a/ktest/src/README.md b/ktest/src/README.md new file mode 100644 index 0000000..e9f6710 --- /dev/null +++ b/ktest/src/README.md @@ -0,0 +1,3 @@ +# ktest + +Tool to read ktest files diff --git a/ktest/src/main.rs b/ktest/src/main.rs new file mode 100644 index 0000000..6da5c0a --- /dev/null +++ b/ktest/src/main.rs @@ -0,0 +1,78 @@ +use std::fs::File; +use std::io::prelude::*; // provide io traits +use std::io::{Error, ErrorKind}; + +fn main() -> std::io::Result<()> { + let ktest = read_ktest("test000001.ktest"); + println!("{:?}", ktest); + Ok(()) +} + +#[derive(Debug)] +struct KTEST { + version: i32, + args: Vec<String>, + objects: Vec<(String, Vec<u8>)>, +} + +fn read_ktest(file_name: &str) -> std::io::Result<KTEST> { + let mut file: File = File::open(file_name)?; + let mut hdr = [0u8; 5]; + file.read_exact(&mut hdr)?; + if &hdr != b"KTEST" { + return Err(Error::new(ErrorKind::Other, "not a KTEST file")); + } + + let version = read_i32(&mut file)?; + println!("version : {}", version); + if version > 3 { + return Err(Error::new(ErrorKind::Other, "non support KTEST version")); + } + + let num_args = read_i32(&mut file)?; + + // info regarding the KTEST file + let mut args = vec![]; + for _ in 0..num_args { + let arg = read_sized(&mut file)?; + let str = String::from_utf8(arg).unwrap(); + args.push(str); + } + + // metadata not used here + let _sym_argvs = read_i32(&mut file)?; + let _sym_argv_len = read_i32(&mut file)?; + + // read the objects + let num_objects = read_i32(&mut file)?; + let mut objects = vec![]; + for _ in 0..num_objects { + let name = read_string(&mut file)?; + let data = read_sized(&mut file)?; + objects.push((name, data)) + } + + Ok(KTEST { + version, + args, + objects, + }) +} + +fn read_i32(file: &mut File) -> std::io::Result<i32> { + let mut str = [0u8; 4]; + file.read_exact(&mut str)?; + Ok(i32::from_be_bytes(str)) // big endian +} + +fn read_string(file: &mut File) -> std::io::Result<String> { + let str = read_sized(file)?; + Ok(String::from_utf8(str).unwrap()) +} + +fn read_sized(file: &mut File) -> std::io::Result<Vec<u8>> { + let size = read_i32(file)?; + let mut buf = vec![0u8; size as usize]; + file.read_exact(&mut buf)?; + Ok(buf) +} diff --git a/ktest/test000001.ktest b/ktest/test000001.ktest new file mode 100644 index 0000000000000000000000000000000000000000..e0675e4eaf2e957beb5b60306e08631bf34cad67 GIT binary patch literal 140 zcmeYcaSaY(U|?WoU|?WmU|@*T&&bbB)i21&(=RG5F3~Rmk(nj>**U4Hx~Ub3xdl0? z#rh?QMd_&}`bDWZsfop@`f%~0)bz~alGLL3lGNf7-P9Dbl+>hDLz6_q<P-}F3%#5i S1_S`v##)w~3KnDmi30%2T_-gF literal 0 HcmV?d00001 diff --git a/runner/Cargo.lock b/runner/Cargo.lock new file mode 100644 index 0000000..748645e --- /dev/null +++ b/runner/Cargo.lock @@ -0,0 +1,732 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adler32" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "arrayvec" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "odds 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bit-set" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bit-vec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitfield" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "capstone" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "capstone-sys 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "capstone-sys" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cc" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "colored" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crc32fast" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "derivative" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dtoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "dyn-clone" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "enum-primitive-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "filetime" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "flate2" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gimli" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "fallible-iterator 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "goblin" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scroll 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hermit-abi" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hexdump" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hidapi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ihex" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "indexmap" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itertools" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "jep106" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.66" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libflate" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rle-decode-fast 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libusb1-sys" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "libflate 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "miniz_oxide" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "object" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "goblin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "scroll 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "odds" +version = "0.2.26" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "parity-wasm" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pkg-config" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "probe-rs" +version = "0.3.0" +dependencies = [ + "bitfield 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", + "capstone 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "colored 1.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "dyn-clone 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "enum-primitive-derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gimli 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", + "goblin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "hexdump 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hidapi 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ihex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "jep106 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "object 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "probe-rs-t2rust 0.1.0", + "rental 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rusb 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "scroll 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "probe-rs-t2rust" +version = "0.1.0" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_syscall" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rental" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rental-impl 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rental-impl" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rle-decode-fast" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "runner" +version = "0.1.0" +dependencies = [ + "probe-rs 0.3.0", +] + +[[package]] +name = "rusb" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bit-set 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "libusb1-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scroll" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "scroll_derive 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scroll_derive" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_yaml" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "syn" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "synom" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "tar" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "target-lexicon" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "uuid" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "vcpkg" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "xattr" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "yaml-rust" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[metadata] +"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" +"checksum arrayvec 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)" = "06f59fe10306bb78facd90d28c2038ad23ffaaefa85bac43c8a434cde383334f" +"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum bit-set 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e84c238982c4b1e1ee668d136c510c67a13465279c0cb367ea6baf6310620a80" +"checksum bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" +"checksum bitfield 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" +"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum capstone 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "031ba51c39151a1d6336ec859646153187204b0147c7b3f6fe2de636f1b8dbb3" +"checksum capstone-sys 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fae25eddcb80e24f98c35952c37a91ff7f8d0f60dbbdafb9763e8d5cc566b8d7" +"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum colored 1.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8815e2ab78f3a59928fc32e141fbeece88320a240e43f47b2fd64ea3a88a5b3d" +"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +"checksum derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "942ca430eef7a3806595a6737bc388bf51adb888d3fc0dd1b50f1c170167ee3a" +"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" +"checksum dyn-clone 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3ec9c7fb9a2ce708751c98e31ccbae74b6ab194f5c8e30cfb7ed62e38b70866" +"checksum enum-primitive-derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b90e520ec62c1864c8c78d637acbfe8baf5f63240f2fb8165b8325c07812dd" +"checksum fallible-iterator 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +"checksum filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" +"checksum flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" +"checksum gimli 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "162d18ae5f2e3b90a993d202f1ba17a5633c2484426f8bcae201f86194bacd00" +"checksum goblin 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3081214398d39e4bd7f2c1975f0488ed04614ffdd976c6fc7a0708278552c0da" +"checksum hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772" +"checksum hexdump 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "850f3f2c33d20c0f96c4485e087dd580ff041d720988ebf4c84a42acf739262b" +"checksum hidapi 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44780b6eb6a4209b4f212193af3f40e4163302e26c3753abe688f54c0e39380f" +"checksum ihex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9394ec1fbc3afbdfb357ba267a7fffdc39f6e3d8ba88c0af6d9476e6d3c889d5" +"checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" +"checksum itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "c4a9b56eb56058f43dc66e58f40a214b2ccbc9f3df51861b63d51dec7b65bc3f" +"checksum jep106 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f57cd08ee4fbc8043949150a59e34ea5f2afeb172f875db9607689e48600c653" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" +"checksum libflate 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)" = "d9135df43b1f5d0e333385cb6e7897ecd1a43d7d11b91ac003f4d2c2d2401fdd" +"checksum libusb1-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "32d20b6c0f54a2419b6081866f7821b89eb289ca248f92e049190a10f1fada44" +"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" +"checksum miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625" +"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" +"checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +"checksum object 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea44a4fd660ab0f38434934ca0212e90fbeaaee54126ef20a3451c30c95bafae" +"checksum odds 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "4eae0151b9dacf24fcc170d9995e511669a082856a91f958a2fe380bfab3fb22" +"checksum parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" +"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +"checksum plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +"checksum proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc" +"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" +"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" +"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +"checksum rental 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f" +"checksum rental-impl 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de" +"checksum rle-decode-fast 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac" +"checksum rusb 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9c1c7856ddc8f77d741a288176e6c10586c4ac7c56637d33948a7362150a4a26" +"checksum scroll 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "abb2332cb595d33f7edd5700f4cbf94892e680c7f0ae56adab58a35190b66cb1" +"checksum scroll_derive 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8584eea9b9ff42825b46faf46a8c24d2cff13ec152fa2a50df788b87c07ee28" +"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +"checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" +"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" +"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +"checksum syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4ff033220a41d1a57d8125eab57bf5263783dfdcc18688b1dacc6ce9651ef8" +"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" +"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +"checksum tar 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)" = "b3196bfbffbba3e57481b6ea32249fbaf590396a52505a2615adbb79d9d826d3" +"checksum target-lexicon 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" +"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" +"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" +"checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" +"checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" diff --git a/runner/Cargo.toml b/runner/Cargo.toml new file mode 100644 index 0000000..c6edcae --- /dev/null +++ b/runner/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "runner" +version = "0.1.0" +authors = ["Per Lindgren <per.lindgren@ltu.se>"] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +probe-rs = { path = "../../probe-rs/probe-rs", version = "0.3.0" } +ktest = { path = "../probe-rs/probe-rs", version = "0.3.0" } \ No newline at end of file diff --git a/runner/src/main.rs b/runner/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/runner/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} -- GitLab