5 base_path =
"/home/simon/projects/hal/"
7 sys.path.append(base_path +
"build/lib/")
8 os.environ[
"HAL_BASE_PATH"] = base_path +
"build"
12 hal_py.plugin_manager.load_all_plugins()
16 netlist = hal_py.NetlistFactory.load_netlist(base_path +
"examples/fsm/fsm.v", base_path +
"examples/fsm/example_library.hgl")
18 from hal_plugins
import solve_fsm
20 pl_fsm = hal_py.plugin_manager.get_plugin_instance(
"solve_fsm")
23 fsm_mod = netlist.get_module_by_id(1)
25 transition_gates = fsm_mod.get_gates(
lambda g : g.type.has_property(hal_py.GateTypeProperty.combinational))
26 state_gates = fsm_mod.get_gates(
lambda g : g.type.has_property(hal_py.GateTypeProperty.sequential))
29 graph_path = base_path +
"examples/fsm/graph.dot"
32 g = pl_fsm.solve_fsm(netlist, state_gates, transition_gates, initial_state, graph_path, timeout)
35 hal_py.plugin_manager.unload_all_plugins()