FreeCalypso > hg > fc-pcm-if
annotate fpga/tools/yosys-tee @ 5:3ae4a6ca5639
add README
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 12 Oct 2024 03:11:17 +0000 |
parents | 4624f3da093a |
children |
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 4 ] |
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 report-out 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 report="$3" |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
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 shift |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 shift |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 rm -f "$json" |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 yosys -p "synth_ice40 -top $top -json $json" "$@" | tee "$report" |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 if [ -f "$json" ] |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 then |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 echo "$json created, declaring success" |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 exit 0 |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 else |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 echo "$json NOT created, declaring error" |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 exit 1 |
4624f3da093a
starting project with FPGA infra from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 fi |