示例#1
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
示例#2
0
 def __init__(self, project, dblist):
     """
     Initialize the object. At the current time, only little endian is
     supported by the package
     """
     WriterBase.__init__(self, project, None)
     self.dblist = dblist
示例#3
0
 def __init__(self, project, dblist):
     WriterBase.__init__(self, project, None)
     self.tblcnt = 0
     self.project = project
     self.dblist = dblist
     self.zip = None
     self.cnt = None
     self.already_defined = {}
     self.refindex = 0
     self.img_cnt = 0
     self.images = []
示例#4
0
    def __init__(self, project, dbase):
        WriterBase.__init__(self, project, dbase)

        self.input_logic = "input       "
        self.output_logic = "output      "
        self.always = "always"
        self.reg_type = "reg"

        self._cell_info = {}
        for i in TYPES:
            self._cell_info[i.type] = CellInfo(
                i.id.lower(), i.input, i.control, i.oneshot,
                i.description, i.wide, i.read, i.readonly)

        self.__sorted_regs = [
            reg for reg in dbase.get_all_registers()
            if not (reg.do_not_generate_code or reg.ram_size > 0)
        ]
        self._used_types = set()
示例#5
0
 def __init__(self, dbase):
     WriterBase.__init__(self, dbase)
     self._offset = 0
     self._ofile = None
示例#6
0
 def __init__(self, project, group, dblist):
     WriterBase.__init__(self, project, None)
     self.dblist = dblist
     self.group = group
示例#7
0
 def __init__(self, project, dbase):
     WriterBase.__init__(self, project, dbase)
示例#8
0
 def __init__(self, project, dblist):
     WriterBase.__init__(self, None)
     self.dblist = dblist