aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2
diff options
context:
space:
mode:
Diffstat (limited to 'machxo2')
-rw-r--r--machxo2/examples/README.md8
-rw-r--r--machxo2/examples/simple.sh20
2 files changed, 14 insertions, 14 deletions
diff --git a/machxo2/examples/README.md b/machxo2/examples/README.md
index 13964602..d4a89f7a 100644
--- a/machxo2/examples/README.md
+++ b/machxo2/examples/README.md
@@ -1,8 +1,8 @@
# MachXO2 Architecture Example
This directory contains a simple example of running `nextpnr-machxo2`:
-* `simple.sh` generates JSON output (`{pack,place,pnr}blinky.json`) of a
- classic blinky example from `blinky.v`.
+* `simple.sh` produces nextpnr output in the files `{pack,place,pnr}*.json`,
+ as well as pre-pnr and post-pnr diagrams in `{pack,place,pnr}*.{dot, png}`.
* `simtest.sh` will use `yosys` to generate a Verilog file from
`{pack,place,pnr}blinky.json`, called `{pack,place,pnr}blinky.v`. It will
then and compare `{pack,place,pnr}blinky.v`'s simulation behavior to the
@@ -10,8 +10,8 @@ This directory contains a simple example of running `nextpnr-machxo2`:
compiler and `vvp` runtime. This is known as post-place-and-route simulation.
* `mitertest.sh` is similar to `simtest.sh`, but more comprehensive. This
script creates a [miter circuit](https://www21.in.tum.de/~lammich/2015_SS_Seminar_SAT/resources/Equivalence_Checking_11_30_08.pdf)
- to compare the output port values of `{pack,place,pnr}blinky.v` against the
- original `blinky.v` _when both modules are fed the same values on their input
+ to compare the output port values of `{pack,place,pnr}*.v` against the
+ original Verilog code _when both modules are fed the same values on their input
ports._
All possible inputs and resulting outputs can be tested in reasonable time by
diff --git a/machxo2/examples/simple.sh b/machxo2/examples/simple.sh
index c977bf1a..1da60933 100644
--- a/machxo2/examples/simple.sh
+++ b/machxo2/examples/simple.sh
@@ -1,11 +1,11 @@
#!/usr/bin/env bash
-if [ $# -lt 1 ]; then
- echo "Usage: $0 mode"
+if [ $# -lt 2 ]; then
+ echo "Usage: $0 prefix mode"
exit -1
fi
-case $1 in
+case $2 in
"pack")
NEXTPNR_MODE="--pack-only"
;;
@@ -23,12 +23,12 @@ esac
set -ex
-${YOSYS:-yosys} -p "read_verilog blinky.v
- synth_machxo2 -json blinky.json
- show -format png -prefix blinky"
-${NEXTPNR:-../../nextpnr-machxo2} $NEXTPNR_MODE --1200 --package QFN32 --no-iobs --json blinky.json --write ${1}blinky.json
+${YOSYS:-yosys} -p "read_verilog ${1}.v
+ synth_machxo2 -json ${1}.json
+ show -format png -prefix ${1}"
+${NEXTPNR:-../../nextpnr-machxo2} $NEXTPNR_MODE --1200 --package QFN32 --no-iobs --json ${1}.json --write ${2}${1}.json
${YOSYS:-yosys} -p "read_verilog -lib +/machxo2/cells_sim.v
- read_json ${1}blinky.json
+ read_json ${2}${1}.json
clean -purge
- show -format png -prefix ${1}blinky
- write_verilog -noattr -norename ${1}blinky.v"
+ show -format png -prefix ${2}${1}
+ write_verilog -noattr -norename ${2}${1}.v"