Age | Commit message (Collapse) | Author | Files | Lines |
|
This patch adds a --log argument to spike. If not given, the behaviour
is unchanged: messages logging execution of instructions and (if
commit logging is enabled) commits go to stderr.
If --log=P is given, Spike now writes these messages to a log file at
the path P. This is nice, because they are no longer tangled up with
other errors and warnings.
The code is mostly plumbing: passing a FILE* object through to the
functions that were using stderr. I've written a simple "log_file_t"
class, which opens a log file if necessary and yields it or stderr.
|
|
|
|
Rvv fix 2020 03 17
|
|
For unit-strided and stride segment load, mask register can't
overlap destination register if masked
ref:
https://github.com/riscv/riscv-v-spec/pull/395
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
1. store_fault_access
reorder the log and slow_path code
2. misaligned_access
reset the log buffer in the beginning rather at the end of execution to
avoid that uncompleted execution status is brought to the next
instruction
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
I think this bug wasn't caught because OS code never steps over faulting
LR instructions in practice. The exception is either fatal (in which case
the point is moot) or the LR is re-executed (in which case the point is
also moot).
Resolves #431
|
|
configure.ac included code which detects and inserted a full path
to dtc. Unfortunately, when building with a packaging system, this
path reflects the path under a staged building area.
Also the inclusion of a full path breaks the use case where someone
keeps two versions of dtc on their computer and sets their PATH to
switch between them. spike will continue to use the one on their PATH
when it was built rather than the intended one.
Co-authored-by: Joel Sherrill <joel@rtems.org>
|
|
Resolves #426
The relevant passage in the spec does not mention software breakpoints
as one of the cases that cause mtval to be set to a nonzero value:
https://github.com/riscv/riscv-isa-manual/blob/274893e2f0365f904829bbb60fd05cc01d2bfb11/src/machine.tex#L2202
|
|
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Rvv fix 2020 03 11
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
vfmv.s.f
check valid vstart
vfmv.f.s
reset vstart in the end
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Rvv fix 2020 03 09
|
|
change to 0ce3ec1
1. mstatus.vs is changed and it is 0.9 draft feature
2. opcodes are separated into difference files by extensions. The opcodes are
not modifed but order are differenct.
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
1. don't duplicate vconfig for lmul >=2 case
2. add l# to show prenset vl value
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
To improve the readability of varch argument and future configuration,
the format of options within varch are changed
from
"v128:e64:s512"
to
"vlen:128,elen:64,slen:512".
|
|
The spec doesn't limit the range of middle value.
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
|
|
|
|
|
|
This CSR appeared in version 1.11 of the ISA and is described in the
Volume II: Privileged Architecture manual. It's an optional register
and should read as zero if not implemented, which is what this patch
does.
|
|
|
|
Check presence of [S|U] extension for mstatus.[sxl|uxl] read/write
|
|
|
|
Allow overriding CFLAGS and similar when building
|
|
Before this patch, I don't think it was possible to change (say)
CFLAGS as part of running the make command. Nor did setting them when
running configure do anything. Getting this right is a little fiddly:
for example, see Automake's approach at [1] ("AM_CFLAGS" and friends).
This patch adds an "mcppbs-" prefix, and sets things up properly for
CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS. Note that the bulk of the
patch is either the auto-generated configure script or the ax_*.m4
files vendored in from the autoconf archive (needed to handle
--export-dynamic correctly without trashing settings from the user
running configure).
What's supposed to happen is as follows:
- Base compilation flags that should apply to everything (standard
optimisation flags, warning flags etc.) are defined in
Makefile.in.
- When the user runs configure, they can set compilation flags on
the command line. These end up as environment variables in the
shell script.
- Compilation flags that can only be decided when we run
configure (this is currently just whether we support
-Wl,--export-dynamic) are appended to the configure-time LDFLAGS
environment variable.
- At the end of the configure script, these environment variables
are spliced into Makefile.in to fill out the corresponding
@<varname>@ entries.
- When running make, the user might again override compilation
flags. These will get appended to the flags found so far.
As a concrete example:
mkdir build
cd build
../configure CXXFLAGS='-O3'
make CXXFLAGS='-O0'
will result in c++ compile commands that look like this:
g++ -MMD -MP \
-DPREFIX=\"/usr/local\" -Wall -Wno-unused -g -O2 -std=c++11 \
-O3 \
-O0 \
-I. -I.. -I../fesvr -I../riscv -I../dummy_rocc -I../softfloat \
-I../spike_main -fPIC -c ../fesvr/elfloader.cc
(I've added some newlines to wrap the long line).
Note that we have the base flags from Makefile.in (called
$(default-CXXFLAGS) there) first. Then we have the -O3 from the
configure command. Finally we have the -O0 from the Make command line.
And I can finally run "make CXXFLAGS='-O0 -g3'". Phew!
[1] https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
|
|
|
|
|
|
... as recommended, but not required, by the spec.
|
|
38438778f0fc34df8cdf748cc9f35e1d15e0c8db fixed the bug.
cc @timsifive
|
|
Rvv fix 2020 02 20
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
cc @chihminchao @HanKuanChen
|
|
Since vector stores read rd, rather than write rd, there is no overlap
constraint.
|
|
Rvv fix 2020 02 14
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
zimm5 for unsigned and zero-extended
simm5 for signed and signed-extended
It is unsigned arithmetics
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
The VI_CHECK_SSS macro enforces the weaker constraint.
|
|
The spec says, "For vadc and vsbc, an illegal instruction exception is raised if the destination vector register is v0 and LMUL > 1."
cc @chihminchao @HanKuanChen
|
|
|