Ejemplo n.º 1
0
Archivo: csr.py Proyecto: umarcor/litex
 def __init__(self, size, name):
     DUID.__init__(self)
     self.name = get_obj_var_name(name)
     if self.name is None:
         raise ValueError(
             "Cannot extract CSR name from code, need to specify.")
     self.size = size
Ejemplo n.º 2
0
 def __init__(self, width, depth, init=None, name=None):
     Special.__init__(self)
     self.width = width
     self.depth = depth
     self.ports = []
     self.init = init
     self.name_override = get_obj_var_name(name, "mem")
Ejemplo n.º 3
0
Archivo: csr.py Proyecto: umarcor/litex
 def __init__(self, value, bits_sign=None, name=None):
     DUID.__init__(self)
     self.value = Constant(value, bits_sign)
     self.name = get_obj_var_name(name)
     if self.name is None:
         raise ValueError(
             "Cannot extract CSR name from code, need to specify.")
Ejemplo n.º 4
0
 def __init__(self, width, depth, init=None, name=None):
     Special.__init__(self)
     self.width = width
     self.depth = depth
     self.ports = []
     self.init = init
     self.name_override = get_obj_var_name(name, "mem")
Ejemplo n.º 5
0
	def __init__(self, size, name):
		HUID.__init__(self)
		self.name = get_obj_var_name(name)
		if self.name is None:
			raise ValueError("Cannot extract CSR name from code, need to specify.")
		if len(self.name) > 2 and self.name[:2] == "r_":
			self.name = self.name[2:]
		self.size = size
Ejemplo n.º 6
0
 def __init__(self, name=None, description=None):
     DUID.__init__(self)
     self.status = Signal()
     self.pending = Signal()
     self.trigger = Signal()
     self.clear = Signal()
     self.name = get_obj_var_name(name)
     self.description = description
Ejemplo n.º 7
0
	def __init__(self, size, name):
		HUID.__init__(self)
		self.name = get_obj_var_name(name)
		if self.name is None:
			raise ValueError("Cannot extract CSR name from code, need to specify.")
		if len(self.name) > 2 and self.name[:2] == "r_":
			self.name = self.name[2:]
		self.size = size
Ejemplo n.º 8
0
	def __init__(self, name=None, reset_less=False):
		self.name = tracer.get_obj_var_name(name)
		if self.name is None:
			raise ValueError("Cannot extract clock domain name from code, need to specify.")
		if len(self.name) > 3 and self.name[:3] == "cd_":
			self.name = self.name[3:]
		self.clk = Signal(name_override=self.name + "_clk")
		if reset_less:
			self.rst = None
		else:
			self.rst = Signal(name_override=self.name + "_rst")
Ejemplo n.º 9
0
 def __init__(self, name=None, reset_less=False):
     self.name = tracer.get_obj_var_name(name)
     if self.name is None:
         raise ValueError(
             "Cannot extract clock domain name from code, need to specify.")
     if len(self.name) > 3 and self.name[:3] == "cd_":
         self.name = self.name[3:]
     self.clk = Signal(name_override=self.name + "_clk")
     if reset_less:
         self.rst = None
     else:
         self.rst = Signal(name_override=self.name + "_rst")
Ejemplo n.º 10
0
	def __init__(self, name=None, reset_less=False):
		self.name = tracer.get_obj_var_name(name)
		if self.name is None:
			raise ValueError("Cannot extract clock domain name from code, need to specify.")
		if self.name.startswith("cd_"):
			self.name = self.name[3:]
		if self.name[0].isdigit():
			raise ValueError("Clock domain name cannot start with a number.")
		self.clk = Signal(name_override=self.name + "_clk")
		if reset_less:
			self.rst = None
		else:
			self.rst = Signal(name_override=self.name + "_rst")
Ejemplo n.º 11
0
 def __init__(self, name=None, reset_less=False):
     self.name = _tracer.get_obj_var_name(name)
     if self.name is None:
         raise ValueError("Cannot extract clock domain name from code, need to specify.")
     if self.name.startswith("cd_"):
         self.name = self.name[3:]
     if self.name[0].isdigit():
         raise ValueError("Clock domain name cannot start with a number.")
     self.clk = Signal(name_override=self.name + "_clk")
     if reset_less:
         self.rst = None
     else:
         self.rst = Signal(name_override=self.name + "_rst")
Ejemplo n.º 12
0
    def __init__(self, layout, name=None, **kwargs):
        self.name = get_obj_var_name(name, "")
        self.layout = layout

        if self.name:
            prefix = self.name + "_"
        else:
            prefix = ""
        for f in self.layout:
            if isinstance(f[1], (int, tuple)):  # cases 1/2
                if(len(f) == 3):
                    fname, fsize, fdirection = f
                else:
                    fname, fsize = f
                finst = Signal(fsize, name=prefix + fname, **kwargs)
            elif isinstance(f[1], list):  # case 3
                fname, fsublayout = f
                finst = Record(fsublayout, prefix + fname, **kwargs)
            else:
                raise TypeError
            setattr(self, fname, finst)
Ejemplo n.º 13
0
    def __init__(self, layout, name=None, **kwargs):
        self.name = get_obj_var_name(name, "")
        self.layout = layout

        if self.name:
            prefix = self.name + "_"
        else:
            prefix = ""
        for f in self.layout:
            if isinstance(f[1], (int, tuple)):  # cases 1/2
                if(len(f) == 3):
                    fname, fsize, fdirection = f
                else:
                    fname, fsize = f
                finst = Signal(fsize, name=prefix + fname, **kwargs)
            elif isinstance(f[1], list):  # case 3
                fname, fsublayout = f
                finst = Record(fsublayout, prefix + fname, **kwargs)
            else:
                raise TypeError
            setattr(self, fname, finst)
Ejemplo n.º 14
0
Archivo: csr.py Proyecto: peteut/misoc
 def __init__(self, value, bits_sign=None, name=None):
     super().__init__()
     self.value = Constant(value, bits_sign)
     self.name = get_obj_var_name(name)
     if self.name is None:
         raise ValueError("Cannot extract CSR name from code, need to specify.")
Ejemplo n.º 15
0
Archivo: csr.py Proyecto: peteut/misoc
 def __init__(self, size, name):
     super().__init__()
     self.name = get_obj_var_name(name)
     if self.name is None:
         raise ValueError("Cannot extract CSR name from code, need to specify.")
     self.size = size