Merge pull request #115 from antmicro/fix_emulator

emulator: Use external hw/common.h from LiteX
This commit is contained in:
Dolu1990 2020-03-18 12:02:27 +01:00
parent 5aa0b86d96
commit f20eb4d541
2 changed files with 4 additions and 35 deletions

View File

@ -18,10 +18,11 @@ sim: all
qemu: CFLAGS += -DQEMU
qemu: all
litex: CFLAGS += -DLITEX -I${LITEX_BASE}/software/include
litex: | check_litex_base all
check_litex_base:
litex: CFLAGS += -DLITEX -I${LITEX_GENERATED} -I${LITEX_BASE}/litex/soc/software/include
litex: | check_litex all
check_litex:
@[ "${LITEX_BASE}" ] || ( echo ">> LITEX_BASE is not set"; exit 1 )
@[ "${LITEX_GENERATED}" ] || ( echo ">> LITEX_GENERATED is not set"; exit 1 )
include ${STANDALONE}/common/riscv64-unknown-elf.mk
include ${STANDALONE}/common/standalone.mk

View File

@ -146,38 +146,6 @@ void halInit(){
#ifdef LITEX
// this is copied from LiteX <hw/common.h>
#define CSR_ACCESSORS_DEFINED
static inline void csr_writeb(uint8_t value, unsigned long addr)
{
*((volatile uint8_t *)addr) = value;
}
static inline uint8_t csr_readb(unsigned long addr)
{
return *(volatile uint8_t *)addr;
}
static inline void csr_writew(uint16_t value, unsigned long addr)
{
*((volatile uint16_t *)addr) = value;
}
static inline uint16_t csr_readw(unsigned long addr)
{
return *(volatile uint16_t *)addr;
}
static inline void csr_writel(uint32_t value, unsigned long addr)
{
*((volatile uint32_t *)addr) = value;
}
static inline uint32_t csr_readl(unsigned long addr)
{
return *(volatile uint32_t *)addr;
}
// this is a file generated by LiteX
#include <generated/csr.h>