diff --git a/5a-75b/blink/blink_v82.lpf b/5a-75b/blink/blink_v82.lpf new file mode 100644 index 0000000..ba8d370 --- /dev/null +++ b/5a-75b/blink/blink_v82.lpf @@ -0,0 +1,6 @@ + +LOCATE COMP "osc_clk25" SITE "P6"; +LOCATE COMP "led" SITE "T6"; +LOCATE COMP "button" SITE "R7"; +LOCATE COMP "phy_rst_" SITE "R6"; +LOCATE COMP "bomb" SITE "C4"; diff --git a/5a-75b/playground/.gitignore b/5a-75b/playground/.gitignore new file mode 100644 index 0000000..46ece4c --- /dev/null +++ b/5a-75b/playground/.gitignore @@ -0,0 +1,2 @@ +.*.swp +build/ diff --git a/5a-75b/playground/Makefile b/5a-75b/playground/Makefile new file mode 100644 index 0000000..77794ac --- /dev/null +++ b/5a-75b/playground/Makefile @@ -0,0 +1,28 @@ +all:build/playground.svf build/playground.bit + +SYNTH_SRCS=main.v + +PACKAGE=CABGA256 +LFP=blink_v82.lpf + +build/playground.json: $(SYNTH_SRCS) + yosys -p 'read_verilog $(SYNTH_SRCS); synth_ecp5 -top playground -abc9 -json $@' + +build/playground.config: build/playground.json $(LPF) + nextpnr-ecp5 --25k --package $(PACKAGE) --speed 6 --lpf $(LFP) --json build/playground.json --textcfg build/playground.config --freq 25 + +build/playground.svf: build/playground.config + ecppack --compress --input $< --svf $@ + +build/playground.bit: build/playground.config + ecppack --compress --input $< --bit $@ + +prog: build/playground.bit + openFPGALoader -c usb-blaster --vid 0x09fb --pid 0x6001 build/playground.bit + +flash: build/playground.bit + # ERASES THE DEFAULT CONTENTS OF THE SPI FLASH! + openFPGALoader -c usb-blaster --vid 0x09fb --pid 0x6001 --unprotect-flash -f build/playground.bit + +clean: + rm -f build/* diff --git a/5a-75b/playground/blink_v82.lpf b/5a-75b/playground/blink_v82.lpf new file mode 100644 index 0000000..ba8d370 --- /dev/null +++ b/5a-75b/playground/blink_v82.lpf @@ -0,0 +1,6 @@ + +LOCATE COMP "osc_clk25" SITE "P6"; +LOCATE COMP "led" SITE "T6"; +LOCATE COMP "button" SITE "R7"; +LOCATE COMP "phy_rst_" SITE "R6"; +LOCATE COMP "bomb" SITE "C4"; diff --git a/5a-75b/playground/main.v b/5a-75b/playground/main.v new file mode 100644 index 0000000..bd7b847 --- /dev/null +++ b/5a-75b/playground/main.v @@ -0,0 +1,20 @@ +`default_nettype none + +module playground( + input wire osc_clk25, + input wire button, + output wire led, + output wire phy_rst_ +); + + reg [25:0] cntr = 0; + + always @(posedge osc_clk25) + begin + cntr <= cntr + 1; + end + + assign led = cntr[23] ^ button; + assign phy_rst_ = 1'b1; + +endmodule \ No newline at end of file