Cleanups in iCE40 blinky and picorv32 tests

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-07-18 13:46:00 +02:00
parent 609794f9e6
commit acdaec249a
4 changed files with 2 additions and 35 deletions

View File

@ -1,3 +1,3 @@
read_verilog blinky.v read_verilog blinky.v
synth_ice40 -top blinky -nocarry synth_ice40 -top blinky
write_json blinky.json write_json blinky.json

View File

@ -2,5 +2,5 @@
set -ex set -ex
rm -f picorv32.v rm -f picorv32.v
wget https://raw.githubusercontent.com/cliffordwolf/picorv32/master/picorv32.v wget https://raw.githubusercontent.com/cliffordwolf/picorv32/master/picorv32.v
yosys -p 'synth_ice40 -nocarry -json picorv32.json -top top' picorv32.v picorv32_top.v yosys -p 'synth_ice40 -json picorv32.json -top top' picorv32.v picorv32_top.v
../nextpnr-ice40 --hx8k --asc picorv32.asc --json picorv32.json ../nextpnr-ice40 --hx8k --asc picorv32.asc --json picorv32.json

View File

@ -1,9 +0,0 @@
#!/bin/bash
set -ex
rm -f picorv32.v
wget https://raw.githubusercontent.com/cliffordwolf/picorv32/master/picorv32.v
yosys -p 'synth_ice40 -nocarry -blif picorv32.blif -top top' picorv32.v picorv32_top.v
arachne-pnr -d 8k --post-place-blif picorv32_place.blif picorv32.blif -o picorv32_arachne_all.asc
yosys -p "read_blif -wideports picorv32_place.blif; read_verilog -lib +/ice40/cells_sim.v; write_json picorv32_place.json"
./transform_arachne_loc.py picorv32_place.json > picorv32_place_nx.json
../nextpnr-ice40 --hx8k --asc picorv32_ar_placed.asc --json picorv32_place_nx.json --force

View File

@ -1,24 +0,0 @@
#!/usr/bin/env python3
import json
import sys
import re
with open(sys.argv[1]) as f:
data = json.load(f)
for mod, moddata in data["modules"].items():
if "cells" in moddata:
for cell, celldata in moddata["cells"].items():
pos = re.split('[,/]', celldata["attributes"]["loc"])
pos = [int(_) for _ in pos]
if celldata["type"] == "ICESTORM_LC":
celldata["attributes"]["BEL"] = "X%d/Y%d/lc%d" % (pos[0], pos[1], pos[2])
elif celldata["type"] == "SB_IO":
celldata["attributes"]["BEL"] = "X%d/Y%d/io%d" % (pos[0], pos[1], pos[2])
elif "RAM" in celldata["type"]:
celldata["attributes"]["BEL"] = "X%d/Y%d/ram" % (pos[0], pos[1])
elif celldata["type"] == "SB_GB":
celldata["attributes"]["BEL"] = "X%d/Y%d/gb" % (pos[0], pos[1])
else:
assert False
print(json.dumps(data, sort_keys=True, indent=4))