if len(args) != 1: print(g.USAGE) sys.exit(2) # These depend on arguments, so don't load them until now. import debug # Parse config file and set up all the options g.init_openram(config_file=args[0], is_unit_test=False) # Ensure that the right bitcell exists or use the parameterised one g.setup_bitcell() # Only print banner here so it's not in unit tests g.print_banner() # Keep track of running stats start_time = datetime.datetime.now() g.print_time("Start", start_time) # Output info about this run g.report_status() from sram_config import sram_config # Configure the SRAM organization c = sram_config(word_size=OPTS.word_size, num_words=OPTS.num_words, write_size=OPTS.write_size)
import importlib import globals global OPTS (OPTS, args) = globals.parse_args() # These depend on arguments, so don't load them until now. import debug # required positional args for using openram main exe if len(args) < 1: print(globals.USAGE) sys.exit(2) globals.print_banner() globals.init_openram(args[0]) # Check if all arguments are integers for bits, size, banks if type(OPTS.config.word_size)!=int: debug.error("{0} is not an integer in config file.".format(OPTS.config.word_size)) if type(OPTS.config.num_words)!=int: debug.error("{0} is not an integer in config file.".format(OPTS.config.sram_size)) if type(OPTS.config.num_banks)!=int: debug.error("{0} is not an integer in config file.".format(OPTS.config.num_banks)) if not OPTS.config.tech_name: debug.error("Tech name must be specified in config file.") word_size = OPTS.config.word_size