[libre-riscv-dev] libre-riscv-dev Digest, Vol 3, Issue 5
Daniel Benusovich
flyingmonkeys1996 at gmail.com
Sun Nov 11 03:43:53 GMT 2018
Regarding the unit tests I have many questions!
In riscv-tests/rv64ui/sv_addw_elwidth.S the macro "SV_ELWIDTH_TEST" calls
(among other macros) "SET_SV_MVL", "SET_SV_3CSRS", "SET_SV_VL", and,
"CLR_SV_CSRS".
I understand the first portion of the macro sets up your test data, but, I
am confused as to what exactly the macros above do. They setup the
operations to perform some addition. Clearly they are setting up how the
data will be added (x15 and x12 while storing the result in x28) but how do
the CSR registers affect the results of adding the same two values? The
expected results change while I see wid1/2/3 and isvec1/2/3 changing.
In addition what are the parameters wid1/2/3? Do these define the size of
the vector? IsVec1/2/3 a boolean to tell the processor the registers with
data to add represent vectors? How does VL change the operations to be
performed through "SET_SV_MVL" and "SET_SV_VL"? Is there a place I can go
and read about how these values in CSR will change the operations? I have
been looking at the RISCV reference card/Manual can see we are atomically
writing the immediate 2 (3 - 1) to the CSR at 0x4f1 ("SET_SV_MVL") and
0x4f0 ("SET_SV_VL") The composed information for where to find and how to
process three registers (the sources of data to add and the destination)
worth of data to 0x4c0 ("SET_SV_3CSRS"/"CLR_SV_CSRS"). Finding the relevant
data in the manual is a little tough for the section without knowing where
to start.
Also the values of x29 and x30 are changed in some iterations of the macro
but no changes are made to those particular registers visibly. Are they
this affected by the addition when certain CSR values are set?
Also what is elwidth? I see the guy literally everywhere and have no idea
what it means haha.
Sorry for all the questions at once I have spent more than a few days
pouring over the unit test you told me to copy and want to be sure that any
changes that are made are made with some sort of reason. Hopefully with
these guys answered I could start actually making a unit tests that will
work!
Hope you are having a great day
- Daniel
More information about the libre-riscv-dev
mailing list