<s> from __future__ import absolute_import <EOL> from __future__ import print_function <EOL> import sys <EOL> import os <EOL> from optparse import OptionParser <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ) ) ) ) <EOL> import pyverilog . utils . version <EOL> from pyverilog . dataflow . dataflow_analyzer import VerilogDataflowAnalyzer <EOL> def main ( ) : <EOL> INFO = "<STR_LIT>" <EOL> VERSION = pyverilog . utils . version . VERSION <EOL> USAGE = "<STR_LIT>" <EOL> def showVersion ( ) : <EOL> print ( INFO ) <EOL> print ( VERSION ) <EOL> print ( USAGE ) <EOL> sys . exit ( ) <EOL> optparser = OptionParser ( ) <EOL> optparser . add_option ( "<STR_LIT>" , "<STR_LIT>" , action = "<STR_LIT:store_true>" , dest = "<STR_LIT>" , <EOL> default = False , help = "<STR_LIT>" ) <EOL> optparser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , action = "<STR_LIT>" , <EOL> default = [ ] , help = "<STR_LIT>" ) <EOL> optparser . add_option ( "<STR_LIT>" , dest = "<STR_LIT>" , action = "<STR_LIT>" , <EOL> default = [ ] , help = "<STR_LIT>" ) <EOL> optparser . add_option ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , <EOL> default = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> optparser . add_option ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , dest = "<STR_LIT>" , <EOL> default = False , help = "<STR_LIT>" ) <EOL> optparser . add_option ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , dest = "<STR_LIT>" , <EOL> default = False , help = "<STR_LIT>" ) <EOL> ( options , args ) = optparser . parse_args ( ) <EOL> filelist = args <EOL> if options . showversion : <EOL> showVersion ( ) <EOL> for f in filelist : <EOL> if not os . path . exists ( f ) : raise IOError ( "<STR_LIT>" + f ) <EOL> if len ( filelist ) == <NUM_LIT:0> : <EOL> showVersion ( ) <EOL> analyzer = VerilogDataflowAnalyzer ( filelist , options . topmodule , <EOL> noreorder = options . noreorder , <EOL> nobind = options . nobind , <EOL> preprocess_include = options . include , <EOL> preprocess_define = options . define ) <EOL> analyzer . generate ( ) <EOL> directives = analyzer . get_directives ( ) <EOL> print ( '<STR_LIT>' ) <EOL> for dr in sorted ( directives , key = lambda x : str ( x ) ) : <EOL> print ( dr ) <EOL> instances = analyzer . getInstances ( ) <EOL> print ( '<STR_LIT>' ) <EOL> for module , instname in sorted ( instances , key = lambda x : str ( x [ <NUM_LIT:1> ] ) ) : <EOL> print ( ( module , instname ) ) <EOL> if options . nobind : <EOL> print ( '<STR_LIT>' ) <EOL> signals = analyzer . getSignals ( ) <EOL> for sig in signals : <EOL> print ( sig ) <EOL> print ( '<STR_LIT>' ) <EOL> consts = analyzer . getConsts ( ) <EOL> for con in consts : <EOL> print ( con ) <EOL> else : <EOL> terms = analyzer . getTerms ( ) <EOL> print ( '<STR_LIT>' ) <EOL> for tk , tv in sorted ( terms . items ( ) , key = lambda x : str ( x [ <NUM_LIT:0> ] ) ) : <EOL> print ( tv . tostr ( ) ) <EOL> binddict = analyzer . getBinddict ( ) <EOL> print ( '<STR_LIT>' ) <EOL> for bk , bv in sorted ( binddict . items ( ) , key = lambda x : str ( x [ <NUM_LIT:0> ] ) ) : <EOL> for bvi in bv : <EOL> print ( bvi . tostr ( ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
