trenz_c10lprefkit: Add Etherbone support.
This commit is contained in:
parent
1ce978806d
commit
abb54cebb3
|
@ -58,7 +58,9 @@ class BaseSoC(SoCCore):
|
||||||
}
|
}
|
||||||
mem_map.update(SoCCore.mem_map)
|
mem_map.update(SoCCore.mem_map)
|
||||||
|
|
||||||
def __init__(self, sys_clk_freq=int(50e6), with_ethernet=False, with_led_chaser=True, **kwargs):
|
def __init__(self, sys_clk_freq=int(50e6), with_led_chaser=True,
|
||||||
|
with_ethernet=False, with_etherbone=False,
|
||||||
|
**kwargs):
|
||||||
platform = c10lprefkit.Platform()
|
platform = c10lprefkit.Platform()
|
||||||
|
|
||||||
# SoCCore ----------------------------------------------------------------------------------
|
# SoCCore ----------------------------------------------------------------------------------
|
||||||
|
@ -83,12 +85,15 @@ class BaseSoC(SoCCore):
|
||||||
l2_cache_size = kwargs.get("l2_size", 8192)
|
l2_cache_size = kwargs.get("l2_size", 8192)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Ethernet ---------------------------------------------------------------------------------
|
# Ethernet / Etherbone ---------------------------------------------------------------------
|
||||||
if with_ethernet:
|
if with_ethernet or with_etherbone:
|
||||||
self.submodules.ethphy = LiteEthPHYMII(
|
self.submodules.ethphy = LiteEthPHYMII(
|
||||||
clock_pads = self.platform.request("eth_clocks"),
|
clock_pads = self.platform.request("eth_clocks"),
|
||||||
pads = self.platform.request("eth"))
|
pads = self.platform.request("eth"))
|
||||||
|
if with_ethernet:
|
||||||
self.add_ethernet(phy=self.ethphy)
|
self.add_ethernet(phy=self.ethphy)
|
||||||
|
if with_etherbone:
|
||||||
|
self.add_etherbone(phy=self.ethphy)
|
||||||
|
|
||||||
# Leds -------------------------------------------------------------------------------------
|
# Leds -------------------------------------------------------------------------------------
|
||||||
if with_led_chaser:
|
if with_led_chaser:
|
||||||
|
@ -104,6 +109,7 @@ def main():
|
||||||
parser.add_argument("--load", action="store_true", help="Load bitstream.")
|
parser.add_argument("--load", action="store_true", help="Load bitstream.")
|
||||||
parser.add_argument("--sys-clk-freq", default=50e6, help="System clock frequency.")
|
parser.add_argument("--sys-clk-freq", default=50e6, help="System clock frequency.")
|
||||||
parser.add_argument("--with-ethernet", action="store_true", help="Enable Ethernet support.")
|
parser.add_argument("--with-ethernet", action="store_true", help="Enable Ethernet support.")
|
||||||
|
parser.add_argument("--with-etherbone", action="store_true", help="Enable Etherbone support.")
|
||||||
builder_args(parser)
|
builder_args(parser)
|
||||||
soc_core_args(parser)
|
soc_core_args(parser)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
@ -111,6 +117,7 @@ def main():
|
||||||
soc = BaseSoC(
|
soc = BaseSoC(
|
||||||
sys_clk_freq = int(float(args.sys_clk_freq)),
|
sys_clk_freq = int(float(args.sys_clk_freq)),
|
||||||
with_ethernet = args.with_ethernet,
|
with_ethernet = args.with_ethernet,
|
||||||
|
with_etherbone = args.with_etherbone,
|
||||||
**soc_core_argdict(args)
|
**soc_core_argdict(args)
|
||||||
)
|
)
|
||||||
builder = Builder(soc, **builder_argdict(args))
|
builder = Builder(soc, **builder_argdict(args))
|
||||||
|
|
Loading…
Reference in New Issue