Commit Graph

6 Commits

Author SHA1 Message Date
Vic Yang
cdcaf6ed8a Add interrupt support for emulator
This provides us a way to inject interrupts during a test. If a test has
interrupt_generator() defined, it will run in a separate thread. The
generator can then trigger interrupts when it decides to. The current
running task is suspended while emulator is executing ISR.

Also fixes a bug that tasks run without scheduler notifying them during
emulator start-up.

BUG=chrome-os-partner:19235
TEST=Repeatedly run all tests.
BRANCH=None

Change-Id: I0f921c47c0f848a9626da6272d9040e2b7c5ac86
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/55671
2014-01-06 12:40:45 +00:00
Vic Yang
b702babbb7 Fix reset flags and sysjump time for emulator
Reset flags should be set properly according to reset type. Also, on
system jump, current time should be preserved.

BUG=chrome-os-partner:19235
TEST='sysjump rw' and check time is the same.
TEST='reboot hard' and see '[Reset cause: hard]'
BRANCH=None

Change-Id: I00fd2c652d10c237f23cc6a33e0b667422bc625d
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62958
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-07-23 16:06:24 -07:00
Vic Yang
ce9d7ca9e9 Revert "Revert "Scale timer for emulator""
This reverts commit c58c01b14c.

Let's add time scaling back, but keep the default scale to 1. The
emulator behavior should be entirely the same. If a test need to be
speeded up, the scale can then be set for that test only.

BUG=chrome-os-partner:19235
TEST=Pass all tests.
BRANCH=None

Change-Id: I648780577a1ae2f964c30c71077ccf9bf38b9735
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/51550
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-05-17 09:52:25 -07:00
Vic Yang
c58c01b14c Revert "Scale timer for emulator"
This is causing instability on buildbot. Let's revert until we can make it more stable.

This reverts commit 3615ac4c0b

Change-Id: I0bd65832cc3706a24284ada80e2fb5102fa705cf
Reviewed-on: https://gerrit.chromium.org/gerrit/51479
Commit-Queue: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-05-16 10:08:22 -07:00
Vic Yang
3615ac4c0b Scale timer for emulator
The timer is the only source of timing for the emulator. This means we
can make it go faster without breaking the tests. This CL sets the
default scale to be 3x faster than normal time.

BUG=chrome-os-partner:19235
TEST=Pass all tests. Check the tests run faster.
BRANCH=None

Change-Id: Ib9035884b34f41c4e9aa2206284b5f1ec8fc0d1f
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50956
2013-05-14 00:31:40 -07:00
Vic Yang
0a45fa1708 Pthread-based emulator for unit testing
This is the first version of pthread-based RTOS emulator. With this, we
will be able to test high-level modules entirely on the host machine.

BUG=chrome-os-partner:19325
TEST='make runtests' and see tests passing.
BRANCH=None

Change-Id: I1f5fcd76aa84bdb46c7d35c5e60ae5d92fd3a319
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49954
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-05-07 09:09:50 -07:00