Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add blink_v82 and playground folder. #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions 5a-75b/blink/blink_v82.lpf
Original file line number Diff line number Diff line change
@@ -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";
2 changes: 2 additions & 0 deletions 5a-75b/playground/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.*.swp
build/
28 changes: 28 additions & 0 deletions 5a-75b/playground/Makefile
Original file line number Diff line number Diff line change
@@ -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/*
6 changes: 6 additions & 0 deletions 5a-75b/playground/blink_v82.lpf
Original file line number Diff line number Diff line change
@@ -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";
20 changes: 20 additions & 0 deletions 5a-75b/playground/main.v
Original file line number Diff line number Diff line change
@@ -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