Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 7 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
View
1  .gitignore
@@ -1,6 +1,7 @@
__pycache__
build/*
*.o
+*.ts
*.d
*.a
*.bin
View
15 README
@@ -7,7 +7,7 @@ introducing two key innovations:
* Increased system memory performance thanks to a new architecture
(ASMI) containing a transaction-reordering and superscalar controller.
-The Milkymist-NG SoC supports the Milkymist One board. Obtain yours from:
+The Milkymist-NG SoC supports the Milkymist One board. Obtain yours at:
http://milkymist.org
Note that the -NG version is still experimental work in progress. For the
@@ -31,15 +31,12 @@ production version of Milkymist SoC, visit:
make
make install
-3. Build compiler-rt.
- git clone git://github.com/milkymist/compiler-rt-lm32.git
- cd compiler-rt-lm32
- make lm32
+3. Obtain compiler-rt and set the CRTDIR environment variable to the root of
+ its source tree.
+ svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
+ export CRTDIR=/path_to/compiler-rt
-4. Set the CRTDIR environment variable to where libcompiler_rt.a is.
- export CRTDIR=/path_to/compiler-rt-lm32/lm32/lm32
-
-5. Build and flash the BIOS (part of this source distribution).
+4. Build and flash the BIOS (part of this source distribution).
cd software/bios
make
make flash
View
10 software/bios/Makefile
@@ -20,20 +20,24 @@ bios-rescue.elf: linker-rescue.ld $(OBJECTS) libs
%.elf:
$(LD) $(LDFLAGS) -T $< -N -o $@ $(OBJECTS) \
-L$(M2DIR)/software/libbase \
- -L$(CRTDIR) \
- -lbase -lcompiler_rt
+ -L$(M2DIR)/software/libcompiler-rt \
+ -lbase -lcompiler-rt
chmod -x $@
%.o: %.c
$(compile-dep)
+%.o: %.S
+ $(assemble)
+
libs:
+ make -C $(M2DIR)/software/libcompiler-rt
make -C $(M2DIR)/software/libbase
flash: bios.bin
m1nor bios.bin
clean:
- rm -f $(OBJECTS) $(OBJECTS:.o=.d) bios.elf bios.bin bios-rescue.elf bios-rescue.bin .*~ *~
+ rm -f $(OBJECTS) $(OBJECTS:.o=.ts) $(OBJECTS:.o=.d) bios.elf bios.bin bios-rescue.elf bios-rescue.bin .*~ *~
.PHONY: clean libs flash
View
39 software/common.mak
@@ -1,48 +1,57 @@
TARGET_PREFIX=lm32-elf
-CLANG=clang -ccc-host-triple $(TARGET_PREFIX)
+CLANG=clang -target lm32
CC_normal := $(CLANG)
+AS_normal := $(TARGET_PREFIX)-as
AR_normal := $(TARGET_PREFIX)-ar
LD_normal := $(TARGET_PREFIX)-ld
OBJCOPY_normal := $(TARGET_PREFIX)-objcopy
RANLIB_normal := $(TARGET_PREFIX)-ranlib
CC_quiet = @echo " CC " $@ && $(CLANG)
+AS_quiet = @echo " AS " $@ && $(TARGET_PREFIX)-as
AR_quiet = @echo " AR " $@ && $(TARGET_PREFIX)-ar
LD_quiet = @echo " LD " $@ && $(TARGET_PREFIX)-ld
OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(TARGET_PREFIX)-objcopy
RANLIB_quiet = @echo " RANLIB " $@ && $(TARGET_PREFIX)-ranlib
ifeq ($(V),1)
- CC = $(CC_normal)
- AR = $(AR_normal)
- LD = $(LD_normal)
- OBJCOPY = $(OBJCOPY_normal)
- RANLIB = $(RANLIB_normal)
+ CC = $(CC_normal)
+ AS = $(AS_normal)
+ AR = $(AR_normal)
+ LD = $(LD_normal)
+ OBJCOPY = $(OBJCOPY_normal)
+ RANLIB = $(RANLIB_normal)
else
- CC = $(CC_quiet)
- AR = $(AR_quiet)
- LD = $(LD_quiet)
- OBJCOPY = $(OBJCOPY_quiet)
- RANLIB = $(RANLIB_quiet)
+ CC = $(CC_quiet)
+ AS = $(AS_quiet)
+ AR = $(AR_quiet)
+ LD = $(LD_quiet)
+ OBJCOPY = $(OBJCOPY_quiet)
+ RANLIB = $(RANLIB_quiet)
endif
# Toolchain options
#
INCLUDES = -I$(M2DIR)/software/include/base -I$(M2DIR)/software/include -I$(M2DIR)/common
-CFLAGS = -O9 -Wall -Wstrict-prototypes -Wold-style-definition -Wshadow \
- -Wmissing-prototypes -fsigned-char -nostdinc $(INCLUDES)
+CFLAGS = -O3 -Wall -Wstrict-prototypes -Wold-style-definition -Wshadow \
+ -Wmissing-prototypes -nostdinc $(INCLUDES)
LDFLAGS = -nostdlib -nodefaultlibs
# compile and generate dependencies, based on
# http://scottmcpeak.com/autodepend/autodepend.html
-define compile-dep =
-$(CC) -c $(CFLAGS) $< -o $*.o
+define compile-dep
+$(CC) -c $(CFLAGS) $< -o $*.ts -S
@$(CC_normal) -MM $(CFLAGS) $< > $*.d
@mv -f $*.d $*.d.tmp
@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
@rm -f $*.d.tmp
+@$(AS_normal) -o $*.o $*.ts
+endef
+
+define assemble
+$(AS) -o $*.o $<
endef
View
20 software/include/base/stdint.h
@@ -3,5 +3,23 @@
typedef unsigned int uintptr_t;
-#endif /* __STDINT_H */
+typedef unsigned long long uint64_t;
+typedef unsigned int uint32_t;
+typedef unsigned short uint16_t;
+typedef unsigned char uint8_t;
+
+typedef long long int64_t;
+typedef int int32_t;
+typedef short int16_t;
+typedef char int8_t;
+
+#define __int_c_join(a, b) a ## b
+#define __int_c(v, suffix) __int_c_join(v, suffix)
+#define __uint_c(v, suffix) __int_c_join(v##U, suffix)
+#define INT64_C(v) __int_c(v, LL)
+#define UINT64_C(v) __uint_c(v, LL)
+#define INT32_C(v) v
+#define UINT32_C(v) v##U
+
+#endif /* __STDINT_H */
View
5 software/libbase/Makefile
@@ -15,7 +15,10 @@ libbase.a: $(OBJECTS)
%.o: %.c
$(compile-dep)
+%.o: %.S
+ $(assemble)
+
.PHONY: clean
clean:
- rm -f $(OBJECTS) $(OBJECTS:.o=.d) libbase.a .*~ *~
+ rm -f $(OBJECTS) $(OBJECTS:.o=.ts) $(OBJECTS:.o=.d) libbase.a .*~ *~
View
24 software/libcompiler-rt/Makefile
@@ -0,0 +1,24 @@
+M2DIR=../..
+include $(M2DIR)/software/common.mak
+
+CFLAGS+=-D_YUGA_LITTLE_ENDIAN=0 -D_YUGA_BIG_ENDIAN=1 -Wno-missing-prototypes
+
+OBJECTS=divsi3.o modsi3.o comparedf2.o negsf2.o negdf2.o addsf3.o subsf3.o mulsf3.o divsf3.o lshrdi3.o muldi3.o divdi3.o ashldi3.o ashrdi3.o udivmoddi4.o \
+ floatsisf.o floatunsisf.o fixsfsi.o fixunssfsi.o adddf3.o subdf3.o muldf3.o divdf3.o floatsidf.o floatunsidf.o floatdidf.o fixdfsi.o fixunsdfsi.o
+
+all: libcompiler-rt.a
+
+# pull in dependency info for *existing* .o files
+-include $(OBJECTS:.o=.d)
+
+libcompiler-rt.a: $(OBJECTS)
+ $(AR) clr libcompiler-rt.a $(OBJECTS)
+ $(RANLIB) libcompiler-rt.a
+
+%.o: $(CRTDIR)/lib/%.c
+ $(compile-dep)
+
+.PHONY: clean
+
+clean:
+ rm -f $(OBJECTS) $(OBJECTS:.o=.ts) $(OBJECTS:.o=.d) libcompiler-rt.a .*~ *~

No commit comments for this range

Something went wrong with that request. Please try again.