mirror of https://github.com/openXC7/prjxray.git
063-gtp-common-conf: add IBUFDS_GTE2 primitive as well
This commit also solves an issue in the bitfilter function. Given that the GTP_COMMON and GTP_COMMON_MID_[LEFT|RIGHT] have the same bits, but in different frames, we need to add all of the possible frames to the bitfilter callback. This causes issues in determining the IN_USE feature, therefore, there must be two different bitfilter callbacks, one for GTP_COMMON, and one for GTP_COMMON_MID_[LEFT|RIGHT] Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
This commit is contained in:
parent
50553b0c17
commit
f8ae373dd5
|
|
@ -19,9 +19,17 @@ INT = "INT"
|
||||||
BIN = "BIN"
|
BIN = "BIN"
|
||||||
|
|
||||||
|
|
||||||
def bitfilter(frame, bit):
|
def bitfilter_gtp_common_mid(frame, bit):
|
||||||
# Filter out interconnect bits.
|
# Filter out interconnect bits.
|
||||||
if frame not in [28, 29, 0, 1]:
|
if frame not in [0, 1]:
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def bitfilter_gtp_common(frame, bit):
|
||||||
|
# Filter out interconnect bits.
|
||||||
|
if frame not in [28, 29]:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
@ -37,10 +45,16 @@ def main():
|
||||||
|
|
||||||
print("Loading tags")
|
print("Loading tags")
|
||||||
with open("params.json") as f:
|
with open("params.json") as f:
|
||||||
params_list = json.load(f)
|
params_dict = json.load(f)
|
||||||
|
tile_type = params_dict["tile_type"]
|
||||||
|
params_list = params_dict["params"]
|
||||||
|
|
||||||
for params in params_list:
|
for params in params_list:
|
||||||
site = params["site"]
|
site = params["site"]
|
||||||
|
|
||||||
|
if "GTPE2_COMMON" not in site:
|
||||||
|
continue
|
||||||
|
|
||||||
in_use = params["IN_USE"]
|
in_use = params["IN_USE"]
|
||||||
|
|
||||||
segmk.add_site_tag(site, "IN_USE", in_use)
|
segmk.add_site_tag(site, "IN_USE", in_use)
|
||||||
|
|
@ -83,6 +97,38 @@ def main():
|
||||||
else:
|
else:
|
||||||
segmk.add_site_tag(site, "INV_" + param, params[param])
|
segmk.add_site_tag(site, "INV_" + param, params[param])
|
||||||
|
|
||||||
|
for params in params_list:
|
||||||
|
site = params["site"]
|
||||||
|
|
||||||
|
if "IBUFDS_GTE2" not in site:
|
||||||
|
continue
|
||||||
|
|
||||||
|
in_use = params["IN_USE"]
|
||||||
|
segmk.add_site_tag(site, "IN_USE", in_use)
|
||||||
|
|
||||||
|
if in_use:
|
||||||
|
tile = params["tile"]
|
||||||
|
|
||||||
|
for param in ["CLKRCV_TRST", "CLKCM_CFG"]:
|
||||||
|
value = params[param]
|
||||||
|
segmk.add_site_tag(site, param, "TRUE" in value)
|
||||||
|
|
||||||
|
bitstr = [
|
||||||
|
int(x) for x in "{value:0{digits}b}".format(
|
||||||
|
value=params["CLKSWING_CFG"], digits=2)[::-1]
|
||||||
|
]
|
||||||
|
|
||||||
|
for i in range(2):
|
||||||
|
segmk.add_tile_tag(
|
||||||
|
tile, "IBUFDS_GTE2.%s[%u]" % (param, i), bitstr[i])
|
||||||
|
|
||||||
|
if tile_type == "GTP_COMMON":
|
||||||
|
bitfilter = bitfilter_gtp_common
|
||||||
|
elif tile_type == "GTP_COMMON_MID_RIGHT":
|
||||||
|
bitfilter = bitfilter_gtp_common_mid
|
||||||
|
else:
|
||||||
|
assert False, tile_type
|
||||||
|
|
||||||
segmk.compile(bitfilter=bitfilter)
|
segmk.compile(bitfilter=bitfilter)
|
||||||
segmk.write()
|
segmk.write()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ proc run {} {
|
||||||
set_property IS_ENABLED 0 [get_drc_checks {NSTD-1}]
|
set_property IS_ENABLED 0 [get_drc_checks {NSTD-1}]
|
||||||
set_property IS_ENABLED 0 [get_drc_checks {UCIO-1}]
|
set_property IS_ENABLED 0 [get_drc_checks {UCIO-1}]
|
||||||
set_property IS_ENABLED 0 [get_drc_checks {REQP-48}]
|
set_property IS_ENABLED 0 [get_drc_checks {REQP-48}]
|
||||||
|
set_property IS_ENABLED 0 [get_drc_checks {REQP-1619}]
|
||||||
|
|
||||||
place_design
|
place_design
|
||||||
route_design
|
route_design
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ INT = "INT"
|
||||||
BIN = "BIN"
|
BIN = "BIN"
|
||||||
|
|
||||||
|
|
||||||
def gen_sites():
|
def gen_sites(site):
|
||||||
db = Database(util.get_db_root(), util.get_part())
|
db = Database(util.get_db_root(), util.get_part())
|
||||||
grid = db.grid()
|
grid = db.grid()
|
||||||
for tile_name in sorted(grid.tiles()):
|
for tile_name in sorted(grid.tiles()):
|
||||||
|
|
@ -35,12 +35,14 @@ def gen_sites():
|
||||||
"GTP_COMMON_MID_RIGHT",
|
"GTP_COMMON_MID_RIGHT",
|
||||||
]:
|
]:
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
tile_type = gridinfo.tile_type
|
||||||
|
|
||||||
for site_name, site_type in gridinfo.sites.items():
|
for site_name, site_type in gridinfo.sites.items():
|
||||||
if site_type != "GTPE2_COMMON":
|
if site_type != site:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
yield site_name, site_type
|
yield tile_name, tile_type, site_name, site_type
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
@ -54,9 +56,17 @@ module top(
|
||||||
assign out = in;
|
assign out = in;
|
||||||
''')
|
''')
|
||||||
|
|
||||||
|
params_dict = {"tile_type": None}
|
||||||
params_list = list()
|
params_list = list()
|
||||||
|
|
||||||
for site_name, site_type in gen_sites():
|
for tile_name, tile_type, site_name, site_type in gen_sites(
|
||||||
|
"GTPE2_COMMON"):
|
||||||
|
|
||||||
|
if params_dict["tile_type"]:
|
||||||
|
assert tile_type == params_dict["tile_type"]
|
||||||
|
else:
|
||||||
|
params_dict["tile_type"] = tile_type
|
||||||
|
|
||||||
params = dict()
|
params = dict()
|
||||||
params['site'] = site_name
|
params['site'] = site_name
|
||||||
|
|
||||||
|
|
@ -113,10 +123,50 @@ assign out = in;
|
||||||
|
|
||||||
params_list.append(params)
|
params_list.append(params)
|
||||||
|
|
||||||
|
clkswing_cfg_tiles = dict()
|
||||||
|
for tile_name, _, site_name, site_type in gen_sites("IBUFDS_GTE2"):
|
||||||
|
# Both the IBUFDS_GTE2 in the same tile need to have
|
||||||
|
# the same CLKSWING_CFG parameter
|
||||||
|
if tile_name not in clkswing_cfg_tiles:
|
||||||
|
clkswing_cfg = random.randint(0, 3)
|
||||||
|
clkswing_cfg_tiles[tile_name] = clkswing_cfg
|
||||||
|
else:
|
||||||
|
clkswing_cfg = clkswing_cfg_tiles[tile_name]
|
||||||
|
|
||||||
|
in_use = bool(random.randint(0, 9))
|
||||||
|
params = {
|
||||||
|
"site":
|
||||||
|
site_name,
|
||||||
|
"tile":
|
||||||
|
tile_name,
|
||||||
|
"IN_USE":
|
||||||
|
in_use,
|
||||||
|
"CLKRCV_TRST":
|
||||||
|
verilog.quote("TRUE" if random.randint(0, 1) else "FALSE"),
|
||||||
|
"CLKCM_CFG":
|
||||||
|
verilog.quote("TRUE" if random.randint(0, 1) else "FALSE"),
|
||||||
|
"CLKSWING_CFG":
|
||||||
|
clkswing_cfg,
|
||||||
|
}
|
||||||
|
|
||||||
|
if in_use:
|
||||||
|
print("(* KEEP, DONT_TOUCH, LOC=\"{}\" *)".format(site_name))
|
||||||
|
print(
|
||||||
|
"""
|
||||||
|
IBUFDS_GTE2 #(
|
||||||
|
.CLKRCV_TRST({CLKRCV_TRST}),
|
||||||
|
.CLKCM_CFG({CLKCM_CFG}),
|
||||||
|
.CLKSWING_CFG({CLKSWING_CFG})
|
||||||
|
) {site} (
|
||||||
|
);""".format(**params))
|
||||||
|
|
||||||
|
params_list.append(params)
|
||||||
|
|
||||||
print("endmodule")
|
print("endmodule")
|
||||||
|
|
||||||
|
params_dict["params"] = params_list
|
||||||
with open('params.json', 'w') as f:
|
with open('params.json', 'w') as f:
|
||||||
json.dump(params_list, f, indent=2)
|
json.dump(params_dict, f, indent=2)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
||||||
|
|
@ -331,6 +331,7 @@ class Segmaker:
|
||||||
'IDELAY': name_y0y1,
|
'IDELAY': name_y0y1,
|
||||||
'ILOGIC': name_y0y1,
|
'ILOGIC': name_y0y1,
|
||||||
'OLOGIC': name_y0y1,
|
'OLOGIC': name_y0y1,
|
||||||
|
'IBUFDS': name_y0y1,
|
||||||
}.get(site_prefix, name_default)()
|
}.get(site_prefix, name_default)()
|
||||||
self.verbose and print(
|
self.verbose and print(
|
||||||
'site %s w/ %s prefix => tag %s' %
|
'site %s w/ %s prefix => tag %s' %
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue