gateware/icE1usb: Add custom pre-pack optimizations to fix build
Without theses there are too many control-sets generated by yosys and
nextpnr can't find any valid placement.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
diff --git a/gateware/icE1usb/data/opt.py b/gateware/icE1usb/data/opt.py
new file mode 100644
index 0000000..2d8fcdb
--- /dev/null
+++ b/gateware/icE1usb/data/opt.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+
+# Add import path to script provided by no2build
+sys.path.insert(0, os.path.join(os.getenv('NO2BUILD_DIR', '../build'), 'sw'))
+
+import ice40_opt_cset
+import ice40_opt_lutdup
+
+ice40_opt_cset.run_opt(ctx, threshold=8)
+ice40_opt_lutdup.run_opt(ctx)