aboutsummaryrefslogtreecommitdiff
path: root/sim/bpf
AgeCommit message (Collapse)AuthorFilesLines
2021-04-02sim: unify toolchain settingsMike Frysinger3-153/+162
The toplevel, common, and igen dirs all have their own code for setting up toolchain settings. Unify all of that in a new macro.
2021-02-28sim: set up build-time compiler settingsMike Frysinger1-9/+10
Some sim dirs were already setting up CFLAGS_FOR_BUILD in inconsistent ways. Move it to a common place for reuse.
2021-02-28sim: use AC_CHECK_TOOL to find arMike Frysinger1-3/+93
Rather than require $AR be set and then default to `ar`, use the standard AC_CHECK_TOOL helper to find a good prefixed tool. In practice this shouldn't change much as we seem to have macros in the tree that were already setting it up, but we shouldn't rely on that implicitly.
2021-02-28sim: require AC_PROG_CPP explicitlyMike Frysinger2-140/+145
All the scripts were using this implicitly already, so there's no real change for them, but we want to call it explicitly as the CPP tool is used to generate nltvals.def.
2021-02-21sim: common: split up acinclude.m4 into individual m4 filesMike Frysinger4-10/+37
This file is quite large and is getting unmanageable. Split it apart to follow aclocal best practices by putting one-macro-per-file. There shouldn't be any real functional changes here as can be seen in the configure script regens.
2021-02-13sim: switch to AC_CONFIG_MACRO_DIRSMike Frysinger4-1834/+35
Rather than hand maintain m4 includes in various autotool files, use AC_CONFIG_MACRO_DIRS to declare the relevant search paths. This simplifies the code, makes it more robust, and cleans out unused logic from configure.
2021-02-06sim: common: switch AC_CONFIG_HEADERSMike Frysinger1-3/+2
The AC_CONFIG_HEADER macro is long deprecated, so switch to the newer form. This also gets rid of the position limitation, and drops support for an argument to SIM_AC_COMMON which we haven't used anywhere.
2021-02-06sim: drop use of bfd/configure.hostMike Frysinger2-7/+15
These settings might have made sense in darker compiler times, but I think they're largely obsolete now. Looking through the values that get used in HDEFINES, it's quite limited, and configure itself should handle them. If we still need something, we can leverage standard autoconf macros instead, after we get a clear user report. TDEFINES was never set anywhere and was always empty, so prune that.
2021-01-31sim: bpf: fix mainloop extract callMike Frysinger2-1/+5
The extract function takes the argbuf, not the scache.
2021-01-31sim: bpf/or1k: fix CGEN_TRACE_EXTRACT nameMike Frysinger3-70/+76
We renamed these years ago, but it looks like the cgen core missed the TRACE_EXTRACT function, so these new ports still used the incompatible common name. Fix those ports to use the right func.
2021-01-11sim: call SIM_AC_OPTION_WARNINGS(no) in remaining portsMike Frysinger3-2/+113
We want all ports to opt into extra warnings as the default compiler settings lets a lot slide. Opt all the ports that haven't already in to the warning system. None of them build with -Werror, so disable that by default. Hopefully someone finds these important enough to start fixing at some point.
2021-01-11sim: clean up C11 header includesMike Frysinger3-16/+35
Since we require C11 now, we can assume many headers exist, and clean up all of the conditional includes. It's not like any of this code actually accounted for the headers not existing, just whether we could include them. The strings.h cleanup is a little nuanced: it isn't in C11, but every use of it in the codebase will include strings.h only if string.h doesn't exist. Since we now assume the C11 string.h exists, we'll never include strings.h, so we can delete it.
2021-01-09sim: clean up stale AC_PREREQ refsMike Frysinger2-14/+7
This was purged from the tree when we upgraded to autoconf-2.69, but a few references in the sim tree were missed.
2021-01-08sim: require a C11 compilerMike Frysinger2-13/+57
With GDB requiring a C++11 compiler now, this hopefully shouldn't be a big deal. It's been 10 years since C11 came out, so should be plenty of time to upgrade. This will allow us to start cleaning up random header logic and many of our non-standard custom types.
2021-01-07sim: ChangeLog: move arch-specific entries into the arch dirMike Frysinger1-0/+54
We don't want arch-specific entries in the common ChangeLog files. Most arches do this already, so clean up the recent additions, and move some older entries down to help avoid confusing newcomers.
2021-01-04sim: update bug URI to https://Mike Frysinger1-1/+1
2021-01-01Update copyright year range in all GDB filesJoel Brobecker25-25/+25
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-11-01sim/bpf: re-generate configureSimon Marchi1-2/+2
I noticed a little diff when re-generating the configure file in this directory. sim/ChangeLog: * bpf/configure: Re-generate. Change-Id: Ieb26be2cc1be8108d4b08387255f45b57f288171
2020-09-08bpf: simulator: correct div, mod insn semanticsDavid Faust2-16/+16
The div and mod eBPF instructions are unsigned, but the semantic specification for the simulator incorrectly used signed operators. Correct them to unsigned versions, and correct the ALU tests in the simulator (which incorrectly assumed signed semantics). Tested in bpf-unknown-none. cpu/ChangeLog: 2020-09-08 David Faust <david.faust@oracle.com> * bpf.cpu (define-alu-instructions): Correct semantic operators for div, mod to unsigned versions. sim/ChangeLog: 2020-09-08 David Faust <david.faust@oracle.com> * bpf/sem-be.c: Regenerate. * bpf/sem-le.c: Likewise. sim/testsuite/ChangeLog: 2020-09-08 David Faust <david.faust@oracle.com> * sim/bpf/alu.s: Correct div and mod tests. * sim/bpf/alu32.s: Likewise.
2020-09-03bpf: several small fixes in the simulatorJose E. Marchesi6-3/+70
This patch fixes the following problems: - Missing includes in several files leading to implicit function declarations. - Missing prototype for bpf_trace_printk in bpf-helpers.h - The simulator bitsize was set to 32 bits, causing truncation of the program counter. Tested in bpf-unknown-none. sim/ChangeLog: 2020-09-03 Jose E. Marchesi <jose.marchesi@oracle.com> * bpf/bpf.c: Include bpf-helpers.h. * bpf/bpf-helpers.h: Provide a prototype for bpf_trace_printk. * bpf/configure.ac: Set simulator bitsize to 64. * bpf/configure (includedir): Regenerate. * bpf/sim-if.c: Include stdlib.h. * bpf/traps.c: Likewise.
2020-08-04sim: generated files for the eBPF simulatorJose E. Marchesi13-0/+9926
This patch adds the CGEN generated files for the eBPF simulator. sim/ChangeLog: 2020-08-04 Jose E. Marchesi <jose.marchesi@oracle.com> David Faust <david.faust@oracle.com> * bpf/arch.c: Likewise. * bpf/arch.h: Likewise. * bpf/cpu.c: Likewise. * bpf/cpu.h: Likewise. * bpf/cpuall.h: Likewise. * bpf/decode-be.c: Likewise. * bpf/decode-be.h: Likewise. * bpf/decode-le.c: Likewise. * bpf/decode-le.h: Likewise. * bpf/defs-be.h: Likewise. * bpf/defs-le.h: Likewise. * bpf/sem-be.c: Likewise. * bpf/sem-le.c: Likewise.
2020-08-04sim: eBPF simulatorJose E. Marchesi16-0/+17806
This patch introduces the basics of an instruction-simulator for eBPF. The simulator is based on CGEN. gdb/ChangeLog: 2020-08-04 Jose E. Marchesi <jose.marchesi@oracle.com> * configure.tgt: Set gdb_sim for bpf-*-* targets. sim/ChangeLog: 2020-08-04 Jose E. Marchesi <jose.marchesi@oracle.com> David Faust <david.faust@oracle.com> * configure.tgt (sim_arch): Add entry for bpf-*-*. * configure: Regenerate. * MAINTAINERS: Add maintainer for the BPF simulator. * bpf/Makefile.in: New file. * bpf/bpf-helpers.c: Likewise. * bpf/bpf-helpers.def: Likewise. * bpf/bpf-helpers.h: Likewise. * bpf/bpf-sim.h: Likewise. * bpf/bpf.c: Likewise. * bpf/config.in: Likewise. * bpf/configure.ac: Likewise. * bpf/decode.h: Likewise. * bpf/eng.h: Likewise. * bpf/mloop.in: Likewise. * bpf/sim-if.c: Likewise. * bpf/sim-main.h: Likewise. * bpf/traps.c: Likewise. * bpf/configure: Generate. * bpf/aclocal.m4: Likewise. sim/testsuite/ChangeLog: 2020-08-04 David Faust <david.faust@oracle.com> Jose E. Marchesi <jose.marchesi@oracle.com> * configure: Regenerate. * sim/bpf/allinsn.exp: New file. * sim/bpf/alu.s: Likewise. * sim/bpf/alu32.s: Likewise. * sim/bpf/endbe.s: Likewise. * sim/bpf/endle.s: Likewise. * sim/bpf/jmp.s: Likewise. * sim/bpf/jmp32.s: Likewise. * sim/bpf/ldabs.s: Likewise. * sim/bpf/mem.s: Likewise. * sim/bpf/mov.s: Likewise. * sim/bpf/testutils.inc: Likewise. * sim/bpf/xadd.s: Likewise.