risc-v-tlm/tests/C/trace3/trace3.c

14 lines
238 B
C
Raw Normal View History

2018-10-07 04:19:29 +08:00
#define TRACE (*(unsigned char *)0x40000000)
2019-01-14 01:20:02 +08:00
int main(void) {
2018-10-07 04:19:29 +08:00
char msg[] = "abcdefg\n";
int i;
for (i=0; i<5; i++) {
TRACE = msg[i];
}
2019-01-14 01:20:02 +08:00
asm volatile ("rdcycle t0");
asm volatile ("rdtime t4");
2018-11-20 00:22:18 +08:00
asm volatile ("ecall");
2018-10-07 04:19:29 +08:00
}