def output_verilog_file( fout, include_path, verilog_file ):
  with open( verilog_file, 'r' ) as fp:

    short_verilog_file = verilog_file
    if verilog_file.startswith( include_path+"/" ):
      short_verilog_file = verilog_file[len(include_path+"/"):]

    fout.write( '`line 1 "{}" 0\n'.format( short_verilog_file ) )

    line_num = 0
    for line in fp:
      line_num += 1
      if line in '`include':
        filename = include_re.search( line ).group( 'filename' )
        fullname = os.path.join( include_path, filename )
        output_verilog_file( fout, include_path, fullname )
        fout.write( '\n' )
        fout.write( '`line {} "{}" 0\n'.format( line_num+1, short_verilog_file ) )
      else:
        fout.write( line )
dataset/ETHPy150Open cornell-brg/pymtl/pymtl/tools/integration/verilog.py/output_verilog_file/swapped operands of `in`