Run make format.

Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
This commit is contained in:
Keith Rothman 2019-03-12 16:10:25 -07:00
parent 3d70606d79
commit 3232ae3edc
3 changed files with 63 additions and 44 deletions

View File

@ -17,6 +17,7 @@ process.
""" """
import argparse import argparse
def main(): def main():
parser = argparse.ArgumentParser("Form ZDB groups for BUFG.") parser = argparse.ArgumentParser("Form ZDB groups for BUFG.")
@ -56,11 +57,13 @@ def main():
assert zero_feature is not None, dst assert zero_feature is not None, dst
print('{bits},{type}.{dst}.{src}'.format( print(
'{bits},{type}.{dst}.{src}'.format(
bits=' '.join(sorted(bits)), bits=' '.join(sorted(bits)),
type='CLK_BUFG', type='CLK_BUFG',
dst=dst, dst=dst,
src=zero_feature)) src=zero_feature))
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@ -4,12 +4,14 @@ from prjxray.segmaker import Segmaker
import os import os
import os.path import os.path
def bitfilter(frame, word): def bitfilter(frame, word):
if frame < 26: if frame < 26:
return False return False
return True return True
def main(): def main():
segmk = Segmaker("design.bits") segmk = Segmaker("design.bits")
@ -17,7 +19,8 @@ def main():
pipdata = {} pipdata = {}
ignpip = set() ignpip = set()
with open(os.path.join(os.getenv('FUZDIR'), '..', 'piplist', 'build', 'clk_bufg', 'clk_bufg_bot_r.txt')) as f: with open(os.path.join(os.getenv('FUZDIR'), '..', 'piplist', 'build',
'clk_bufg', 'clk_bufg_bot_r.txt')) as f:
for l in f: for l in f:
tile_type, dst, src = l.strip().split('.') tile_type, dst, src = l.strip().split('.')
if tile_type not in pipdata: if tile_type not in pipdata:
@ -25,7 +28,8 @@ def main():
pipdata[tile_type].append((src, dst)) pipdata[tile_type].append((src, dst))
with open(os.path.join(os.getenv('FUZDIR'), '..', 'piplist', 'build', 'clk_bufg', 'clk_bufg_top_r.txt')) as f: with open(os.path.join(os.getenv('FUZDIR'), '..', 'piplist', 'build',
'clk_bufg', 'clk_bufg_top_r.txt')) as f:
for l in f: for l in f:
tile_type, dst, src = l.strip().split('.') tile_type, dst, src = l.strip().split('.')
if tile_type not in pipdata: if tile_type not in pipdata:
@ -86,5 +90,6 @@ def main():
segmk.compile(bitfilter=bitfilter) segmk.compile(bitfilter=bitfilter)
segmk.write() segmk.write()
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@ -95,7 +95,6 @@ class ClockSources(object):
return source return source
def main(): def main():
""" """
BUFG's can be driven from: BUFG's can be driven from:
@ -105,7 +104,8 @@ def main():
""" """
print(''' print(
'''
module top(); module top();
(* KEEP, DONT_TOUCH *) (* KEEP, DONT_TOUCH *)
LUT6 dummy(); LUT6 dummy();
@ -129,7 +129,6 @@ module top();
if site_type == desired_site_type: if site_type == desired_site_type:
yield tile_name, site yield tile_name, site
for _, site in gen_sites('MMCME2_ADV'): for _, site in gen_sites('MMCME2_ADV'):
mmcm_clocks = [ mmcm_clocks = [
'mmcm_clock_{site}_{idx}'.format(site=site, idx=idx) 'mmcm_clock_{site}_{idx}'.format(site=site, idx=idx)
@ -188,9 +187,11 @@ module top();
wire I0_{site}; wire I0_{site};
wire CE1_{site}; wire CE1_{site};
wire CE0_{site}; wire CE0_{site};
""".format(site=site), file=wires) """.format(site=site),
file=wires)
print(""" print(
"""
(* KEEP, DONT_TOUCH, LOC = "{site}" *) (* KEEP, DONT_TOUCH, LOC = "{site}" *)
BUFGCTRL bufg_{site} ( BUFGCTRL bufg_{site} (
.O(O_{site}), .O(O_{site}),
@ -203,8 +204,8 @@ module top();
.CE1(CE1_{site}), .CE1(CE1_{site}),
.CE0(CE0_{site}) .CE0(CE0_{site})
); );
""".format(site=site), file=bufgs) """.format(site=site),
file=bufgs)
""" BUFG clock sources: """ BUFG clock sources:
2 from interconnect 2 from interconnect
@ -231,7 +232,8 @@ module top();
offset = 1 offset = 1
while True: while True:
gridinfo = grid.gridinfo_at_loc((loc.grid_x, loc.grid_y+offset*inc)) gridinfo = grid.gridinfo_at_loc(
(loc.grid_x, loc.grid_y + offset * inc))
if gridinfo.tile_type.startswith('CLK_HROW_'): if gridinfo.tile_type.startswith('CLK_HROW_'):
return site_to_cmt[list(gridinfo.sites.keys())[0]] return site_to_cmt[list(gridinfo.sites.keys())[0]]
@ -244,7 +246,7 @@ module top();
x, y = BUFGCTRL_XY_FUN(site) x, y = BUFGCTRL_XY_FUN(site)
target_y = y + 1 target_y = y + 1
max_y = ((y // 16) + 1)*16 max_y = ((y // 16) + 1) * 16
if target_y >= max_y: if target_y >= max_y:
target_y -= 16 target_y -= 16
@ -254,7 +256,7 @@ module top();
x, y = BUFGCTRL_XY_FUN(site) x, y = BUFGCTRL_XY_FUN(site)
target_y = y - 1 target_y = y - 1
min_y = (y // 16)*16 min_y = (y // 16) * 16
if target_y < min_y: if target_y < min_y:
target_y += 16 target_y += 16
@ -269,18 +271,25 @@ module top();
for tile, site in sorted(gen_sites("BUFGCTRL"), for tile, site in sorted(gen_sites("BUFGCTRL"),
key=lambda x: BUFGCTRL_XY_FUN(x[1])): key=lambda x: BUFGCTRL_XY_FUN(x[1])):
if random.randint(0, 1): if random.randint(0, 1):
print(""" print(
"""
assign I0_{site} = {i0_net};""".format( assign I0_{site} = {i0_net};""".format(
site=site, site=site,
i0_net=get_clock_net(tile, site, random.choice(CLOCK_CHOICES))), file=bufgs) i0_net=get_clock_net(
tile, site, random.choice(CLOCK_CHOICES))),
file=bufgs)
if random.randint(0, 1): if random.randint(0, 1):
print(""" print(
"""
assign I1_{site} = {i1_net};""".format( assign I1_{site} = {i1_net};""".format(
site=site, site=site,
i1_net = get_clock_net(tile, site, random.choice(CLOCK_CHOICES))), file=bufgs) i1_net=get_clock_net(
tile, site, random.choice(CLOCK_CHOICES))),
file=bufgs)
print(""" print(
"""
assign S0_{site} = {s0_net}; assign S0_{site} = {s0_net};
assign S1_{site} = {s1_net}; assign S1_{site} = {s1_net};
assign IGNORE0_{site} = {ignore0_net}; assign IGNORE0_{site} = {ignore0_net};
@ -295,7 +304,8 @@ module top();
ignore1_net=luts.get_next_output_net(), ignore1_net=luts.get_next_output_net(),
ce0_net=luts.get_next_output_net(), ce0_net=luts.get_next_output_net(),
ce1_net=luts.get_next_output_net(), ce1_net=luts.get_next_output_net(),
), file=bufgs) ),
file=bufgs)
for l in luts.create_wires_and_luts(): for l in luts.create_wires_and_luts():
print(l) print(l)
@ -310,7 +320,8 @@ module top();
if random.randint(0, 1): if random.randint(0, 1):
_, bufhce_site = next(itr) _, bufhce_site = next(itr)
print(""" print(
"""
(* KEEP, DONT_TOUCH, LOC = "{bufhce_site}" *) (* KEEP, DONT_TOUCH, LOC = "{bufhce_site}" *)
BUFHCE bufhce_{bufhce_site} ( BUFHCE bufhce_{bufhce_site} (
.I(O_{site}) .I(O_{site})