mirror of https://github.com/openXC7/prjxray.git
Added emission of STEPDOWN features for HCLK_IOI3 tile too.
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
This commit is contained in:
parent
781dc05479
commit
2172b0f797
|
|
@ -15,6 +15,12 @@ from prjxray import fasm_assembler
|
||||||
from prjxray.db import Database
|
from prjxray.db import Database
|
||||||
from prjxray.roi import Roi
|
from prjxray.roi import Roi
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def eprint(*args, **kwargs):
|
||||||
|
print(*args, file=sys.stderr, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class FASMSyntaxError(SyntaxError):
|
class FASMSyntaxError(SyntaxError):
|
||||||
pass
|
pass
|
||||||
|
|
@ -123,6 +129,14 @@ def run(
|
||||||
reader = csv.DictReader(fp)
|
reader = csv.DictReader(fp)
|
||||||
package_pins = [l for l in reader]
|
package_pins = [l for l in reader]
|
||||||
|
|
||||||
|
with open(os.path.join(db_root, part + ".json"), "r") as fp:
|
||||||
|
part_data = json.load(fp)
|
||||||
|
|
||||||
|
for bank, loc in part_data["iobanks"].items():
|
||||||
|
tile = "HCLK_IOI3_" + loc
|
||||||
|
bank_to_tile[bank].add(tile)
|
||||||
|
tile_to_bank[tile] = bank
|
||||||
|
|
||||||
for pin in package_pins:
|
for pin in package_pins:
|
||||||
bank_to_tile[pin["bank"]].add(pin["tile"])
|
bank_to_tile[pin["bank"]].add(pin["tile"])
|
||||||
tile_to_bank[pin["tile"]] = pin["bank"]
|
tile_to_bank[pin["tile"]] = pin["bank"]
|
||||||
|
|
@ -189,11 +203,14 @@ def run(
|
||||||
# Make a set of all used IOB tiles and sites. Look for the "STEPDOWN"
|
# Make a set of all used IOB tiles and sites. Look for the "STEPDOWN"
|
||||||
# feature. If one is set for an IOB then set it for all other IOBs of
|
# feature. If one is set for an IOB then set it for all other IOBs of
|
||||||
# the same bank.
|
# the same bank.
|
||||||
stepdown_tags = set()
|
stepdown_tags = defaultdict(lambda: set())
|
||||||
stepdown_banks = set()
|
stepdown_banks = set()
|
||||||
used_iob_sites = set()
|
used_iob_sites = set()
|
||||||
|
|
||||||
for set_feature in set_features:
|
for set_feature in set_features:
|
||||||
|
if set_feature.value == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
feature = set_feature.feature
|
feature = set_feature.feature
|
||||||
parts = feature.split(".")
|
parts = feature.split(".")
|
||||||
if len(parts) >= 3:
|
if len(parts) >= 3:
|
||||||
|
|
@ -203,24 +220,39 @@ def run(
|
||||||
tile,
|
tile,
|
||||||
site,
|
site,
|
||||||
))
|
))
|
||||||
if "STEPDOWN" in tag:
|
|
||||||
stepdown_banks.add(tile_to_bank[tile])
|
|
||||||
stepdown_tags.add(tag)
|
|
||||||
|
|
||||||
# Set the feature for unused IOBs
|
# Store STEPDOWN related tags.
|
||||||
|
if "STEPDOWN" in tag:
|
||||||
|
bank = tile_to_bank[tile]
|
||||||
|
stepdown_banks.add(bank)
|
||||||
|
stepdown_tags[bank].add(tag)
|
||||||
|
|
||||||
|
# Set the feature for unused IOBs, loop over all banks which were
|
||||||
|
# observed to have the STEPDOWN feature set.
|
||||||
missing_features = []
|
missing_features = []
|
||||||
|
|
||||||
for bank in stepdown_banks:
|
for bank in stepdown_banks:
|
||||||
for tile in bank_to_tile[bank]:
|
for tile in bank_to_tile[bank]:
|
||||||
for site in get_iob_sites(db, tile):
|
|
||||||
|
|
||||||
if (tile, site) in used_iob_sites:
|
# This is an IOB33 tile. Set the STEPDOWN feature in it but
|
||||||
continue
|
# only if it is unused.
|
||||||
|
if "IOB33" in tile:
|
||||||
|
for site in get_iob_sites(db, tile):
|
||||||
|
|
||||||
for tag in stepdown_tags:
|
if (tile, site) in used_iob_sites:
|
||||||
feature = "{}.{}.{}".format(tile, site, tag)
|
continue
|
||||||
for line in fasm.parse_fasm_string(feature):
|
|
||||||
assembler.add_fasm_line(line, missing_features)
|
for tag in stepdown_tags[bank]:
|
||||||
|
feature = "{}.{}.{}".format(tile, site, tag)
|
||||||
|
for line in fasm.parse_fasm_string(feature):
|
||||||
|
assembler.add_fasm_line(line, missing_features)
|
||||||
|
|
||||||
|
# This is a HCLK_IOI3 tile, set the stepdown feature for it
|
||||||
|
# too.
|
||||||
|
if "HCLK_IOI3" in tile:
|
||||||
|
feature = "{}.STEPDOWN".format(tile)
|
||||||
|
for line in fasm.parse_fasm_string(feature):
|
||||||
|
assembler.add_fasm_line(line, missing_features)
|
||||||
|
|
||||||
if missing_features:
|
if missing_features:
|
||||||
raise fasm_assembler.FasmLookupError('\n'.join(missing_features))
|
raise fasm_assembler.FasmLookupError('\n'.join(missing_features))
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
HCLK_IOI3.STEPDOWN 00_16
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -190,5 +190,55 @@
|
||||||
"IOB_X1Y4": "IOB33M"
|
"IOB_X1Y4": "IOB33M"
|
||||||
},
|
},
|
||||||
"type": "RIOB33"
|
"type": "RIOB33"
|
||||||
|
},
|
||||||
|
"HCLK_IOI3_X113Y26": {
|
||||||
|
"bits": {
|
||||||
|
"CLB_IO_CLK": {
|
||||||
|
"baseaddr": "0x00401580",
|
||||||
|
"frames": 42,
|
||||||
|
"offset": 50,
|
||||||
|
"words": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"grid_x": 113,
|
||||||
|
"grid_y": 130,
|
||||||
|
"pin_functions": {},
|
||||||
|
"sites": {
|
||||||
|
"BUFIO_X1Y0": "BUFIO",
|
||||||
|
"BUFIO_X1Y1": "BUFIO",
|
||||||
|
"BUFIO_X1Y2": "BUFIO",
|
||||||
|
"BUFIO_X1Y3": "BUFIO",
|
||||||
|
"BUFR_X1Y0": "BUFR",
|
||||||
|
"BUFR_X1Y1": "BUFR",
|
||||||
|
"BUFR_X1Y2": "BUFR",
|
||||||
|
"BUFR_X1Y3": "BUFR",
|
||||||
|
"IDELAYCTRL_X1Y0": "IDELAYCTRL"
|
||||||
|
},
|
||||||
|
"type": "HCLK_IOI3"
|
||||||
|
},
|
||||||
|
"HCLK_IOI3_X1Y26": {
|
||||||
|
"bits": {
|
||||||
|
"CLB_IO_CLK": {
|
||||||
|
"baseaddr": "0x00400000",
|
||||||
|
"frames": 42,
|
||||||
|
"offset": 50,
|
||||||
|
"words": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"grid_x": 1,
|
||||||
|
"grid_y": 130,
|
||||||
|
"pin_functions": {},
|
||||||
|
"sites": {
|
||||||
|
"BUFIO_X0Y0": "BUFIO",
|
||||||
|
"BUFIO_X0Y1": "BUFIO",
|
||||||
|
"BUFIO_X0Y2": "BUFIO",
|
||||||
|
"BUFIO_X0Y3": "BUFIO",
|
||||||
|
"BUFR_X0Y0": "BUFR",
|
||||||
|
"BUFR_X0Y1": "BUFR",
|
||||||
|
"BUFR_X0Y2": "BUFR",
|
||||||
|
"BUFR_X0Y3": "BUFR",
|
||||||
|
"IDELAYCTRL_X0Y0": "IDELAYCTRL"
|
||||||
|
},
|
||||||
|
"type": "HCLK_IOI3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"iobanks": {
|
||||||
|
"99": "X1Y26",
|
||||||
|
"66": "X113Y26"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
bit_00400000_002_01
|
bit_00400000_002_01
|
||||||
bit_00400000_002_03
|
bit_00400000_002_03
|
||||||
bit_00400000_006_03
|
bit_00400000_006_03
|
||||||
|
bit_00400000_050_16
|
||||||
bit_00400000_099_03
|
bit_00400000_099_03
|
||||||
bit_00401580_002_02
|
bit_00401580_002_02
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
bit_00400000_006_01
|
bit_00400000_006_01
|
||||||
bit_00401580_002_03
|
bit_00401580_002_03
|
||||||
bit_00401580_006_03
|
bit_00401580_006_03
|
||||||
|
bit_00401580_050_16
|
||||||
bit_00401580_099_02
|
bit_00401580_099_02
|
||||||
bit_00401580_099_03
|
bit_00401580_099_03
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue