Merge pull request #115 from antmicro/fix_emulator
emulator: Use external hw/common.h from LiteX
This commit is contained in:
parent
5aa0b86d96
commit
f20eb4d541
|
@ -18,10 +18,11 @@ sim: all
|
||||||
qemu: CFLAGS += -DQEMU
|
qemu: CFLAGS += -DQEMU
|
||||||
qemu: all
|
qemu: all
|
||||||
|
|
||||||
litex: CFLAGS += -DLITEX -I${LITEX_BASE}/software/include
|
litex: CFLAGS += -DLITEX -I${LITEX_GENERATED} -I${LITEX_BASE}/litex/soc/software/include
|
||||||
litex: | check_litex_base all
|
litex: | check_litex all
|
||||||
check_litex_base:
|
check_litex:
|
||||||
@[ "${LITEX_BASE}" ] || ( echo ">> LITEX_BASE is not set"; exit 1 )
|
@[ "${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/riscv64-unknown-elf.mk
|
||||||
include ${STANDALONE}/common/standalone.mk
|
include ${STANDALONE}/common/standalone.mk
|
||||||
|
|
|
@ -146,38 +146,6 @@ void halInit(){
|
||||||
|
|
||||||
#ifdef LITEX
|
#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
|
// this is a file generated by LiteX
|
||||||
#include <generated/csr.h>
|
#include <generated/csr.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue