Browse Source

Trellis and cleanup

pull/1/head
Konrad Beckmann 3 years ago
parent
commit
47a62d4b60
8 changed files with 12439 additions and 23 deletions
  1. +28
    -0
      gateware/blinky/Makefile
  2. +19
    -0
      gateware/blinky/blinky.v
  3. +80
    -0
      gateware/blinky/kilsyth.lpf
  4. +15
    -0
      gateware/bootloader/Makefile
  5. +0
    -0
      gateware/bootloader/bootloader.svf
  6. +12297
    -0
      gateware/bootloader/kilsyth_bootloader.svf
  7. +0
    -11
      openocd/flash.sh
  8. +0
    -12
      openocd/kilsyth_lfe5u12.cfg

+ 28
- 0
gateware/blinky/Makefile View File

@ -0,0 +1,28 @@
PROJ=blinky
OPENOCD_INTERFACE:=interface/ftdi/dp_busblaster.cfg
ifndef TRELLIS
$(error Set TRELLIS to Trellis git root)
endif
all: ${PROJ}.bit
%.json: %.v
yosys -p "synth_ecp5 -noccu2 -nobram -nomux -json $@" $<
%_out.config: %.json
nextpnr-ecp5 --json $< --basecfg $(TRELLIS)/misc/basecfgs/empty_lfe5u-25f.config --textcfg $@ --25k --package CABGA381 --lpf kilsyth.lpf
%.bit: %_out.config
# lfe5u12f: 0x21111043 = 554766403
ecppack --idcode 554766403 --svf ${PROJ}.svf $< $@
${PROJ}.svf : ${PROJ}.bit
prog: ${PROJ}.svf
openocd -f $(OPENOCD_INTERFACE) -f ../../openocd/kilsyth_lfe5u12.cfg -c "transport select jtag; adapter_khz 10000; init; svf -tap lfe5u12.tap -quiet -progress $<; exit"
clean:
rm -f *.svf *.bit *.config *.json
.PHONY: prog clean

+ 19
- 0
gateware/blinky/blinky.v View File

