Hazard3/test/sim/hellow/main.c

24 lines
558 B
C

#include "tb_cxxrtl_io.h"
#include "uart.h"
#define CLK_FREQ_MHZ 12
// __attribute__((optimize("O0")))
int main() {
// Float stuff should all be compile-time. 115200 baud.
uart_init();
uart_clkdiv_baud(CLK_FREQ_MHZ, 9600);
uart_puts("Hello, UART!\n");
// Need to wait for completion, else we will terminate the simulation
// while characters still in FIFO.
uart_wait_done();
// tb_puts("Hello world from Hazard3 + CXXRTL!\n");
// uint32_t addr = 0x40008000;
// uint32_t *point = (uint32_t *)addr;
// *point = 'C';
return 123;
}