Add initial VLSI flow scripts
This commit is contained in:
36
vlsi/example-vlsi
Executable file
36
vlsi/example-vlsi
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import hammer_vlsi
|
||||
from hammer_vlsi import CLIDriver
|
||||
|
||||
from typing import Dict, Callable, Optional
|
||||
|
||||
def example_place_tap_cells(x: hammer_vlsi.HammerTool) -> bool:
|
||||
x.append('''
|
||||
# TODO
|
||||
''')
|
||||
return True
|
||||
|
||||
class ExampleDriver(CLIDriver):
|
||||
|
||||
def action_map(self) -> Dict[str, Callable[[hammer_vlsi.HammerDriver, Callable[[str], None]], Optional[dict]]]:
|
||||
par_action = self.create_par_action(custom_hooks=[
|
||||
hammer_vlsi.HammerTool.make_replacement_hook("place_tap_cells", example_place_tap_cells)
|
||||
])
|
||||
|
||||
new_dict = dict(super().action_map())
|
||||
new_dict.update({
|
||||
"par": par_action
|
||||
})
|
||||
return new_dict
|
||||
|
||||
def par_action(self, driver: hammer_vlsi.HammerDriver, append_error_func: Callable[[str], None]) -> Optional[dict]:
|
||||
if not driver.load_par_tool():
|
||||
return None
|
||||
success, par_output = driver.run_par(hook_actions=[
|
||||
hammer_vlsi.HammerTool.make_replacement_hook("place_tap_cells", example_place_tap_cells)
|
||||
])
|
||||
return par_output
|
||||
|
||||
if __name__ == '__main__':
|
||||
ExampleDriver().main()
|
||||
Reference in New Issue
Block a user