diff options
Diffstat (limited to 'generic/examples')
-rw-r--r-- | generic/examples/simple.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/generic/examples/simple.py b/generic/examples/simple.py index da41dc5b..17808fc7 100644 --- a/generic/examples/simple.py +++ b/generic/examples/simple.py @@ -1,3 +1,16 @@ -ctx.addBel(name="SLICE_X1Y1", type="SLICE_LUT4", loc=Loc(1, 1, 0), gb=False) -ctx.addBel(name="IO0_I", type="$nextpnr_ibuf", loc=Loc(0, 0, 0), gb=False) -ctx.addBel(name="IO1_O", type="$nextpnr_obuf", loc=Loc(1, 0, 0), gb=False)
\ No newline at end of file +X = 12 +Y = 12 + +def is_io(x, y): + return x == 0 or x == X-1 or y == 0 or y == Y-1 + + +for x in range(X): + for y in range(Y): + if is_io(x, y): + if x == y: + continue + for z in range(2): + ctx.addBel(name="X%dY%d_IO%d" % (x, y, z), type="GENERIC_IOB", loc=Loc(x, y, z), gb=False) + else: + ctx.addBel(name="X%dY%d_SLICE%d" % (x, y, z), type="GENERIC_SLICE", loc=Loc(x, y, z), gb=False) |