aboutsummaryrefslogtreecommitdiffstats
path: root/generic/examples/simple.py
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-04-03 16:08:33 +0100
committerDavid Shah <dave@ds0.me>2019-04-03 16:08:33 +0100
commit6fffe24177f9b99d6c332c18e343648cf33d4397 (patch)
treea75edfc7a224b588af0d7d7656915db8246d4506 /generic/examples/simple.py
parenta05593da624d08e6b5c0356448238639479dd250 (diff)
downloadnextpnr-6fffe24177f9b99d6c332c18e343648cf33d4397.tar.gz
nextpnr-6fffe24177f9b99d6c332c18e343648cf33d4397.tar.bz2
nextpnr-6fffe24177f9b99d6c332c18e343648cf33d4397.zip
generic: GUI Python bindings
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'generic/examples/simple.py')
-rw-r--r--generic/examples/simple.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/examples/simple.py b/generic/examples/simple.py
index b8ca3f78..2628c041 100644
--- a/generic/examples/simple.py
+++ b/generic/examples/simple.py
@@ -14,6 +14,10 @@ Sq = 4
# "Sparsity" of 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/(Z+1))-0.02, z=0))
+
def is_io(x, y):
return x == 0 or x == X-1 or y == 0 or y == Y-1
@@ -37,7 +41,7 @@ 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/(Z+1))))
else:
for z in range(Z):
ctx.addBel(name="X%dY%d_SLICE%d" % (x, y, z), type="GENERIC_SLICE", loc=Loc(x, y, z), gb=False)
@@ -45,6 +49,7 @@ 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/(Z+1))))
for x in range(X):
for y in range(Y):