build/de0_nano.map: build/de0_nano.qsf
cp de0_nano.qpf build/de0_nano.qpf
+ cp de0_nano.sdc build/de0_nano.sdc
cd build && quartus_map de0_nano.qpf
build/de0_nano.fit: build/de0_nano.map
build/de0_nano.sta: build/de0_nano.asm
cd build && quartus_sta de0_nano.qpf
+load:
+ cd build && quartus_pgm.exe -m jtag -c USB-Blaster[USB-0] -o "p;de0_nano.sof"
+
clean:
rm -rf build/*
# generate Quartus project file
qsf_prj = get_qsf_prj()
-str2file("soc.qsf", qsf_prj + qsf_cst)
\ No newline at end of file
+str2file("de0_nano.qsf", qsf_prj + qsf_cst)
\ No newline at end of file
class Constraints:
- def __init__(self, in_clk, in_rst, spi2csr0, led0):
+ def __init__(self, in_clk, in_rst_n, spi2csr0, led0):
self.constraints = []
def add(signal, pin, vec=-1, iostandard="3.3-V LVTTL", extra="", sch=""):
self.constraints.append((signal, vec, pin, iostandard, extra,sch))
add(in_clk, "R8") # CLOCK_50
# sys_rst
- add(in_rst, "J15") # KEY[0]
+ add(in_rst_n, "J15") # KEY[0]
# spi2csr0
add(spi2csr0.spi_clk, "A14") #GPIO_2[0]
set_global_assignment -name RESERVE_DATA0_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_DATA1_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_DCLK_AFTER_CONFIGURATION "USE AS REGULAR IO"
+set_global_assignment -name DUTY_CYCLE 50 -section_id in_clk
+set_global_assignment -name FMAX_REQUIREMENT "50.0 MHz" -section_id in_clk
"""
return r
# HouseKeeping
in_clk = Signal()
+ in_rst_n = Signal()
in_rst = Signal()
+ comb += [
+ in_rst.eq(~in_rst_n)
+ ]
frag = autofragment.from_local()
frag += Fragment(sync=sync,comb=comb)
- cst = Constraints(in_clk, in_rst, spi2csr0, led0)
+ cst = Constraints(in_clk, in_rst_n, spi2csr0, led0)
src_verilog, vns = verilog.convert(frag,
cst.get_ios(),
name="de0_nano",