File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ # -*- coding: utf-8 -*-
3+ """
4+ Allow running the module with: python -m python_netlist
5+ """
6+ import argparse
7+ from pprint import pprint
8+ from .netlist import Netlist
9+
10+
11+ def main ():
12+ parser = argparse .ArgumentParser (description = 'Netlist tool' )
13+ parser .add_argument ('--out' , type = str , help = 'JSON output file' )
14+ parser .add_argument ('--no-checks' , default = False , action = 'store_true' ,
15+ help = "Don't perform checks" )
16+ parser .add_argument ('file' , help = "Netlist" )
17+ args = parser .parse_args ()
18+
19+ print ("...Parsing " + args .file + "..." )
20+ netlist = Netlist (args .file )
21+ if not args .no_checks :
22+ print ("###### Check Orphans ######" )
23+ orphans = netlist .check_orphans ()
24+ if len (orphans ):
25+ print ("## Possible orphans:" )
26+ pprint (orphans )
27+ exit (1 )
28+
29+
30+ if __name__ == '__main__' :
31+ main ()
You can’t perform that action at this time.
0 commit comments