Merge branch 'master' into jev/deca-eth

This commit is contained in:
enjoy-digital 2022-01-31 16:22:58 +01:00 committed by GitHub
commit 9144cb44fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 65 additions and 3 deletions

View file

@ -0,0 +1,22 @@
source [find interface/altera-usb-blaster.cfg]
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME 10m50
}
# user-defined chains are 0xC (12) or 0xE (14)
# they are the same, single, scan-chain disgtinguished by the usr1user bit
jtag newtap $_CHIPNAME tap -irlen 10 -expected-id 0x31810dd -expected-id 0x318a0dd \
-expected-id 0x31820dd -expected-id 0x31830dd -expected-id 0x31840dd \
-expected-id 0x318d0dd -expected-id 0x31850dd -expected-id 0x31010dd \
-expected-id 0x310a0dd -expected-id 0x31020dd -expected-id 0x31030dd \
-expected-id 0x31040dd -expected-id 0x310d0dd -expected-id 0x31050dd
# unneeded
# suppresses warning
gdb_port disabled
tcl_port disabled
telnet_port disabled

View file

@ -0,0 +1,22 @@
source [find interface/altera-usb-blaster2.cfg]
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME 10m50
}
# user-defined chains are 0xC (12) or 0xE (14)
# they are the same, single, scan-chain disgtinguished by the usr1user bit
jtag newtap $_CHIPNAME tap -irlen 10 -expected-id 0x31810dd -expected-id 0x318a0dd \
-expected-id 0x31820dd -expected-id 0x31830dd -expected-id 0x31840dd \
-expected-id 0x318d0dd -expected-id 0x31850dd -expected-id 0x31010dd \
-expected-id 0x310a0dd -expected-id 0x31020dd -expected-id 0x31030dd \
-expected-id 0x31040dd -expected-id 0x310d0dd -expected-id 0x31050dd
# unneeded
# suppresses warning
gdb_port disabled
tcl_port disabled
telnet_port disabled

View file

@ -53,15 +53,21 @@ class _CRG(Module):
# BaseSoC ------------------------------------------------------------------------------------------ # BaseSoC ------------------------------------------------------------------------------------------
class BaseSoC(SoCCore): class BaseSoC(SoCCore):
def __init__(self, sys_clk_freq=int(50e6), with_led_chaser=True, with_video_terminal=False, def __init__(self, sys_clk_freq=int(50e6), with_led_chaser=True, with_uartbone=False, with_jtagbone=False, with_video_terminal=False,
with_ethernet=False, with_etherbone=False, eth_ip="192.168.1.50", with_ethernet=False, with_etherbone=False, eth_ip="192.168.1.50",
eth_dynamic_ip=False, eth_dynamic_ip=False,
**kwargs): **kwargs):
self.platform = platform = deca.Platform() self.platform = platform = deca.Platform()
# Defaults to JTAG-UART since no hardware UART. # Defaults to JTAG-UART since no hardware UART.
if kwargs["uart_name"] == "serial": real_uart_name = kwargs["uart_name"]
kwargs["uart_name"] = "jtag_atlantic" if real_uart_name == "serial":
if with_jtagbone:
kwargs["uart_name"] = "crossover"
else:
kwargs["uart_name"] = "jtag_atlantic"
if with_uartbone:
kwargs["uart_name"] = "crossover"
# SoCCore ---------------------------------------------------------------------------------- # SoCCore ----------------------------------------------------------------------------------
SoCCore.__init__(self, platform, sys_clk_freq, SoCCore.__init__(self, platform, sys_clk_freq,
@ -71,6 +77,14 @@ class BaseSoC(SoCCore):
# CRG -------------------------------------------------------------------------------------- # CRG --------------------------------------------------------------------------------------
self.submodules.crg = self.crg = _CRG(platform, sys_clk_freq, with_usb_pll=False) self.submodules.crg = self.crg = _CRG(platform, sys_clk_freq, with_usb_pll=False)
# UARTbone ---------------------------------------------------------------------------------
if with_uartbone:
self.add_uartbone(name=real_uart_name, baudrate=kwargs["uart_baudrate"])
# JTAGbone ---------------------------------------------------------------------------------
if with_jtagbone:
self.add_jtagbone()
# Ethernet --------------------------------------------------------------------------------- # Ethernet ---------------------------------------------------------------------------------
if with_ethernet or with_etherbone: if with_ethernet or with_etherbone:
self.platform.toolchain.additional_sdc_commands += [ self.platform.toolchain.additional_sdc_commands += [
@ -111,6 +125,8 @@ def main():
ethopts.add_argument("--with-etherbone", action="store_true", help="Enable Etherbone support.") ethopts.add_argument("--with-etherbone", action="store_true", help="Enable Etherbone support.")
parser.add_argument("--eth-ip", default="192.168.1.50", type=str, help="Ethernet/Etherbone IP address.") parser.add_argument("--eth-ip", default="192.168.1.50", type=str, help="Ethernet/Etherbone IP address.")
parser.add_argument("--eth-dynamic-ip", action="store_true", help="Enable dynamic Ethernet IP addresses setting.") parser.add_argument("--eth-dynamic-ip", action="store_true", help="Enable dynamic Ethernet IP addresses setting.")
parser.add_argument("--with-uartbone", action="store_true", help="Enable UARTbone support.")
parser.add_argument("--with-jtagbone", action="store_true", help="Enable JTAGbone support.")
parser.add_argument("--with-video-terminal", action="store_true", help="Enable Video Terminal (VGA).") parser.add_argument("--with-video-terminal", action="store_true", help="Enable Video Terminal (VGA).")
builder_args(parser) builder_args(parser)
soc_core_args(parser) soc_core_args(parser)
@ -122,6 +138,8 @@ def main():
with_etherbone = args.with_etherbone, with_etherbone = args.with_etherbone,
eth_ip = args.eth_ip, eth_ip = args.eth_ip,
eth_dynamic_ip = args.eth_dynamic_ip, eth_dynamic_ip = args.eth_dynamic_ip,
with_uartbone = args.with_uartbone,
with_jtagbone = args.with_jtagbone,
with_video_terminal = args.with_video_terminal, with_video_terminal = args.with_video_terminal,
**soc_core_argdict(args) **soc_core_argdict(args)
) )