Statistics
| Branch: | Revision:

root / target-xtensa @ 93148aa5

# Date Author Comment
5a30d3f1 03/03/2012 07:59 pm Blue Swirl

Merge branch 'upstream' of git://qemu.weilnetz.de/qemu

  • 'upstream' of git://qemu.weilnetz.de/qemu:
    Move definition of HOST_LONG_BITS to qemu-common.h
    target-xtensa: Clean includes
    target-unicore32: Clean includes
    target-sh4: Clean includes
    target-s390x: Clean includes...
2ad5201c 02/28/2012 11:33 pm Stefan Weil

target-xtensa: Clean includes

Remove some include statements which are not needed.

Acked-by: Max Filippov <>
Signed-off-by: Stefan Weil <>

f14c4b5f 02/20/2012 06:07 pm Max Filippov

target-xtensa: add DBREAK data breakpoints

Add DBREAKA/DBREAKC SRs and implement DBREAK breakpoints as debug
watchpoints.

This implementation is not fully compliant to ISA: when a breakpoint is
set to an unmapped/inaccessible memory address it generates TLB/memory...

18da9326 02/20/2012 06:07 pm Max Filippov

target-xtensa: add DEBUG_SECTION to overlay tool

Fill debug configuration from overlay definitions in the DEBUG_SECTION.
Add DEBUG_SECTION to DC232B and FSF cores.

Signed-off-by: Max Filippov <>

35b5c044 02/18/2012 12:55 pm Max Filippov

target-xtensa: add ICOUNT SR and debug exception

ICOUNT SR gets incremented on every instruction completion provided that
CINTLEVEL at the beginning of the instruction execution is lower than
ICOUNTLEVEL.

When ICOUNT would increment to 0 a debug exception is raised if...

ab58c5b4 02/18/2012 12:55 pm Max Filippov

target-xtensa: add DEBUGCAUSE SR and configuration

DEBUGCAUSE SR holds information about the most recent debug exception.
See ISA, 4.7.7 for more details.

Signed-off-by: Max Filippov <>

e61dc8f7 02/18/2012 12:55 pm Max Filippov

target-xtensa: implement instruction breakpoints

Add IBREAKA/IBREAKENABLE SRs and implement debug exception, BREAK and
BREAK.N instructions and IBREAK breakpoints.

IBREAK breakpoint address is considered constant for TB lifetime.
On IBREAKA/IBREAKENABLE change corresponding TBs are invalidated....

692f737c 02/17/2012 11:25 pm Max Filippov

target-xtensa: implement info tlb monitor command

Command dumps valid ITLB and DTLB entries.

Signed-off-by: Max Filippov <>

a044ec2a 02/17/2012 11:25 pm Max Filippov

target-xtensa: fetch 3rd opcode byte only when needed

According to ISA, 3.5.4, third opcode byte should not be fetched for
2-byte instructions.

Signed-off-by: Max Filippov <>

b96ac3e4 02/17/2012 11:25 pm Max Filippov

target-xtensa: define TLB_TEMPLATE for MMU-less cores

TLB_TEMPLATE macro specifies TLB geometry in the core configuration.
Make TLB_TEMPLATE available for region protection core variants,
defining 1 way ITLB and DTLB with 8 entries each.

Signed-off-by: Max Filippov <>

0fdd2e1d 11/26/2011 11:44 am Max Filippov

target-xtensa: fix MMUv3 initialization

- ITLB/DTLB ways 5 and 6 have 4 and 8 entries respectively;
- ITLB/DTLB way 6 attr field is set to 3 on reset.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

0c852e17 11/02/2011 03:05 am Max Filippov

target-xtensa: handle cache options in the overlay tool

Cache options must be enabled for the cores that have cache to avoid
illegal instruction exceptions.

Signed-off-by: Max Filippov <>

6b814719 11/02/2011 03:05 am Max Filippov

target-xtensa: raise an exception for invalid and reserved opcodes

This includes opcodes from disabled features and those marked reserved in the ISA.
Also end TB on opcodes that definitely generate an exception: illegal
instructions, syscall and privileged instructions....

