aboutsummaryrefslogtreecommitdiffstats
path: root/generic/examples/simple.py
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-04-17 11:00:23 +0100
committerDavid Shah <dave@ds0.me>2019-04-17 11:00:23 +0100
commit48c4c1ed0561e643a591ed7fca21c69954abd8d2 (patch)
treee5a91b0f2f5b090a0109a278343c54e34b5dada0 /generic/examples/simple.py
parent90ceb829f347372975310d40d2bb6bade0352890 (diff)
downloadnextpnr-48c4c1ed0561e643a591ed7fca21c69954abd8d2.tar.gz
nextpnr-48c4c1ed0561e643a591ed7fca21c69954abd8d2.tar.bz2
nextpnr-48c4c1ed0561e643a591ed7fca21c69954abd8d2.zip
generic/examples: Add FASM writer Python script
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'generic/examples/simple.py')
-rw-r--r--generic/examples/simple.py22
1 files changed, 1 insertions, 21 deletions
diff --git a/generic/examples/simple.py b/generic/examples/simple.py
index f87a6049..9339b68a 100644
--- a/generic/examples/simple.py
+++ b/generic/examples/simple.py
@@ -1,22 +1,4 @@
-# Grid size including IOBs at edges
-X = 12
-Y = 12
-# SLICEs per tile
-N = 8
-# LUT input count
-K = 4
-# Number of local wires
-Wl = N*(K+1) + 8
-# 1/Fc for bel input wire pips
-Si = 4
-# 1/Fc for Q to local wire pips
-Sq = 4
-# ~1/Fc local to neighbour local wire pips
-Sl = 8
-
-# Create graphic elements
-# Bels
-ctx.addDecalGraphic("bel", GraphicElement(type=TYPE_BOX, style=STYLE_INACTIVE, x1=0, y1=0, x2=0.2, y2=(1/(N+1))-0.02, z=0))
+from simple_config import *
def is_io(x, y):
return x == 0 or x == X-1 or y == 0 or y == Y-1
@@ -41,7 +23,6 @@ for x in range(X):
ctx.addBelInput(bel="X%dY%d_IO%d" % (x, y, z), name="I", wire="X%dY%dZ%d_I0" % (x, y, z))
ctx.addBelInput(bel="X%dY%d_IO%d" % (x, y, z), name="EN", wire="X%dY%dZ%d_I1" % (x, y, z))
ctx.addBelOutput(bel="X%dY%d_IO%d" % (x, y, z), name="O", wire="X%dY%dZ%d_Q" % (x, y, z))
- ctx.setBelDecal(bel="X%dY%d_IO%d" % (x, y, z), decalxy=ctx.DecalXY("bel", 0.6, z * (1/(N+1))))
else:
for z in range(N):
ctx.addBel(name="X%dY%d_SLICE%d" % (x, y, z), type="GENERIC_SLICE", loc=Loc(x, y, z), gb=False)
@@ -49,7 +30,6 @@ for x in range(X):
for k in range(K):
ctx.addBelInput(bel="X%dY%d_SLICE%d" % (x, y, z), name="I[%d]" % k, wire="X%dY%dZ%d_I%d" % (x, y, z, k))
ctx.addBelOutput(bel="X%dY%d_SLICE%d" % (x, y, z), name="Q", wire="X%dY%dZ%d_Q" % (x, y, z))
- ctx.setBelDecal(bel="X%dY%d_SLICE%d" % (x, y, z), decalxy=ctx.DecalXY("bel", 0.6, z * (1/(N+1))))
for x in range(X):
for y in range(Y):