OR-1 dataflow CPU sketch

feat: add dfgraph package skeleton with CLI entry point

Orual b5f53387 27c0870c

+40
+1
dfgraph/__init__.py
···
··· 1 + """Dataflow graph renderer for OR1 dfasm programs."""
+39
dfgraph/__main__.py
···
··· 1 + """CLI entry point: python -m dfgraph path/to/file.dfasm [--port 8420]""" 2 + 3 + import argparse 4 + import sys 5 + from pathlib import Path 6 + 7 + 8 + def main() -> None: 9 + parser = argparse.ArgumentParser( 10 + prog="dfgraph", 11 + description="Visualise a dfasm dataflow program as an interactive graph.", 12 + ) 13 + parser.add_argument( 14 + "file", 15 + type=Path, 16 + help="Path to the .dfasm source file to visualise", 17 + ) 18 + parser.add_argument( 19 + "--port", 20 + type=int, 21 + default=8420, 22 + help="Port for the web server (default: 8420)", 23 + ) 24 + 25 + args = parser.parse_args() 26 + 27 + if not args.file.exists(): 28 + print(f"Error: file not found: {args.file}", file=sys.stderr) 29 + sys.exit(1) 30 + 31 + if not args.file.suffix == ".dfasm": 32 + print(f"Warning: expected .dfasm file, got: {args.file.suffix}", file=sys.stderr) 33 + 34 + # Server startup will be added in Phase 4 35 + print(f"dfgraph: would serve {args.file} on port {args.port}") 36 + 37 + 38 + if __name__ == "__main__": 39 + main()