mirror of https://github.com/YosysHQ/icestorm.git
Added iCEZUM example
This commit is contained in:
parent
7d8337a138
commit
47d28bff12
|
|
@ -0,0 +1,4 @@
|
|||
example.bin
|
||||
example.blif
|
||||
example.asc
|
||||
example.rpt
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
PROJ = example
|
||||
PIN_DEF = icezum.pcf
|
||||
DEVICE = hx1k
|
||||
|
||||
all: $(PROJ).rpt $(PROJ).bin
|
||||
|
||||
%.blif: %.v
|
||||
yosys -p 'synth_ice40 -top top -blif $@' $<
|
||||
|
||||
%.asc: $(PIN_DEF) %.blif
|
||||
arachne-pnr -d $(subst hx,,$(subst lp,,$(DEVICE))) -o $@ -p $^
|
||||
|
||||
%.bin: %.asc
|
||||
icepack $< $@
|
||||
|
||||
%.rpt: %.asc
|
||||
icetime -d $(DEVICE) -mtr $@ $<
|
||||
|
||||
prog: $(PROJ).bin
|
||||
iceprog $<
|
||||
|
||||
sudo-prog: $(PROJ).bin
|
||||
@echo 'Executing prog as root!!!'
|
||||
sudo iceprog $<
|
||||
|
||||
clean:
|
||||
rm -f $(PROJ).blif $(PROJ).asc $(PROJ).rpt $(PROJ).bin
|
||||
|
||||
.SECONDARY:
|
||||
.PHONY: all prog clean
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
module top (
|
||||
input clk,
|
||||
output LED0,
|
||||
output LED1,
|
||||
output LED2,
|
||||
output LED3,
|
||||
output LED4,
|
||||
output LED5,
|
||||
output LED6,
|
||||
output LED7
|
||||
);
|
||||
|
||||
localparam BITS = 3;
|
||||
localparam LOG2DELAY = 20;
|
||||
|
||||
reg [BITS+LOG2DELAY-1:0] counter = 0;
|
||||
reg [BITS-1:0] outcnt;
|
||||
|
||||
always@(posedge clk) begin
|
||||
counter <= counter + 1;
|
||||
outcnt <= counter >> LOG2DELAY;
|
||||
end
|
||||
|
||||
assign {LED7, LED6, LED5, LED4, LED3, LED2, LED1, LED0} = 1 << outcnt;
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
set_io LED0 95
|
||||
set_io LED1 96
|
||||
set_io LED2 97
|
||||
set_io LED3 98
|
||||
set_io LED4 99
|
||||
set_io LED5 101
|
||||
set_io LED6 102
|
||||
set_io LED7 104
|
||||
set_io clk 21
|
||||
Loading…
Reference in New Issue