53a72dfd 11/02/2011 03:05 am Max Filippov

target-xtensa: mask out undefined bits of WINDOWSTART SR

According to ISA, table 5-156, bits 32:NAREG/4 of the WINDOWSTART SR
must be zero.

Signed-off-by: Max Filippov <>

935f7a2b 10/16/2011 01:40 pm Max Filippov

target-xtensa: add fsf core

This is FSF big endian core implemented through linux overlay.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

53add759 10/16/2011 01:40 pm Max Filippov

target-xtensa: add dc232b core

This is Diamond 232L Standard Core Rev.B (LE), implemented through
linux/gdb overlay.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

ac8b7db4 10/16/2011 01:39 pm Max Filippov

target-xtensa: extract core configuration from overlay

Introduce overlay_tool.h that defines core configuration blocks from
data available in the linux architecture variant overlay.

Overlay data is automatically generated in the core configuration
process by Tensilica tools and can be directly converted to qemu xtensa...

b8929a54 10/16/2011 01:39 pm Max Filippov

target-xtensa: implement external interrupt mapping

Xtensa cores may have different mapping of external interrupt pins to
internal IRQ numers. Implement API to acquire core IRQ by its external
interrupt number.

Signed-off-by: Max Filippov <>...

63f95e4c 10/16/2011 01:39 pm Max Filippov

target-xtensa: remove hand-written xtensa cores implementations

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

7f65f4b0 10/16/2011 01:39 pm Max Filippov

target-xtensa: increase xtensa options accuracy

- add separate options for each operation in the MISC_OP;
- add an option for MULSH/MULUH;
- put S32C1I under conditional store option.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

6825b6c3 10/16/2011 12:03 am Max Filippov

target-xtensa: implement MAC16 option

See ISA, 4.3.7 for the details.

- add ACC and MR special registers;
- implement MAC16 and all inner MAC* opcode groups.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

890c6333 10/16/2011 12:03 am Max Filippov

target-xtensa: fix guest hang on masked CCOMPARE interrupt

QEMU timer is used to post CCOMPARE interrupt when the core is halted.
If that CCOMPARE interrupt is masked off then the timer must be rearmed
in the callback, otherwise it will be rearmed next time the core goes to...

bccd9ec5 10/01/2011 12:31 pm Blue Swirl

softmmu_header: pass CPUState to tlb_fill

Pass CPUState pointer to tlb_fill() instead of architecture local
cpu_single_env hacks.

Signed-off-by: Blue Swirl <>

97836cee 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement relocatable vectors

See ISA, 4.4.3 for details.

Vector addresses recorded in core configuration are absolute values that
correspond to default VECBASE value.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

ccfcaba6 09/10/2011 07:57 pm Max Filippov

target-xtensa: add gdb support

Specific xtensa processor overlay for GDB contains register map in
the gdb/xtensa-config.c. This description is used by the GDB to e.g.
parse 'g' response packets and it may be reused in the qemu's gdbstub
(only XTREG definitions for non-pseudoregisters are needed)....

b67ea0cd 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement memory protection options

- TLB opcode group;
- region protection option (ISA, 4.6.3);
- region translation option (ISA, 4.6.4);
- MMU option (ISA, 4.6.5).

Cache control attribute bits are not used by this implementation.

Signed-off-by: Max Filippov <>...

4dd85b6b 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement boolean option

See ISA, 4.3.9

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

47d05a86 09/10/2011 07:57 pm Max Filippov

target-xtensa: add dc232b core and board

This is Diamond 232L Standard Core Rev.B (LE).

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

553e44f9 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement windowed registers

See ISA, 4.7.1 for details.

Physical registers and currently visible window are separate fields in
CPUEnv. Only current window is accessible to TCG. On operations that
change window base helpers copy current window to and from physical...

797d780b 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement loop option

See ISA, 4.3.2 for details.

Operations that change LEND SR value invalidate TBs at the old and at
the new LEND. LEND value at TB compilation time is considered constant
and loop instruction is generated based on this value....

