-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ninja
40 lines (30 loc) · 1.07 KB
/
build.ninja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Project-specific settings
project = template
top = top
## board/device-specific settings
device = lp8k
package = cm81
f_in = 16
## end of user definitions
build_dir = build
rule create-build-directory
description = Create the build directory
command = mkdir -p $out
# run the synthese to produce a JSON output
rule synthesize
description = Synthesize Verilog design
command = yosys -q -p 'synth_ice40 -top $top -json $out' $in
rule place-n-route
description = Place'n'route
command = nextpnr-ice40 --quiet --$device --package $package --top $top --json $in --pcf constraints.pcf --asc $out
rule pack
description = Generating the final FPGA bitstream
command = icepack $in $out
rule gen-pll
description = Generate PLL settings file
command = icepll -i $f_in -o 100 -m -f $out
build $build_dir: create-build-directory
build $build_dir/pll.v: gen-pll
build $build_dir/$project.json: synthesize $top.v $build_dir/pll.v
build $build_dir/$project.asc: place-n-route $build_dir/$project.json
build $build_dir/$project.bin: pack $build_dir/$project.asc