Permalink
Browse files

Merge branch 'patch-1' of https://github.com/jpbonn/milkymist into le…

…dmtrx
  • Loading branch information...
2 parents 978b8e2 + 1ca596d commit b903b25795c20fb335329d5cf570091eafd2216c @wpwrak wpwrak committed Apr 3, 2012
View
@@ -16,16 +16,16 @@ SW_DIRS=${SDK_DIRS} libhpdmc libfpvm libfpvm/x86-linux libfpvm/lm32-linux bios
CORE_DIRS=ac97 bt656cap conbus dmx fmlbrg fmlmeter hpdmc_ddr32 \
memcard pfpu rc5 softusb sysctl tmu2 uart vgafb
-host:
+tools:
make -C ${BASEDIR}/tools
-bios: host
+bios: tools
make -C ${BASEDIR}/software/bios
-bitstream: host
+bitstream: tools
make -C ${BASEDIR}/boards/${BOARD}/synthesis -f Makefile.${SYNTOOL}
-sdk: host
+sdk: tools
for d in $(SDK_DIRS); do make -C ${BASEDIR}/software/$$d || exit 1; done
load-bitstream: bitstream
@@ -35,7 +35,14 @@ docs:
make -C ${BASEDIR}/doc
for d in $(CORE_DIRS); do make -C ${BASEDIR}/cores/$$d/doc || exit 1; done
-.PHONY: clean load-bitstream
+sdk-install: sdk
+ make -C ${BASEDIR}/software/libfpvm install
+ make -C ${BASEDIR}/softusb-input install
+
+tools-install: tools
+ make -C ${BASEDIR}/tools install
+
+.PHONY: clean load-bitstream tools
clean:
make -C ${BASEDIR}/boards/milkymist-one/synthesis -f common.mak clean
make -C ${BASEDIR}/boards/milkymist-one/standby clean
View
65 README
@@ -10,13 +10,11 @@ For the latest releases, documentation, more information, or to buy a Milkymist
[> Directory Structure
/cores/ Cores library, with Verilog sources, test benches and documentation.
- /boards/ Top-level design files, constraint files and Makefiles
- for supported FPGA boards.
- /software/ Software for the SoC: libraries, bootloader and proof-of-concept renderer.
+ /boards/ Top-level design files, constraint files and glue logic.
+ /software/ Basic software for the SoC: libraries + BIOS.
/softusb-input/ AVR firmware to implement input device support on the softusb core.
/doc/ System documentation.
/tools/ Small tools for developers.
- /patches/ Example patches.
[> Building tools
@@ -45,9 +43,9 @@ loading over the serial line (SFL boot) is provided in the /tools/ directory.
[> Credits
-Most of the work is (C) Copyright 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq.
+Most of the work is (C) Copyright 2007-2012 Sebastien Bourdeauducq.
For this work:
- - The hardware design is licensed under GNU GPLv3.
+ - The gateware design is licensed under GNU GPLv3.
See the LICENSE.GPL file for more information.
- The software (software/*) is licensed under GNU GPLv3, except the SDRAM
initialization runtime (libHPDMC) which is under GNU LGPLv3.
@@ -64,15 +62,14 @@ The SoC design uses:
The directory organization and build scripts were inspired by soc-lm32 by the German
hackerspace Das Labor. Some of the UART and timer code also comes from there.
-The software and software library include:
- - the SoftFloat IEC/IEEE Floating-point Arithmetic Package, Release 2,
- written by John R. Hauser. See source files headers for license.
- - fundamental functions library by Jesus Calvino-Fraga. See the LICENSE.LGPL file.
- - line drawing code from the GD library. See the LICENSE.GD file.
+The software and software library include the SoftFloat IEC/IEEE Floating-point
+Arithmetic Package, Release 2, written by John R. Hauser.
+See source files headers for license.
Special thanks to the people who did significant things which made this project possible:
- Wolfgang Spraul and Adam Wang for the manufacturing,
- - Michael Walle for QEMU, UrJTAG and OpenOCD,
+ - Werner Almesberger for USB, MIDI and many other improvements,
+ - Michael Walle for QEMU, UrJTAG and OCD,
- Joachim Steiger for the case design,
- Yanjun Luo for the JTAG daughterboard design,
- Yann Sionneau for his work on RTEMS,
@@ -89,47 +86,3 @@ Special thanks to the people who did significant things which made this project
The mailing list devel at lists dot milkymist dot org is the preferred means of contact.
However, if you wish to contact privately the founder of this project:
E-mail: sebastien at milkymist daaht org
-Phone: +33(0)606644335
-PGP: 0x9277FCF2
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.9 (GNU/Linux)
-
-mQGiBEnPSIoRBADK2T3lN98btWazmH8Wz8YX6ZY38l9ouq5CgucTYWgljUTB6WMI
-P3LPAKjp+LpaeeHC3C9cJcWqI1AmrcoemqUjeeez1Y9TIPSL4Qy5mp3pEQ/evxYy
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EBYXL/WSd/zybSEAniuiaCR/7aYk94u06jiQ
-lRHoJGwiAJ9JnmgPtl71/XVNcFxNQqUxVTOvjg==
-=NnZi
------END PGP PUBLIC KEY BLOCK-----
@@ -923,7 +923,7 @@ sysctl #(
.ninputs(7),
.noutputs(2),
.clk_freq(`CLOCK_FREQUENCY),
- .systemid(32'h12004D31) /* 1.2.0 final (0) on M1 */
+ .systemid(32'h13004D31) /* 1.3.0 final (0) on M1 */
) sysctl (
.sys_clk(sys_clk),
.sys_rst(sys_rst),
@@ -18,7 +18,7 @@ load: $(BUILDDIR)/system.bit
# Sometimes different options are needed to meet timing
build/system.ncd: build/system.ngd
- cd build && map -ol high -t 2 -w system.ngd
+ cd build && map -ol high -t 20 -w system.ngd
build/system-routed.ncd: build/system.ncd
cd build && par -ol high -w system.ncd system-routed.ncd
@@ -76,8 +76,11 @@ softusb_timer timer(
.io_do(io_dr_timer)
);
+wire [pmem_width-1:0] dbg_pc;
+
softusb_hostif #(
- .csr_addr(csr_addr)
+ .csr_addr(csr_addr),
+ .pmem_width(pmem_width)
) hostif (
.sys_clk(sys_clk),
.sys_rst(sys_rst),
@@ -93,7 +96,9 @@ softusb_hostif #(
.irq(irq),
.io_we(io_we),
- .io_a(io_a)
+ .io_a(io_a),
+
+ .dbg_pc(dbg_pc)
);
softusb_sie sie(
@@ -178,7 +183,9 @@ softusb_navre #(
.io_we(io_we),
.io_a(io_a),
.io_do(io_dw),
- .io_di(io_dr_sie|io_dr_timer)
+ .io_di(io_dr_sie|io_dr_timer),
+
+ .dbg_pc(dbg_pc)
);
endmodule
@@ -16,7 +16,8 @@
*/
module softusb_hostif #(
- parameter csr_addr = 4'h0
+ parameter csr_addr = 4'h0,
+ parameter pmem_width = 12
) (
input sys_clk,
input sys_rst,
@@ -32,7 +33,9 @@ module softusb_hostif #(
output irq,
input io_we,
- input [5:0] io_a
+ input [5:0] io_a,
+
+ input [pmem_width-1:0] dbg_pc
);
wire csr_selected = csr_a[13:10] == csr_addr;
@@ -48,7 +51,7 @@ always @(posedge sys_clk) begin
if(csr_selected) begin
if(csr_we)
usb_rst0 <= csr_di[0];
- csr_do <= usb_rst0;
+ csr_do <= { dbg_pc, 1'b0 };
end
end
end
@@ -35,7 +35,9 @@ module softusb_navre #(
output reg io_we,
output [5:0] io_a,
output [7:0] io_do,
- input [7:0] io_di
+ input [7:0] io_di,
+
+ output reg [pmem_width-1:0] dbg_pc
);
/* Register file */
@@ -195,6 +197,7 @@ always @(posedge clk) begin
PC_SEL_Z: PC <= pZ - 1;
endcase
end
+ dbg_pc <= PC;
end
reg pmem_selz;
assign pmem_a = rst ?
@@ -88,9 +88,9 @@ always @(posedge sys_clk) begin
hscan <= 10'd799;
vres <= 10'd480;
- vsync_start <= 10'd491;
- vsync_end <= 10'd493;
- vscan <= 10'd523;
+ vsync_start <= 10'd492;
+ vsync_end <= 10'd494;
+ vscan <= 10'd524;
baseaddress <= {fml_depth{1'b0}};
View
@@ -1,14 +1,32 @@
SOURCES=crt0.S main.c debug.c crc.c libc.c
+INCLUDES=comloc.h crc.h debug.h host.h io.h libc.h progmem.h sie.h timer.h
-all: softusb-input.bin
+.PHONY: all install upload clean
+
+all: softusb-input.h
+
+softusb-input.elf: $(SOURCES) $(INCLUDES)
+ avr-gcc -o $@ -mmcu=avr2 -mno-interrupts -Os \
+ -Wall -Wstrict-prototypes -Wmissing-prototypes \
+ -Wold-style-declaration -Wold-style-definition \
+ -Wno-char-subscripts \
+ $(SOURCES) $(CFLAGS) -nostdlib -Wl,-T -Wl,navre.ld
%.bin: %.elf
avr-objcopy -O binary $< $@
-softusb-input.elf: $(SOURCES) $(wildcard *.h)
- avr-gcc -o softusb-input.elf -mmcu=avr2 -mno-interrupts -Wall -Os $(SOURCES) $(CFLAGS) -nostdlib -Wl,-T -Wl,navre.ld
+softusb-input.h: softusb-input.bin
+ cat $< | xxd -i - $@
+
+install: softusb-input.h
+ test -n "$(RTEMS_MAKEFILE_PATH)"
+ mkdir -p $(RTEMS_MAKEFILE_PATH)/lib/include
+ cp $< $(RTEMS_MAKEFILE_PATH)/lib/include
-.PHONY: clean
+upload: softusb-input.bin
+ @[ "$(MM_HOST)" ] && [ "$(MM_USER)" ] && [ "$(MM_PW)" ] || \
+ { echo "please define MM_HOST, MM_USER, and MM_PW"; exit 1; }
+ ftp-upload --host $(MM_HOST) --user $(MM_USER) --password $(MM_PW) $<
clean:
- rm -f softusb-input.bin softusb-input.elf
+ rm -f softusb-input.elf softusb-input.bin softusb-input.h
View
@@ -18,6 +18,7 @@
#include "progmem.h"
#include "host.h"
#include "comloc.h"
+#include "debug.h"
void print_char(char c)
{
@@ -59,13 +60,11 @@ void dump_hex(unsigned char *buf, unsigned char len)
} else {
for(i=0;i<len;i++) {
print_hex(buf[i]);
- if(((i & 0x0f) == 0) && (i != 0))
+ if((i & 0x0f) == 0xf)
print_char('\n');
else
print_char(' ');
}
- if(i & 0x0f)
- print_char('\n');
}
}
Oops, something went wrong.

0 comments on commit b903b25

Please sign in to comment.