<s> """<STR_LIT>""" <EOL> import os <EOL> import stat <EOL> import string <EOL> import math <EOL> bench_name = "<STR_LIT>" <EOL> harness_name = "<STR_LIT>" <EOL> quartus_base_path = "<STR_LIT>" <EOL> def base_install_path ( ) : <EOL> """<STR_LIT>""" <EOL> depth_from_base = <NUM_LIT:2> <EOL> raw_path = os . path . dirname ( os . path . realpath ( __file__ ) ) <EOL> return os . path . join ( os . sep , * raw_path . split ( os . sep ) [ : - depth_from_base ] ) <EOL> def log2 ( num ) : <EOL> """<STR_LIT>""" <EOL> return int ( math . ceil ( math . log ( num , <NUM_LIT:2> ) ) ) <EOL> def indent ( block , levels = <NUM_LIT:1> ) : <EOL> tab_depth = <NUM_LIT:4> <EOL> return "<STR_LIT:\n>" . join ( ( levels * tab_depth * "<STR_LIT:U+0020>" ) + line <EOL> for line in block . splitlines ( ) ) <EOL> def write_file ( path , filename , contents ) : <EOL> filepath = os . path . join ( path , filename ) <EOL> try : <EOL> os . mkdir ( path ) <EOL> except OSError : <EOL> pass <EOL> with open ( filepath , '<STR_LIT:w>' ) as this_file : <EOL> this_file . write ( contents ) <EOL> def read_file ( path , filename ) : <EOL> filepath = os . path . join ( path , filename ) <EOL> with open ( filepath , '<STR_LIT:r>' ) as this_file : <EOL> contents = this_file . read ( ) <EOL> return contents <EOL> def make_file_executable ( path , filename ) : <EOL> filepath = os . path . join ( path , filename ) <EOL> os . chmod ( filepath , os . stat ( filepath ) . st_mode | stat . S_IXUSR | stat . S_IXGRP | stat . S_IXOTH ) <EOL> return </s>
