Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p19: Add a proposal for l.nop semihosting #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stffrdhrn
Copy link
Member

@stffrdhrn stffrdhrn commented May 17, 2022

Formally document the l.nop arguments in the spec.

#define NOP_NOP          0x0000      /* Normal nop instruction */
#define NOP_EXIT         0x0001      /* End of simulation */
#define NOP_REPORT       0x0002      /* Report the value of r3 */
#define NOP_PUTC         0x0004      /* Sim putc instruction */
#define NOP_CNT_RESET    0x0005      /* Reset statistics counters */
#define NOP_GET_TICKS    0x0006      /* Get # ticks running, 64-bit result */
#define NOP_GET_PS       0x0007      /* Get picosecs/cycle, 32-bit result */
#define NOP_TRACE_ON     0x0008      /* Turn on tracing */
#define NOP_TRACE_OFF    0x0009      /* Turn off tracing */
#define NOP_RANDOM       0x000a      /* Return 4 random bytes, 32-bit result */
#define NOP_OR1KSIM      0x000b      /* Return non-zero if this is Or1ksim */
#define NOP_EXIT_SILENT  0x000c      /* End of simulation, quiet version */
#define NOP_RESET        0x000d      /* Causes the simulator to reset */

This is needed for up streaming support for things like exit and reset into qemu.

Example emails:

@stffrdhrn
Copy link
Member Author

One thought is when we actually write the spec changes is to not spec all of the numbers. Maybe exit, report and putc are enough for a first draft.

@stffrdhrn
Copy link
Member Author

stffrdhrn commented May 17, 2022

Some more links this is similar to:

However, while the openrisc definition centers around very primative putc and report for writing to stdout. The other implementations provide standard input/output operations via open, close, write, read and lseek operations.

Perhaps we should follow other semihosting solutions.

@stffrdhrn stffrdhrn changed the title p18: Add a proposal for l.nop semihosting p19: Add a proposal for l.nop semihosting May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants