annotate fpga/tools/yosys-wrap @ 0:4624f3da093a

starting project with FPGA infra from fc-sim-sniff
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 11 Oct 2024 18:36:25 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #!/bin/sh
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 if [ $# -lt 3 ]
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 then
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 echo "usage: $0 top-module json-output verilog-src..." 1>&2
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 exit 1
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 fi
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 top="$1"
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 json="$2"
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 shift
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 shift
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 rm -f "$json"
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 yosys -p "synth_ice40 -top $top -json $json" "$@"
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 if [ -f "$json" ]
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 then
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 echo "$json created, declaring success"
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 exit 0
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 else
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 echo "$json NOT created, declaring error"
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 exit 1
4624f3da093a starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 fi