diff --git a/fuzzers/005-tilegrid/iob/top.py b/fuzzers/005-tilegrid/iob/top.py index 285e084f..ccc8496f 100644 --- a/fuzzers/005-tilegrid/iob/top.py +++ b/fuzzers/005-tilegrid/iob/top.py @@ -49,25 +49,23 @@ module top(input wire [`N_DI-1:0] di); for idx, ((tile_name, site_name), isone) in enumerate(zip( sites, util.gen_fuzz_states(len(sites)))): params[tile_name] = (site_name, isone, "di[%u]" % idx) - print(''' + print( + ''' (* KEEP, DONT_TOUCH *) IBUF #( ) ibuf_{site_name} ( .I(di[{idx}]), .O(di_buf[{idx}]) - );'''.format( - site_name=site_name, - idx=idx)) + );'''.format(site_name=site_name, idx=idx)) if isone: - print(''' + print( + ''' (* KEEP, DONT_TOUCH *) PULLUP #( ) pullup_{site_name} ( .O(di[{idx}]) - );'''.format( - site_name=site_name, - idx=idx)) + );'''.format(site_name=site_name, idx=idx)) print("endmodule") write_params(params) diff --git a/fuzzers/005-tilegrid/pll/top.py b/fuzzers/005-tilegrid/pll/top.py index baeaf798..e5235d79 100644 --- a/fuzzers/005-tilegrid/pll/top.py +++ b/fuzzers/005-tilegrid/pll/top.py @@ -24,8 +24,7 @@ def write_params(params): def run(): - print( - ''' + print(''' module top(); ''') @@ -42,9 +41,9 @@ module top(); (* KEEP, DONT_TOUCH, LOC = "{site_name}" *) PLLE2_ADV #( .STARTUP_WAIT({isone}) ) dut_{site_name} (); '''.format( - site_name=site_name, - isone=verilog.quote('TRUE' if isone else 'FALSE'), - )) + site_name=site_name, + isone=verilog.quote('TRUE' if isone else 'FALSE'), + )) print("endmodule") write_params(params) diff --git a/prjxray/util.py b/prjxray/util.py index 4bc6a711..0e27027a 100644 --- a/prjxray/util.py +++ b/prjxray/util.py @@ -238,19 +238,19 @@ def gen_fuzz_states(nvals): next_p2_states = 2**math.ceil(math.log(nvals, 2)) n = next_p2_states - full_mask = 2**next_p2_states-1 + full_mask = 2**next_p2_states - 1 choices = [] invert_choices = [] num_or = 1 while n > 0: - mask = 2**n-1 + mask = 2**n - 1 val = 0 for offset in range(0, num_or, 2): - shift = offset*next_p2_states//num_or + shift = offset * next_p2_states // num_or val |= mask << shift choices.append(full_mask ^ val)