Small RISC-V spike demo improvements (#554)

* Put XLEN into .o files.

Makes it easier to work on voth RV32 and RV64 binaries side-by-side.

* Let the debugger disable HTIF use.

* Makefile now links the binary at BASE_ADDRESS

I need this so I can easily generate the appropriate binaries for
riscv-tests/debug. Unfortunately there doesn't seem to be any good
mechanism to externally define values for lds files, so I'm running it
through the C preprocessor.

Co-authored-by: Joseph Julicher <jjulicher@mac.com>
This commit is contained in:
Tim Newsome 2021-04-08 15:03:10 -07:00 committed by GitHub
parent f87eb7d0d4
commit c280f26c1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 17 deletions

View file

@ -33,22 +33,28 @@
int xGetCoreID( void )
{
int id;
int id;
__asm ("csrr %0, mhartid" : "=r" ( id ) );
return id;
}
/* Use a debugger to set this to 0 if this binary was loaded through gdb instead
* of spike's ELF loader. HTIF only works if spike's ELF loader was used. */
volatile int use_htif = 1;
void vSendString( const char *s )
{
portENTER_CRITICAL();
while (*s) {
htif_putc(*s);
s++;
if (use_htif) {
while (*s) {
htif_putc(*s);
s++;
}
htif_putc('\n');
}
htif_putc('\n');
portEXIT_CRITICAL();
}