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:
Florent Kermarrec 2018-06-12 10:54:20 +02:00
parent c534250c43
commit 3e723d152a
4 changed files with 17 additions and 1 deletions

View File

@ -56,6 +56,10 @@ class LM32(Module):
]
# add verilog sources
self.add_sources(platform)
@staticmethod
def add_sources(platform):
vdir = os.path.join(
os.path.abspath(os.path.dirname(__file__)), "verilog")
platform.add_sources(os.path.join(vdir, "submodule", "rtl"),

View File

@ -105,6 +105,10 @@ class MOR1KX(Module):
]
# add verilog sources
self.add_sources(platform)
@staticmethod
def add_sources(platform):
vdir = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
"verilog", "rtl", "verilog")

View File

@ -118,6 +118,10 @@ class PicoRV32(Module):
]
# add verilog sources
self.add_sources(platform)
@staticmethod
def add_sources(platform):
vdir = os.path.join(
os.path.abspath(os.path.dirname(__file__)), "verilog")
platform.add_source(os.path.join(vdir, "picorv32.v"))

View File

@ -44,7 +44,11 @@ class VexRiscv(Module):
i_dBusWishbone_ACK=d.ack,
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")
platform.add_sources(os.path.join(vdir), "VexRiscv.v")
platform.add_verilog_include_path(vdir)