Ejemplo n.º 1
0
    def __init__(self, sram_config, name):

        sram_config.set_local_config(self)

        # reset the static duplicate name checker for unit tests
        # in case we create more than one SRAM
        from design import design
        design.name_map = []

        debug.info(
            2,
            "create sram of size {0} with {1} num of words {2} banks".format(
                self.word_size, self.num_words, self.num_banks))
        start_time = datetime.datetime.now()

        self.name = name

        if self.num_banks == 1:
            from sram_1bank import sram_1bank as sram
        elif self.num_banks == 2:
            from sram_2bank import sram_2bank as sram
        else:
            debug.error("Invalid number of banks.", -1)

        self.s = sram(name, sram_config)
        self.s.create_netlist()
        if not OPTS.netlist_only:
            self.s.create_layout()

        if not OPTS.is_unit_test:
            print_time("SRAM creation", datetime.datetime.now(), start_time)
Ejemplo n.º 2
0
    def __init__(self, sram_config, name):

        sram_config.set_local_config(self)

        # FIXME: adjust this to not directly change OPTS.
        # Word-around to have values relevant to OPTS be displayed if not directly set.
        OPTS.words_per_row = self.words_per_row
        debug.info(1, "Changed OPTS wpr={}".format(self.words_per_row))
        debug.info(1, "OPTS wpr={}".format(OPTS.words_per_row))

        # reset the static duplicate name checker for unit tests
        # in case we create more than one SRAM
        from design import design
        design.name_map = []

        debug.info(
            2,
            "create sram of size {0} with {1} num of words {2} banks".format(
                self.word_size, self.num_words, self.num_banks))
        start_time = datetime.datetime.now()

        self.name = name

        if self.num_banks == 1:
            from sram_1bank import sram_1bank as sram
        elif self.num_banks == 2:
            from sram_2bank import sram_2bank as sram
        else:
            debug.error("Invalid number of banks.", -1)

        self.s = sram(name, sram_config)
        self.s.create_netlist()
        if not OPTS.netlist_only:
            self.s.create_layout()

        if not OPTS.is_unit_test:
            print_time("SRAM creation", datetime.datetime.now(), start_time)