Ejemplo n.º 1
0
    def __init__(self):
        self.__builder = gtk.Builder()
        self.__builder.add_from_file(GLADE_PREF)
        self.__properties = self.__builder.get_object('preferences')

        value = bool(int(ini.get('user', 'use_svn', 0)))
        self.__builder.get_object('use_svn').set_active(value)

        value = bool(int(ini.get('user', 'load_last_project', 0)))
        self.__builder.get_object('load_last_project').set_active(value)

        value = ini.get('user', 'column_width', "80")
        self.__builder.get_object('column_width').set_value(float(value))

        self.__builder.connect_signals(self)
        self.__properties.show()
Ejemplo n.º 2
0
    def __init__(self, project, dbase):
        WriterBase.__init__(self, project, dbase)

        self._always = 'always'

        self.__sorted_regs = [
            reg for reg in dbase.get_all_registers()
            if not (reg.do_not_generate_code or reg.ram_size > 0)]

        self._coverage = self._dbase.enable_coverage

        max_column_str = ini.get('user', 'column_width', "80")
        try:
            self._max_column = max(int(max_column_str), 80)
        except ValueError:
            self._max_column = 80

        if dbase.reset_active_level:
            self._reset_edge = "posedge %s" % self._reset
            self._reset_condition = self._reset
        else:
            self._reset_edge = "negedge %s" % self._reset
            self._reset_condition = "~%s" % self._reset

        if dbase.byte_strobe_active_level:
            self.__be_condition = self._byte_enables
        else:
            self.__be_condition = "~%s" % self._byte_enables

        self._ofile = None
        self._lower_bit = LOWER_BIT[self._data_width]

        self._word_fields = self.__generate_group_list(self._data_width)

        self._field_type_map = {
            BitField.TYPE_READ_ONLY: self._register_read_only,
            BitField.TYPE_READ_ONLY_VALUE: self._register_read_only_value,
            }

        self._has_input = {}
        self._has_oneshot = {}
        self._has_control = {}
        self._has_data_out = {}
        self._has_rd = {}
        self._allows_wide = {}
        self._cell_name = {}
        self._type_descr = {}
        self._is_read_only = {}
        self._used_types = set()

        for i in TYPES:
            self._cell_name[i.type] = i.id.lower()
            self._has_input[i.type] = i.input
            self._has_control[i.type] = i.control
            self._has_oneshot[i.type] = i.oneshot
            self._type_descr[i.type] = i.description
            self._allows_wide[i.type] = i.wide
            self._has_data_out[i.type] = i.dataout
            self._has_rd[i.type] = i.read
            self._is_read_only[i.type] = i.readonly