Skip to content

Commit

Permalink
fix orfs translate
Browse files Browse the repository at this point in the history
  • Loading branch information
gadfort committed Aug 5, 2023
1 parent ce5085a commit 04130ec
Show file tree
Hide file tree
Showing 2 changed files with 338 additions and 3 deletions.
328 changes: 328 additions & 0 deletions scgallery/designs/tiny_rocket/rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,328 @@
{
"nangate45": [
{
"key": [
"metric",
"cellarea"
],
"step": "syn",
"index": "0",
"compare": "<=",
"value": 55557,
"update": {
"method": "padding",
"value": 1.15,
"bounds": {
"mode": null,
"min_value": null,
"max_value": null
},
"round": false
}
},
{
"key": "sc__metric__timing__clocks",
"file": "reports/metrics.json",
"step": "floorplan",
"index": "0",
"compare": "==",
"value": 1,
"update": {
"method": "sum",
"value": 0,
"bounds": {
"mode": null,
"min_value": null,
"max_value": null
},
"round": true
}
},
{
"key": [
"metric",
"cellarea"
],
"step": "place",
"index": "0",
"compare": "<=",
"value": 60302,
"update": {
"method": "padding",
"value": 1.15,
"bounds": {
"mode": null,
"min_value": null,
"max_value": null
},
"round": true
}
},
{
"key": [
"metric",
"cells"
],
"step": "place",
"index": "0",
"compare": "<=",
"value": 29637,
"update": {
"method": "padding",
"value": 1.15,
"bounds": {
"mode": null,
"min_value": null,
"max_value": null
},
"round": true
}
},
{
"key": "sc__step__design__violations",
"file": "reports/metrics.json",
"step": "place",
"index": "0",
"compare": "==",
"value": 0,
"update": {
"method": "sum",
"value": 0,
"bounds": {
"mode": null,
"min_value": null,
"max_value": null
},
"round": true
}
},
{
"key": [
"metric",
"setupslack"
],
"step": "cts",
"index": "0",
"compare": ">=",
"value": -0.28,
"update": {
"method": "padding",
"value": 0.75,
"bounds": {
"mode": null,
"min_value": 0,
"max_value": null
},
"round": false
}
},
{
"key": "sc__step__design__instance__count__setup_buffer",
"file": "reports/metrics.json",
"step": "cts",
"index": "0",
"compare": "<=",
"value": 1289,
"update": {
"method": "padding",
"value": 1.05,
"bounds": {
"mode": "multiply",
"min_value": null,
"max_value": 1.1
},
"round": true
}
},
{
"key": "sc__step__design__instance__count__hold_buffer",
"file": "reports/metrics.json",
"step": "cts",
"index": "0",
"compare": "<=",
"value": 1289,
"update": {
"method": "padding",
"value": 1.05,
"bounds": {
"mode": "multiply",
"min_value": null,
"max_value": 1.1
},
"round": true
}
},
{
"key": [
"metric",
"wirelength"
],
"step": "route",
"index": "0",
"compare": "<=",
"value": 669467,
"update": {
"method": "padding",
"value": 1.15,
"bounds": {
"mode": null,
"min_value": null,
"max_value": null
},
"round": true
}
},
{
"key": "sc__step__route__drc_errors",
"file": "reports/metrics.json",
"step": "route",
"index": "0",
"compare": "<=",
"value": 0,
"update": {
"method": "sum",
"value": 0,
"bounds": {
"mode": null,
"min_value": null,
"max_value": null
},
"round": true
}
},
{
"key": [
"metric",
"setupslack"
],
"step": "export",
"index": "1",
"compare": ">=",
"value": 0.0,
"update": {
"method": "padding",
"value": 0.95,
"bounds": {
"mode": null,
"min_value": 0.0,
"max_value": null
},
"round": false
}
},
{
"key": [
"metric",
"cellarea"
],
"step": "export",
"index": "1",
"compare": "<=",
"value": 60640,
"update": {
"method": "padding",
"value": 1.15,
"bounds": {
"mode": null,
"min_value": null,
"max_value": null
},
"round": true
}
},
{
"key": "sc__metric__timing__drv__max_slew_limit",
"file": "reports/metrics.json",
"step": "export",
"index": "1",
"compare": ">=",
"value": -0.2,
"update": {
"method": "sum",
"value": -0.2,
"bounds": {
"mode": null,
"min_value": -0.2,
"max_value": null
},
"round": false
}
},
{
"key": "sc__metric__timing__drv__max_fanout_limit",
"file": "reports/metrics.json",
"step": "export",
"index": "1",
"compare": ">=",
"value": -0.2,
"update": {
"method": "sum",
"value": -0.2,
"bounds": {
"mode": null,
"min_value": -0.2,
"max_value": null
},
"round": false
}
},
{
"key": "sc__metric__timing__drv__max_cap_limit",
"file": "reports/metrics.json",
"step": "export",
"index": "1",
"compare": ">=",
"value": -0.24,
"update": {
"method": "sum",
"value": -0.2,
"bounds": {
"mode": null,
"min_value": -0.2,
"max_value": null
},
"round": false
}
},
{
"key": [
"metric",
"setuppaths"
],
"step": "export",
"index": "1",
"compare": "<=",
"value": 10,
"update": {
"method": "padding",
"value": 1.2,
"bounds": {
"mode": "sum",
"min_value": null,
"max_value": 10
},
"round": true
}
},
{
"key": [
"metric",
"holdpaths"
],
"step": "export",
"index": "1",
"compare": "<=",
"value": 10,
"update": {
"method": "padding",
"value": 1.2,
"bounds": {
"mode": "sum",
"min_value": null,
"max_value": 10
},
"round": true
}
}
]
}
13 changes: 10 additions & 3 deletions scgallery/utils/translate_orfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,16 +407,23 @@ def translate(orfs, library, rules):
return True


def __map_name(name):
name_map = {
"tiny_rocket": "tinyRocket"
}
if name in name_map:
return name_map[name]
return name


def convert_all():
orfs_path = 'https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git'
with tempfile.TemporaryDirectory(prefix='orfs_') as repo_work_dir:
print(f"Cloning into: {orfs_path}")
git.Repo.clone_from(orfs_path, repo_work_dir)

for design in all_designs().keys():
orfs_name = design
if design == "tiny_rocket":
orfs_name = "TinyRocket"
orfs_name = __map_name(design)

for orfs_library, library in [('nangate45', 'nangate45'),
('sky130hd', 'sky130hd'),
Expand Down

0 comments on commit 04130ec

Please sign in to comment.