aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2011-06-22sim: bfin: pass up result2/errcode with libgloss syscallsMike Frysinger2-2/+7
Now that the Blackfin libgloss code extracts the 2nd result and the error code from the R1/R2 registers, have the sim fill them up. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-20 * am33.igen (sub Rm,Rn,Rd): Fix computation of carry flag.Nick Clifton2-1/+5
2011-06-18sim: bfin: set ASTAT AV/AVS when shifting accumulators overflowMike Frysinger2-0/+12
The LSHIFT/ASHIFT insns that work with accumulators lacked AV/AVS handling in the ASTAT register, so add it to match the hardware. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: do not touch ASTAT[V] when shifting accumulatorsMike Frysinger2-3/+9
If we're shifting accumulators, we don't want to touch the V bit in ASTAT, so add size checks to the ashiftrt/lshiftrt helpers. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: do not extend accumulator in LSHIFT insnsMike Frysinger2-1/+6
The logical shift insn does not sign extend before shifting, so we shouldn't either. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: tweak saturation handling with TFU/FU modes and MM bitMike Frysinger2-14/+35
This too should have been squashed into an earlier change. It covers a few more cases in the V/VS saturation patch when working with TFU and FU modes of dsp insns. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: handle large shift values with accumulator shift insnsMike Frysinger2-2/+14
When the shift magnitude exceeds 32 bits, the values rotate around (since the hardware is actually a barrel shifter). So handle this edge case, update the corresponding AV bit in ASTAT which was missing previously, and tweak the AZ setting based on how the hardware behaves. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: handle odd shift values with shift insnsMike Frysinger2-7/+36
The shift magnitude is a 5-bit signed value. When it is between 0 and 15, then we do the requested shift, but when it is outside of that, we have to do the opposite. That means we flip between lshift and ashiftrt to match the hardware. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: add tests for recent dsp fixesMike Frysinger14-0/+2502
Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: fix M_IH saturation sizeMike Frysinger2-17/+6
This reverts the previous commit and does it right. This change got lost in the shuffle of patches I have pending. Basically the logic is to change the 32bit saturation (and then masked to 16bits) to a proper 16bit saturation. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: handle V/VS saturation in dsp mac insnsMike Frysinger2-25/+58
Some saturation cases with dsp mac insns were not setting the V flag. So implement that part and split up the logic between the dual macs. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: handle the MM flag in M_IU/M_TFU modes with dsp insnsMike Frysinger2-0/+10
Our handling of the M_IU/M_TFU modes are missing signed saturation when the MM flag is set, so add it to match the hardware behavior. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: fix sign extension in dsp insns with MM flagMike Frysinger2-8/+10
After testing the hardware with all the different dsp flags, the MM flag triggers sign extension in all modes. So drop the limited use of it, and the local custom helper that was also extending unsigned values. We also can see that the flag checks in the mult/mac insns have the same behavior with sign extending, so add a helper func to keep the logic the same in both places. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: fix dsp insns IH saturation/rounding behaviorMike Frysinger2-1/+16
When using the IH modifier, we need to first saturate the value before rounding it, and then further saturate it a bit more. This makes the sim match the hardware behavior with these insns. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: fix inverted changelog entryMike Frysinger1-1/+1
2011-06-18sim: bfin: fix accumulator edge case saturationMike Frysinger2-2/+7
When the accumulator saturates, it needs to be greater than, but not equal to, the largest unsigned value as this is what the hardware does. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-18sim: bfin: use freeargv for freeing argvsMike Frysinger2-1/+5
Since the argv array was allocated with dupargv, it needs to be freed with freeargv to avoid leaks. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-09sim: erc32: ignore --sysroot that gdb passes downMike Frysinger2-0/+7
2011-06-09sim/ppc: Fix check for --sysroot= optionJoel Brobecker2-1/+6
Fixes an error reported by Tristan and which can be evidenced by doing: % powerpc-elf-gdb (gdb) target sim --sysroot=var Invalid option: --sysroot=/var [...] sim/ppc/ChangeLog: * psim.c (psim_options): Fix length of comparison when checking for --sysroot= option.
2011-06-09Spelling fixes in ChangeLog.Joel Brobecker1-2/+2
2011-06-08ppc sim: Improve invalid option error messageJoel Brobecker2-2/+13
This patch improves the error message when an invalid option is detected, by also printing the option that actually caused the error. For instance, from GDB: (gdb) target sim --hello Invalid option: --hello Usage: [...] We also added the usage after an invalid long-name option (Eg: --hello) to be in line with what's being done for all other invalid options being detected. sim/ppc/ChangeLog: * psim.c (psim_options): Add option that cause the error in invalid-option error messages. Print the usage when detecting an invalid long-name option.
2011-06-08ppc sim: Allow --sysroot command-line optionJoel Brobecker2-0/+8
There was a recent change that cuased the "target sim" command to add a --sysroot option to the argument vector passed down to the simulator. This caused a failure in the powerpc simulator, as it did not recognize it. This patch fixes the problem by adding support for the --sysroot option (it ignores it). sim/ppc/ChangeLog: * psim.c (psim_options): Accept and ignore `--sysroot=...'.
2011-06-05sim: bfin: add missing gitignore fileMike Frysinger1-0/+1
2011-06-04sim: bfin: import testsuiteMike Frysinger816-0/+221152
Now that the common sim testsuite code supports .S and .c files, we can import the Blackfin testsuite. There are about ~800 tests here, so I'm only attaching a compressed patch of them. Other than adding files to sim/testsuite/sim/bfin/, the sim/configure.tgt file was updated to mark Blackfin as having a testsuite, and sim/configure regenerated. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-04sim: bfin: add support for glued SIC interrupt linesMike Frysinger2-25/+71
The BF537 family glues a bunch of peripherals into single interrupt lines that run into the SIC. To model this same behavior in the sim, we need to use the glue-or device, and in order to use that, we need to tweak things a bit in the mach code to allow declaring of these new devices. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-04sim: bfin: push SIC mappings to device treeMike Frysinger3-589/+723
The machs.c file is the best place for holding cpu-specific details, so restructure the way the SIC manages its ports to do just that. Now the SIC's have a standard set of input pins and the different line routing from peripherals is kept in the device tree only. This better models the hardware where the SIC doesn't care about the exact peripheral that is sending it stuff, just which input pin it gets it on. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-03Spelling fixe in sim/ppc/vm.cJoel Brobecker2-1/+7
From Stephen Kitt <steve@sk2.org> * vm.c (vm_synchronize_context): Spelling fix in function documentation.
2011-06-03Minor spelling fix in ChangeLog.Joel Brobecker1-1/+1
2011-06-03sim: bfin: dma: fix indentationMike Frysinger2-1/+5
2011-06-01Add `sim_complete_command' definition to erc32 simJoel Brobecker2-0/+10
This patch fixes a build failure at link time due to sim_complete_command being undefined. There was a recent change that added this function to all the ports that do not use the common/ subdir. But somehow, the erc32 port got missed. sim/erc32/ChangeLog: * interf.c (sim_complete_command): New stub function.
2011-05-27sim: fix minor --sysroot mem leakMike Frysinger2-3/+13
The current --sysroot parsing attempts to keep from leaking memory by treating the empty string specially (sine this is the initial value), but it ends up leaking memory when the arg is an empty string. So if someone uses --sysroot "", the old value is leaked, as is the new one. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-26sim: common: add back Blackfin syscallsMike Frysinger2-0/+35
A semi-recent change which regenerated nltvals.def somehow missed all of the Blackfin syscalls. So regenerate against the latest tree to get them back. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-26sim: bfin: switch to new syscall trace levelMike Frysinger2-1/+5
Now that the common code supports the syscall trace level, change the Blackfin code from using the event level to the syscall level. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-26sim: add syscall tracing levelMike Frysinger3-1/+30
It's useful to be able to trace just the system calls the simulated program is calling, so add a new --trace-syscall option for ports to leverage if they choose. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25sim: bfin: move model data into machs.hMike Frysinger31-109/+80
Pull the model data (register addresses/sizes) out of the different model files and into the machs.h header. The models themselves don't care about where they're mapped, only the mach code does. This allows us to keep the model headers from being included in the mach code which can cause issues with model-specific names colliding. Such as when a newer device model is created, but with incompatible register names/layouts. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25sim: bfin: add a performance monitor stubMike Frysinger7-0/+196
No counters get updated, but there is enough here for software to poke things and work. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25sim: bfin: add bf526-0.2/bf54x-0.4 rom regionsMike Frysinger6-0/+27
Add regions for the on-chip roms on some newer Blackfin parts. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-23sim: glue: allow bitwise devices to only glue intsMike Frysinger2-47/+61
Some Blackfin parts tie a bunch of interrupt lines into a single OR gate before feeding the result into the SIC. The glue-or device in the sim provides a nice way of modeling this exact behavior. At the moment though, it requires the device to be mapped into the address space so that things could write to it directly. This is not needed for the Blackfin usage, so make it optional. Now the glue devices can be used to simply tie interrupt lines together. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-23sim: glue: implement or/xor funcsMike Frysinger2-7/+34
The glue device has a bunch of "todos" for the misc bitwise devices. So implement two for fun -- the glue-or and glue-xor. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-16sim: tests: support .S/.c filesMike Frysinger2-9/+47
Rather than requiring all sim tests to be preprocessed .s files, add support for .S and .c files so we can easily write code using a higher level language like C. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-14sim: bfin: allow pushing of SPMike Frysinger2-2/+6
The hardware respects this insn, and some code (like the on-chip bootrom) uses it, so allow it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-14sim: bfin: implement loop back support in the UARTsMike Frysinger4-23/+62
The UART has a LOOP_ENA bit in its MCR register where writes to the THR go to the RBR. Implement support for this mode. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-11sim: fix func call style (space before paren)Mike Frysinger24-241/+250
Committed this as obvious: -foo(...); +foo (...); Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-11 PR sim/12737Hans-Peter Nilsson5-0/+11
* sim/arm/iwmmxt/wcmpgt.cgs, sim/arm/iwmmxt/wmac.cgs, sim/arm/iwmmxt/wsra.cgs, sim/arm/xscale/blx.cgs: Kfail.
2011-05-09sim: bfin: fix UART LSR read-only bit saturationMike Frysinger2-0/+6
A few bits in the newer UART LSR register are not sticky, so make sure we clear them when returning updated status rather than leaving them always set. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-04gdb:Joseph Myers10-9/+29
* configure.host (xscale*): Don't handle target. * configure.tgt (thumb*-*-* | strongarm*-*-* | xscale-*-*): Don't handle targets. gdb/gdbserver: * README: Don't mention xscale*-*-linux*. * configure.srv (xscale*-*-linux*): Don't handle target. gdb/testsuite: * gdb.base/a2-run.exp (strongarm-*-coff): Don't handle target. * gdb.base/float.exp (xscale*-*-*, strongarm*-*-*): Don't handle targets. * gdb.base/long_long.exp (xscale*-*-*, strongarm*-*-*): Don't handle targets. sim: * configure.tgt (thumb*-*-* | strongarm*-*-* | xscale-*-*): Don't handle targets. * configure: Regenerate. sim/testsuite: * configure: Regenerate. * sim/arm/allinsn.exp (xscale*-*-*): Don't handle target. * sim/arm/misc.exp (thumb*-*-*, xscale*-*-*): Don't handle targets. * sim/arm/iwmmxt/iwmmxt.exp: Test for arm*-*-* instead of xscale*-*-*. * sim/arm/thumb/allthumb.exp (thumb*-*-*): Don't handle target. * sim/arm/xscale/xscale.exp: Test for arm*-*-* instead of xscale*-*-*.
2011-04-27sim: bfin: constify dmac pmap arraysMike Frysinger2-13/+22
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-26sim: gpio: add output supportMike Frysinger2-16/+53
Make all of the pins bidirectional, and support sending signals when software drives the pins as outputs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-26sim: gpio: update mask a/b signals betterMike Frysinger2-12/+49
When the mask a/b MMRs are written, the output signal might change levels (as pins are [un]masked), so make sure we update the output level. Further, make sure we handle edge ints correctly by first sending a high signal followed by a low signal. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-16sim: add sim_complete_command stubs for non-common-using portsMike Frysinger14-0/+69
For the ports that don't use the common/ subdir, we need to add stub funcs to them to avoid build failures with gdb and command completion. These do not implement the actual completion functionality ... any port that wants that can either convert to the common/ subdir, or fill out the function on their own time. Signed-off-by: Mike Frysinger <vapier@gentoo.org>