6ad6dbf7 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement extended L32R

See ISA, 4.3.3 for details.

TB flag XTENSA_TBFLAG_LITBASE is used to track enable bit of LITBASE SR.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

5b4e481b 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement unaligned exception option

See ISA, 4.4.4 for details.

Correct (aligned as per ISA) address for unaligned access is generated
in case this option is not enabled.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

1ddeaa5d 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement SIMCALL

Tensilica iss provides support for applications running in freestanding
environment through SIMCALL command. It is used by Tensilica libc to
access argc/argv, for file I/O, etc.

Note that simcalls that accept buffer addresses expect virtual addresses....

b994e91b 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement interrupt option

See ISA, 4.4.6 (interrupt option), 4.4.7 (high priority interrupt
option) and 4.4.8 (timer interrupt option) for details.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

772177c1 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement accurate window check

See ISA, 4.7.1.3 for details.

Window check is inserted before commands that push "used register
watermark" beyond its current level. Used register watermark is reset on
instructions that change WINDOW_BASE/WINDOW_START SRs....

f3df4c04 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement CPENABLE and PRID SRs

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

b8132eff 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement RST3 group

- access to Special Registers (wsr, rsr);
- access to User Registers (wur, rur);
- misc. operations option (value clamp, sign extension, min, max);
- conditional moves.

Signed-off-by: Max Filippov <>...

3580ecad 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement shifts (ST1 and RST1 groups)

- ST1: SAR (shift amount special register) manipulation, NSA;
- RST1: shifts, 16-bit multiplication.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

809377aa 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement LSAI group

- base + offset load/store operations for 1/2/4 byte values;
- cache operations (not implemented);
- multiprocessor synchronization operations.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

91a5bb76 09/10/2011 07:57 pm Max Filippov

target-xtensa: mark reserved and TBD opcodes

Reserved opcodes must generate illegal instruction exception. Usually
they signal emulation quality problems.
Not implemented opcodes are good to see.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

28067b22 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement SYNC group

All operations in this group are no-ops, because there are no delayed
side effects.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

8ffc2d0d 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement CACHE group

All operations in this group are no-ops, because cache ought to be
transparent to applications. However cache may be abused, then we'll
need to actually implement these opcodes.

Signed-off-by: Max Filippov <>...

f0a548b9 09/10/2011 07:57 pm Max Filippov

target-xtensa: add PS register and access control

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

40643d7c 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement exceptions

- mark privileged opcodes with ring check;
- make debug exception on exception handler entry.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

f76ebf55 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement RST2 group (32 bit mul/div/rem)

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

bd57fb91 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement conditional jumps

- BZ (comparison to zero);
- BI0 (comparison to signed immediate);
- BI1 (comparison to unsigned immediate);
- B (two registers comparison, bit sets comparison);
- BEQZ.N/BNEZ.N (narrow comparison to zero).

Signed-off-by: Max Filippov <>...

5da4a6a8 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement JX/RET0/CALLX

Group SNM0 (indirect jumps and calls).

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

2af3da91 09/10/2011 07:57 pm Max Filippov

target-xtensa: add special and user registers

Special Registers hold the majority of the state added to the processor
by the options. See ISA, 5.3 for details.

User Registers hold state added in support of designer's TIE and in some
cases of options that Tensilica provides. See ISA, 5.4 for details....

2328826b 09/10/2011 07:57 pm Max Filippov

target-xtensa: add target stubs

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

dedc5eae 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement disas_xtensa_insn

Set up disas_xtensa_insn switch structure, mark required options on high
level groups. Implement arithmetic/bit logic/jump/call0.

Implement code generation loop with single step/breakpoint checking.

Signed-off-by: Max Filippov <>...

67882fd1 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement narrow instructions

Instructions with op0 >= 8 are 2 bytes long, others are 3 bytes long.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

f331fe5e 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement RT0 group

NEG and ABS are the only members of RT0 group.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>