@ -0,0 +1,19 @@
`default_nettype none
module kilsyth_top(
input wire i_clk16,
output wire[7:0] o_leds
);
reg [25:0] counter = 0;
reg [7:0] leds = 0;
assign o_leds = leds;
/* This clock is _always_ ticking */
always @(posedge i_clk16) begin
counter <= counter + 1;
leds <= counter[25:25-7];
end
endmodule

+ 80
- 0
gateware/blinky/kilsyth.lpf View File

@ -0,0 +1,80 @@
BLOCK RESETPATHS ;
BLOCK ASYNCPATHS ;
VOLTAGE 1.100 V;
BANK 0 VCCIO 3.3 V;
BANK 1 VCCIO 3.3 V;
BANK 2 VCCIO 3.3 V;
BANK 3 VCCIO 3.3 V;
BANK 6 VCCIO 3.3 V;
BANK 7 VCCIO 3.3 V;
BANK 8 VCCIO 3.3 V;
VCCIO_DERATE PERCENT 0;
SYSCONFIG MASTER_SPI_PORT=DISABLE CONFIG_IOVOLTAGE=3.3 ;
LOCATE COMP "i_clk16" SITE "G3" ;
LOCATE COMP "o_leds[7]" SITE "C11" ;
LOCATE COMP "o_leds[6]" SITE "B11" ;
LOCATE COMP "o_leds[5]" SITE "C10" ;
LOCATE COMP "o_leds[4]" SITE "A11" ;
LOCATE COMP "o_leds[3]" SITE "A10" ;
LOCATE COMP "o_leds[2]" SITE "B10" ;
LOCATE COMP "o_leds[1]" SITE "B9" ;
LOCATE COMP "o_leds[0]" SITE "A9" ;
IOBUF PORT "i_clk16" IO_TYPE=LVCMOS33 ;
IOBUF PORT "o_leds[7]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "o_leds[6]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "o_leds[5]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "o_leds[4]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "o_leds[3]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "o_leds[2]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "o_leds[1]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "o_leds[0]" IO_TYPE=LVCMOS33 ;
LOCATE COMP "io_ft_data[0]" SITE "P4" ;
LOCATE COMP "io_ft_data[1]" SITE "P3" ;
LOCATE COMP "io_ft_data[2]" SITE "P2" ;
LOCATE COMP "io_ft_data[3]" SITE "P1" ;
LOCATE COMP "io_ft_data[4]" SITE "N4" ;
LOCATE COMP "io_ft_data[5]" SITE "N3" ;
LOCATE COMP "io_ft_data[6]" SITE "N2" ;
LOCATE COMP "io_ft_data[7]" SITE "N1" ;
LOCATE COMP "io_ft_data[8]" SITE "M3" ;
LOCATE COMP "io_ft_data[9]" SITE "M1" ;
LOCATE COMP "io_ft_data[10]" SITE "L3" ;
LOCATE COMP "io_ft_data[11]" SITE "L2" ;
LOCATE COMP "io_ft_data[12]" SITE "L1" ;
LOCATE COMP "io_ft_data[13]" SITE "K4" ;
LOCATE COMP "io_ft_data[14]" SITE "K3" ;
LOCATE COMP "io_ft_data[15]" SITE "K2" ;
IOBUF PORT "io_ft_data[0]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[1]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[2]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[3]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[4]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[5]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[6]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[7]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[8]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[9]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[10]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[11]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[12]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[13]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[14]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_data[15]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "i_ft_clk" IO_TYPE=LVCMOS33 ;
LOCATE COMP "io_ft_be[0]" SITE "K1" ;
LOCATE COMP "io_ft_be[1]" SITE "J5" ;
LOCATE COMP "o_ft_rd_n" SITE "M4" ;
LOCATE COMP "o_ft_wr_n" SITE "J1" ;
IOBUF PORT "io_ft_be[0]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_be[1]" IO_TYPE=LVCMOS33 ;
IOBUF PORT "o_ft_rd_n" IO_TYPE=LVCMOS33 ;
IOBUF PORT "o_ft_wr_n" IO_TYPE=LVCMOS33 ;
IOBUF PORT "io_ft_gpio1" IO_TYPE=LVCMOS33 ;
LOCATE COMP "i_ft_txe_n" SITE "J4" ;
IOBUF PORT "i_ft_rxf_n" IO_TYPE=LVCMOS33 ;
IOBUF PORT "i_ft_txe_n" IO_TYPE=LVCMOS33 ;
LOCATE COMP "i_ft_rxf_n" SITE "J3" ;
LOCATE COMP "i_ft_clk" SITE "H2" ;
FREQUENCY PORT "i_ft_clk" 100.000000 MHz ;
FREQUENCY PORT "i_clk16" 16.000000 MHz ;
IOBUF PORT "io_ft_oe_n" IO_TYPE=LVCMOS33 ;

+ 15
- 0
gateware/bootloader/Makefile View File

@ -0,0 +1,15 @@
PROJ=bootloader
OPENOCD_INTERFACE:=interface/ftdi/dp_busblaster.cfg
ifndef TRELLIS
$(error Set TRELLIS to Trellis git root)
endif
bootloader/kilsyth_bootloader.bit:
echo "Run diamond to build a .bit file!"
${PROJ}.svf: ./bootloader/kilsyth_bootloader.bit
$(TRELLIS)/tools/bit_to_svf.py ./bootloader/kilsyth_bootloader.bit $@
prog: ${PROJ}.svf
openocd -f $(OPENOCD_INTERFACE) -f ../../openocd/kilsyth_lfe5u12.cfg -c "transport select jtag; adapter_khz 10000; init; svf -tap lfe5u12.tap -quiet -progress $<; exit"

gateware/bootloader/bootloader/kilsyth_bootloader.svf → gateware/bootloader/bootloader.svf View File


+ 12297
- 0
gateware/bootloader/kilsyth_bootloader.svf
File diff suppressed because it is too large
View File


+ 0
- 11
openocd/flash.sh View File

@ -1,11 +0,0 @@
#!/bin/sh
if [ "$TRELLIS" = "" ]; then
echo "Set environment variable TRELLIS to your Trellis root"
exit
fi
$TRELLIS/tools/bit_to_svf.py ../gateware/bootloader/bootloader/kilsyth_bootloader.bit ../gateware/bootloader/bootloader/kilsyth_bootloader.svf
openocd -f interface/ftdi/dp_busblaster.cfg -c "transport select jtag; adapter_khz 10000;" -f kilsyth.cfg

openocd/kilsyth.cfg → openocd/kilsyth_lfe5u12.cfg View File


Loading…
Cancel
Save