Git Product home page Git Product logo

gtcasl / qsim Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 17.0 2.65 MB

QEMU based emulation library for micro-architectural simulation (ARM64 and x86)

Home Page: http://manifold.gatech.edu/projects/qsim-a-multicore-emulator/

License: GNU General Public License v2.0

Makefile 1.76% Shell 2.09% C++ 33.01% Batchfile 0.20% Python 0.71% C 47.03% HTML 14.63% Lex 0.57%
architecture arm64 simulation x86-64

qsim's People

Contributors

b-bimmermann avatar cdkersey avatar nageshbl avatar ndesh26 avatar pranith avatar sixshotx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qsim's Issues

qsim->run() now ignores cpu_id

Just put it up here for discussion The qsim->run(cpu_id, n) will always execute on cpu 0 as there is only one qemu instance for all cores. It is a big impact on the spx frontend to fetch instruction and communicate with qsim though.

arm64 initrd problem

The busybox makefile uses "qemu-aarch64" to generate the cpio file, which might not be installed in the system.

Segmentation fault in qtm example

'qtm' example in qsim/examples/x86/ gives a segmentation fault at a pthread_cond_wait from Qemu code (qemu_cond_wait at qemu/util/qemu-thread-posix.c).

Simulation hangs on "make tests"

The newest version (v2.6) of QSim irregularly hangs on the middle of "make tests".
I'm using Amazon EC2's c3.2xlarge instance with Ubuntu-14.04 LTS AMI.

When I run "./sudo_setup.sh", the script hangs at the line "make tests"
after stdout "Copying benchmark binary...".

I debugged it a little, and found that it hangs after the last magic callback with "0xc75c0020", which indicates the context switch (?).

Could you let me know what was wrong?

QSim v2.3.2 built failed

The setup.sh script removes the dependency check for qemu, and thus it is needed to use "git submodule --init --recursive" command to include all possible libraries inside qemu directory.

Add a shutdown/reboot callback

It is useful in an interactive environment to know when the system shutdown/reboot happens to cleanly close resources like open trace files.

qsim->booted not function as previous

manifold used to use booted() to determine whether qsim completes an application as follow:
if(!qsim_osd->booted(core_id)) {
queue_item.cb_type = Qsim::QueueItem::TERMINATED;
}

The current version does not update running[i] as before, so an app_end callback is needed in spx to exit the loop.

qsim execution results depend on the run() granularity.

Let INST be the number of instructions passed to osd.run(). Take barnes.tar for example in a 4-core configuration. When INST < ~5000, a maximum of 2 cores are assigned to barnes, while when INST > 5000, all the 4 cores are active.

[suggestion] make a base virtual class for QueueItem

Pranith and I have a discussion on how manifold manipulates the queueItem for spx component. Pranith suggested me to create a NEW queueItem inside the manifold and leave original one in qsim unchanged. Yet the existing implementation of queueItem uses "struct", which is hard to extend/add new members/functions by the wrappers. I have to duplicate the queueItem and add new modifications on top of it, kind of ugly. I think we need to rethink how to implement queueItem in a more effective way, say virtual base class.

aarch64 test failed on memory.tar

command line:
./tester 1 ../state.1.a64 arm64/memory.tar

qemu output:
bling callback generation for pid 37.
[ 7.900271 ] memory[37]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x90000006
[ 7.914421 ] pgd = ffffffc0198dc000
[ 7.917219 ] [00000000] *pgd=00000000598de003, *pud=00000000598de003, *pmd=0000000000000000
[ 7.925618 ]
[ 7.928301 ] CPU: 0 PID: 37 Comm: memory Not tainted 4.1.15 #2
[ 7.930261 ] Hardware name: linux,dummy-virt (DT)
[ 7.935133 ] task: ffffffc008cbb000 ti: ffffffc0198f0000 task.ti: ffffffc0198f0000
[ 7.939697 ] pc : [<00000000004009f4>] lr : [<00000000004009ec>] pstate: 60000000
[ 7.945314 ] sp : 0000007fc452b690
[ 7.947019 ] x29: 0000007fc452b690 x28: 0000000000000000
[ 7.950862 ] x27: 0000000000000000 x26: 0000000000000000
[ 7.957142 ] x25: 0000000000000000 x24: 00000000004001a0
[ 7.960651 ] x23: 0000000000000000 x22: 00000000004920d8
[ 7.964208 ] x21: 0000000000492020 x20: 0000000000000000
[ 7.968416 ] x19: 00000000004001a0 x18: 0000000000000000
[ 7.974541 ] x17: 000000000055b000 x16: 0000000000560000
[ 7.979257 ] x15: 0000000000560000 x14: 000000000055a758
[ 7.984332 ] x13: ffffff0000000000 x12: 000000000055d5a0
[ 7.988900 ] x11: 0000000000000003 x10: 0101010101010101
[ 7.995098 ] x9 : 0000000000000001 x8 : 000000000000001c
[ 7.997843 ] x7 : 0000007fc452b578 x6 : 000000000055d800
[ 8.003978 ] x5 : 0000000000000003 x4 : 0000000012078620
[ 8.008771 ] x3 : 0000000012078610 x2 : 0000000000000000
[ 8.014221 ] x1 : 0000000012078610 x0 : 00000000aaaaaaaa
[ 8.018137 ]
Segmentation fault
--- program exit, will shutdown shortly... ---
QEMU: Terminated

Linux patch got rejection

The patch file generates a rej file for kernel/sched/core.c.rej. Might causes OS problem for idle() test.

--- kernel/sched/core.c
+++ kernel/sched/core.c
@@ -2312,7 +2322,15 @@ context_switch(struct rq *rq, struct task_struct *prev,
 {
 	struct mm_struct *mm, *oldmm;
 
+	/* tell qsim the pid of the next task or that it is idle
+	 */
+	if (IS_ENABLED(CONFIG_X86) || IS_ENABLED(CONFIG_ARM64)) {
+		if (next == rq->idle)
+			do_cpuid(0x1d1e1d1e);
+		else
+			do_cpuid(0xc75c0000 | (u16)task_tgid_nr(next));
+	}
+
 	prepare_task_switch(rq, prev, next);
 
 	mm = next->mm;
-- 

Test qsim on Mac OS X

The only blocker is having a cross compiler for ARM64. Clang natively supports cross compilation, investigate that.

missing callbacks

using the tester framework, I observed some of the mem_cbs and reg_cbs are missing. Need further investigation.

Upgrade qemu component from 2.4 -> 2.5

Upstream qemu has release version 2.5 in december. This is relevant to qsim since there are quite a few fixes for deterministic execution in qemu. Plan to upgrade to 2.5 version.

change the arm64 ending reg name.

To keep naming consistency, the QSIM_ARM64_ENDING in qsim-arm64-regs.h should be renamed to QSIM_A64_N_REGS according to qsim-x86-regs.h. Same applied to qsim-arm-regs.h.

pids not reported in interactive mode

When running an application in interactive mode, the get_tid function always returns 0. This is due to the use of unmodified kernel in the x86_64 image.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.