On Tue, Apr 25, 2017 at 5:41 AM, xhayd <
xha...@gmail.com> wrote:
> Hello Everyone !!
>
> I was going through the privileged and the system aspects of the RISC-V ISA
> and came across instructions like ECALL, EBREAK and MRET and URET (from the
> user spec v2.1 and the priv spec v1.9.1). I need clarification on these
> instructions
>
> ECALL => the spec says " the instruction is used to make a request to the
> supporting execution environment which is usually an Operating System. The
> ABI for the system will define how parameters for the environment request
> are passed but usually these will be in defined locations in the register
> file" I`am not able to make sense of this statement from a hardware point,
> what exactly happens in the hardware when an ECALL is fetched and decoded,
> what happens in the execution stage, does it read the IRF and generate some
> signal or modifies some value in a CSR register.
>
> EBREAK => the spec says " the instruction is used by debuggers to cause
> control to be transferred back to a debugging environment" , would this mean
> that upon encountering EBREAK the control should jump to a subroutine that
> reads all the registers in the cpu, Iam not able to get a hang of what this
> would do in hardware
MRET works as you have described, yes. (URET is not used in the