Commit graph

16 commits

Author SHA1 Message Date
Greg Chadwick
2de873c9bb Add icache_enable function to simple_system_common.h 2024-02-05 21:02:42 +00:00
Andreas Kurth
93c8e92c0d [sw/simple_system] Declare pcount_enable function as inline
The `pcount_enable` function can be used to selectively enable
performance counters only for a specific code segment.  For example:
```c
pcount_enable(0);
pcount_reset();
pcount_enable(1);
/* code to be measured */
pcount_enable(0);
```

The `pcount_enable` function consists of a single CSR instruction, so
the overhead and thus the impact on the measurement is potentially low.
When the function is called, however, many instructions have to be
executed in addition to the single CSR instruction, which influences
measurements.

This commit moves the `pcount_enable` function to the
`simple_system_common.h` header file and declares it as `inline` (and
`static`, to prevent link-time collisions when the header file is
included in multiple compilation units).  This helps the compiler inline
the function even without LTO.

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
2023-03-17 13:04:37 +00:00
Greg Chadwick
4c875b5bd2 [dv,ci] Add tests for data independent timing and dummy instructions 2022-11-17 18:20:57 +00:00
Greg Chadwick
bb6427d276 [examples/sw] Add a pmp smoke test 2022-07-21 15:55:59 +01:00
Canberk Topal
4b54d79fb4 [sw/fpga] coremark/link.ld update for FPGA sim
This commit updates link.ld RAM length to include max BRAM capacity
for Arty A7-35. It also changes coremark makefile to include a .vmem
output, which then can be used for FPGA implementations.

Signed-off-by: Canberk Topal <ctopal@lowrisc.org>
2021-08-03 16:51:16 +01:00
Leon Woestenberg
7506d4da2a [sw] Fix GNU GCC toolchain component substitution for file path case.
This invocation would break:

make -C examples/sw/led/ CC=/opt/lowrisc-toolchain-gcc-rv32imc-20210412-1/bin/riscv32-unknown-elf-gcc

because the "-gcc" occurence inside the directory name would also be replaced.

Fix by first deriving CROSS_COMPILE from CC, then conditionally build other tool file names/paths.

Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
2021-07-12 12:53:53 +01:00
Rupert Swarbrick
82d0654c97 Don't automatically generate disassembly in the example Makefile
Anyone who needs to disassemble their generated ELF can probably just
call objdump directly and the precise set of flags have already
confused at least one potential contributor[1].

We're keeping the canned objdump command for "engineers that know
where to look" because some have said they find it useful. Run it with
e.g.

    make -C examples/sw/simple_system/hello_test disassemble

[1] https://github.com/lowRISC/ibex/issues/1263
2021-03-02 09:21:09 +00:00
Tom Roberts
2cb1efb953 [simple-system] Add missing linker sections
Adding the "small" sections to the example linker script. This ensures
that all sections of memory needing to be zeroed are captured.

Fixes #1092

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2020-09-23 14:28:31 +01:00
Sam Elliott
f9f0cb1133 [simple_system] Update CSR Access for LLVM and GCC
At some point in the future, the version of binutils we're using, and
the released version of LLVM, will coincide to use the correct name. In
the meantime, this change just uses the number which is supported by
both compilers.

This is, as I understand it, the only stumbling block to compiling the
in-repo C benchmark code with both GCC and LLVM. Being able to do so
would make it much easier for us to do comparisons on the benchmarks for
both compilers.

Signed-off-by: Sam Elliott <selliott@lowrisc.org>
2020-09-22 16:57:14 +01:00
Greg Chadwick
023d86d912 [sw] Fix typo in simple system exception handler
Signed-off-by: Greg Chadwick <gac@lowrisc.org>
2020-06-02 13:45:46 +01:00
Greg Chadwick
d20e65e0f2 [sw/simple_system] Add PCOUNT_READ macro 2020-03-09 14:41:40 +00:00
Rupert Swarbrick
91d7721fa9 Make exiting from simple_system tests work with Spike 2020-03-02 15:45:47 +00:00
Rupert Swarbrick
59b3f7f476 Set the ELF entry point in simple system linker script
This is part of work to run binaries created for the simple system
under Spike. Spike's default behaviour (after a weird 'rom' trampoline
at 0x1000) is to obey the entry point given in the ELF file. So let's
set it correctly.
2020-02-28 10:02:56 +00:00
Tom Roberts
5bb41957ef [examples] Add timer example to simple system
Not particularly useful in the current system, but gives an example of
how to handle interrupts.
2020-01-10 10:18:09 +00:00
Tobias Wölfel
ef96678d65 Update load instruction 2019-11-13 14:30:53 +01:00
Greg Chadwick
2041f10c69 Added simple system
Simple system is a basic verilator top-level testbench for running
 executables.  It has functionality for outputting text to a log file
 and for the software to terminate the simulation
2019-11-09 07:48:47 +00:00