Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/lm32
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ca5679d99219
Choose a base ref
...
head repository: m-labs/lm32
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 68d407f4a344
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jan 8, 2013

  1. lm32 test Makefiles cleanup

    Make the makefiles more portable and able to use different toolchain than
    lm32-elf (for instance lm32-rtems4.11).
    
    Signed-off-by: Yann Sionneau <yann@minet.net>
    Signed-off-by: Michael Walle <michael@walle.cc>
    fallen authored and mwalle committed Jan 8, 2013
    Copy the full SHA
    e937900 View commit details
  2. fix compilation of lm32 tests

    Fix compiling when using RTEMS toolchain (or any other non-bare-metal
    toolchain).
    
    Signed-off-by: Yann Sionneau <yann@minet.net>
    Signed-off-by: Michael Walle <michael@walle.cc>
    fallen authored and mwalle committed Jan 8, 2013
    Copy the full SHA
    68d407f View commit details
Showing with 16 additions and 15 deletions.
  1. +7 −6 test/Makefile
  2. +9 −9 test/unittests/Makefile
13 changes: 7 additions & 6 deletions test/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PREFIX ?= lm32-elf-
CROSS_COMPILE ?= lm32-elf-

# extra plusargs for simulation
# eg. EXTRA_PLUSARGS = "+dump=dump.vcd"
@@ -8,8 +8,9 @@ EXTRA_PLUSARGS ?=
# eg. EXTRA_DEFINES = "-DTB_ENABLE_WB_TRACES"
EXTRA_DEFINES ?=

CC := $(PREFIX)gcc
OBJCOPY := $(PREFIX)objcopy
CC = $(CROSS_COMPILE)gcc
OBJCOPY = $(CROSS_COMPILE)objcopy
LDFLAGS = -Tlinker.ld -fno-builtin -nostdlib -lgcc

RTL ?= ../rtl
SOURCES = tb_lm32_system.v lm32_config.v
@@ -32,19 +33,19 @@ trace_%: %.vh tb_lm32_system
@vvp tb_lm32_system +trace=trace_$*.txt +prog=$< $(EXTRA_PLUSARGS)

%.elf:
$(CC) -Tlinker.ld -fno-builtin -o $@ $^
$(CC) $(LDFLAGS) -o $@ $^

%.vh: %.elf
$(OBJCOPY) -O verilog $< $@

clean:
rm -f tb_lm32_system *.vcd *.elf *.vh trace*.txt
$(RM) tb_lm32_system *.vcd *.elf *.vh trace*.txt

tb_lm32_system: $(SOURCES)
iverilog -I. -I$(RTL) -o $@ $(SOURCES) $(EXTRA_DEFINES)

unittest:
make -C unittests check
$(MAKE) -C unittests check

.PHONY: clean unittest

18 changes: 9 additions & 9 deletions test/unittests/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
CROSS=lm32-elf-
CROSS_COMPILE ?= lm32-elf-

CC = $(CROSS)gcc
AS = $(CROSS)as
CC = $(CROSS_COMPILE)gcc
AS = $(CROSS_COMPILE)as
AS = $(CC) -x assembler
SIZE = $(CROSS)size
SIZE = $(CROSS_COMPILE)size
LD = $(CC)
OBJCOPY = $(CROSS)objcopy
OBJCOPY = $(CROSS_COMPILE)objcopy

LDFLAGS = -Tlinker.ld
LDFLAGS = -Tlinker.ld -nostdlib -lgcc
ASFLAGS += -Wa,-I,.

CRT = crt.o
@@ -108,15 +108,15 @@ test_mmu_nop3.S: test_mmu.S
build: $(CRT) $(TESTCASES) $(TESTCASES:.elf=.vh)

check: $(TESTCASES:.elf=.vh)
@make -C .. tb_lm32_system
@$(MAKE) -C .. tb_lm32_system
@for case in $(TESTCASES:.elf=.vh); do \
echo -e "\nRunning test case $$case"; \
vvp ../tb_lm32_system +prog=$$case; \
done

check_%: test_%.vh
@make -C .. tb_lm32_system
@$(MAKE) -C .. tb_lm32_system
vvp ../tb_lm32_system +prog=$<

clean:
$(RM) -fr $(TESTCASES) $(TESTCASES:.elf=.vh) $(CRT) *nop?.S tb_lm32.vcd
$(RM) $(TESTCASES) $(TESTCASES:.elf=.vh) $(CRT) *nop?.S tb_lm32.vcd