soc/cores/cpu: add add_sources static method
When creating SoC with multiple sub-SoC already generated, we need an easy way to add cpu sources.
This commit is contained in:
parent
c534250c43
commit
3e723d152a
|
@ -56,6 +56,10 @@ class LM32(Module):
|
||||||
]
|
]
|
||||||
|
|
||||||
# add verilog sources
|
# add verilog sources
|
||||||
|
self.add_sources(platform)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def add_sources(platform):
|
||||||
vdir = os.path.join(
|
vdir = os.path.join(
|
||||||
os.path.abspath(os.path.dirname(__file__)), "verilog")
|
os.path.abspath(os.path.dirname(__file__)), "verilog")
|
||||||
platform.add_sources(os.path.join(vdir, "submodule", "rtl"),
|
platform.add_sources(os.path.join(vdir, "submodule", "rtl"),
|
||||||
|
|
|
@ -105,6 +105,10 @@ class MOR1KX(Module):
|
||||||
]
|
]
|
||||||
|
|
||||||
# add verilog sources
|
# add verilog sources
|
||||||
|
self.add_sources(platform)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def add_sources(platform):
|
||||||
vdir = os.path.join(
|
vdir = os.path.join(
|
||||||
os.path.abspath(os.path.dirname(__file__)),
|
os.path.abspath(os.path.dirname(__file__)),
|
||||||
"verilog", "rtl", "verilog")
|
"verilog", "rtl", "verilog")
|
||||||
|
|
|
@ -118,6 +118,10 @@ class PicoRV32(Module):
|
||||||
]
|
]
|
||||||
|
|
||||||
# add verilog sources
|
# add verilog sources
|
||||||
|
self.add_sources(platform)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def add_sources(platform):
|
||||||
vdir = os.path.join(
|
vdir = os.path.join(
|
||||||
os.path.abspath(os.path.dirname(__file__)), "verilog")
|
os.path.abspath(os.path.dirname(__file__)), "verilog")
|
||||||
platform.add_source(os.path.join(vdir, "picorv32.v"))
|
platform.add_source(os.path.join(vdir, "picorv32.v"))
|
||||||
|
|
|
@ -44,7 +44,11 @@ class VexRiscv(Module):
|
||||||
i_dBusWishbone_ACK=d.ack,
|
i_dBusWishbone_ACK=d.ack,
|
||||||
i_dBusWishbone_ERR=d.err)
|
i_dBusWishbone_ERR=d.err)
|
||||||
|
|
||||||
# add Verilog sources
|
# add verilog sources
|
||||||
|
self.add_sources(platform)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def add_sources(platform):
|
||||||
vdir = os.path.join(os.path.abspath(os.path.dirname(__file__)), "verilog")
|
vdir = os.path.join(os.path.abspath(os.path.dirname(__file__)), "verilog")
|
||||||
platform.add_sources(os.path.join(vdir), "VexRiscv.v")
|
platform.add_sources(os.path.join(vdir), "VexRiscv.v")
|
||||||
platform.add_verilog_include_path(vdir)
|
platform.add_verilog_include_path(vdir)
|
||||||
|
|
Loading…
Reference in New Issue