Skip to content

Commit

Permalink
Made ECP5 and interface simple
Browse files Browse the repository at this point in the history
  • Loading branch information
mmicko committed Sep 19, 2023
1 parent c639263 commit 2c64739
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion timing/fuzzers/ECP5/012-io/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def include_cell(name, type):
return type.startswith("io_")


def rewrite_cell(name, type, family):
def rewrite_cell(name, type):
if type.startswith("io_"):
return "PIO:IOTYPE={}".format(type.split("_", 1)[1])
else:
Expand Down
2 changes: 1 addition & 1 deletion timing/fuzzers/ECP5/020-basic_routing/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def main():
jobs = []
jobs += cell_fuzzers.timing_configs("picorv32", "../../resource/picorv32_x20.v", "85")
jobs += cell_fuzzers.timing_configs("picorv32", "../../../resource/picorv32_x20.v", "85")

def per_job(job):
grade, cfg = job
Expand Down
9 changes: 8 additions & 1 deletion timing/fuzzers/MachXO3/010-basic-cells/fuzzer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import cell_fuzzers

def include_cell_XO3(name, type):
type = type.split('/')[-1].split("_")[0]
return type.isupper() and "_" not in type


def rewrite_celltype_XO3(name, type):
return type.split('/')[-1].split("_")[0]

def main():
cell_fuzzers.build_and_add(["../../../resource/picorv32_large.v", "../../../resource/picorv32_large_blockram.v", "../../../resource/distributed_ram.v"], density="6900", family="MachXO3")
cell_fuzzers.build_and_add(["../../../resource/picorv32_large.v", "../../../resource/picorv32_large_blockram.v", "../../../resource/distributed_ram.v"], density="6900", family="MachXO3", inc_cell=include_cell_XO3, rw_cell_func=rewrite_celltype_XO3)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion timing/fuzzers/MachXO3/012-io/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def include_cell(name, type):
return name.startswith("io_")


def rewrite_cell(name, type, family):
def rewrite_cell(name, type):
if type.startswith("io_"):
return "PIO:IOTYPE={}".format(type.split("_", 1)[1])
else:
Expand Down
6 changes: 3 additions & 3 deletions timing/fuzzers/MachXO3/013-iol/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@


def include_cell(name, type):
print("{} = {}".format(name, name is not None and name.startswith("pin_") and name.endswith("_MGIOL")))
return name is not None and name.startswith("pin_") and name.endswith("_MGIOL")
print("{} = {}".format(name, name.startswith("pin_") and name.endswith("_MGIOL")))
return name.startswith("pin_") and name.endswith("_MGIOL")


def rewrite_cell(name, type, family):
def rewrite_cell(name, type):
if type.startswith("pin_"):
return "IOLOGIC:MODE={}".format("".join(type.split("_")[1:-1]))
else:
Expand Down
4 changes: 2 additions & 2 deletions timing/fuzzers/MachXO3/014-ebr/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ def include_cell(name, type):
return name.startswith("ebr_")


def rewrite_cell_regmode(name, type, family):
def rewrite_cell_regmode(name, type):
if type.startswith("ebr_"):
return "DP8KC:REGMODE_A={},REGMODE_B={}".format(type.split("_", 2)[1], type.split("_", 2)[2])
else:
return type

def rewrite_cell_wrmode(name, type, family):
def rewrite_cell_wrmode(name, type):
if type.startswith("ebr_"):
return "DP8KC:WRITEMODE_A={},WRITEMODE_B={}".format(type.split("_", 2)[1], type.split("_", 2)[2])
else:
Expand Down
2 changes: 1 addition & 1 deletion timing/util/cell_fuzzers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ def per_job(job):
db = timing_dbs.cells_db_path(family, grade)
for sdf in sdfs[grade]:
cell_timings.add_sdf_to_database(db, sdf, include_cell_predicate=inc_cell, rewrite_cell_func=rw_cell_func,
rewrite_pin_func=rw_pin_func, family=family)
rewrite_pin_func=rw_pin_func)
10 changes: 4 additions & 6 deletions timing/util/cell_timings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ def include_cell(name, type):
return type.isupper() and "_" not in type


def rewrite_celltype(name, type, family="ECP5"):
if family == "MachXO3":
return type.split('/')[-1].split("_")[0]
def rewrite_celltype(name, type):
return type


Expand Down Expand Up @@ -68,13 +66,13 @@ def delay_tuple(delay):


def add_sdf_to_database(dbfile, sdffile, include_cell_predicate=include_cell, rewrite_cell_func=rewrite_celltype,
rewrite_pin_func=rewrite_pin, family="ECP5"):
rewrite_pin_func=rewrite_pin):
db = load_database(dbfile)
sdf = parse_sdf.parse_sdf_file(sdffile)
for instname, cell in sdf.cells.items():
celltype = rewrite_cell_func(cell.inst, cell.type, family)
if not include_cell_predicate(cell.inst, celltype):
if not include_cell_predicate(cell.inst, cell.type):
continue
celltype = rewrite_cell_func(cell.inst, cell.type)
if celltype not in db:
db[celltype] = set()
for entry in cell.entries:
Expand Down

0 comments on commit 2c64739

Please sign in to comment.