Skip to content

Commit

Permalink
Merge pull request #87 from mossmann/rename-luna
Browse files Browse the repository at this point in the history
Update incorrect or confusing usage of "LUNA"
  • Loading branch information
mossmann authored Jun 26, 2024
2 parents 25d5b14 + 823d795 commit 941e128
Show file tree
Hide file tree
Showing 50 changed files with 117 additions and 115 deletions.
21 changes: 10 additions & 11 deletions apollo_fpga/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ApolloDebugger:
LED_PATTERN_UPLOAD = 50


# External boards (non-LUNA boards) are indicated with a Major revision of 0xFF.
# External boards (non-Cynthion boards) are indicated with a Major revision of 0xFF.
# Their minor revision then encodes the board type.
EXTERNAL_BOARD_MAJOR = 0xFF
EXTERNAL_BOARD_NAMES = {
Expand All @@ -73,7 +73,7 @@ class ApolloDebugger:
}


# LUNA subdevices (specialized variants of the LUNA board) use a major of 0xFE.
# Cynthion subdevices (specialized variants Cynthion) use a major of 0xFE.
SUBDEVICE_MAJORS = {
0xFE: "Amalthea"
}
Expand All @@ -93,8 +93,7 @@ def __init__(self, force_offline=False):
# First, find the candidate device...
fpga_device = self._find_device(self.LUNA_USB_IDS, custom_match=self._device_has_stub_iface)
if fpga_device is None:
raise DebuggerNotFound("No Apollo or valid LUNA device found. "
"The LUNA_USB_IDS environment variable can be used to add custom VID:PID pairs.")
raise DebuggerNotFound("No Apollo device or stub interface found.")
elif not force_offline:
raise DebuggerNotFound("Apollo stub interface found. "
"Switch the device to Apollo mode or add the `--force-offline` option.")
Expand Down Expand Up @@ -177,7 +176,7 @@ def detect_connected_version(self):


def get_fpga_type(self):
""" Returns a string indicating the type of FPGA populated on the connected LUNA board.
""" Returns a string indicating the type of FPGA populated on the connected Apollo board.
The returned format is the same as used in a nMigen platform file; and can be used to override
a platform's device type.
Expand Down Expand Up @@ -215,31 +214,31 @@ def get_hardware_revision(self):
def get_hardware_name(self):
""" Returns a string describing this piece of hardware. """

# If this is a non-LUNA board, we'll look up its name in our table.
# If this is a non-Cynthion board, we'll look up its name in our table.
if self.major == self.EXTERNAL_BOARD_MAJOR:
return self.EXTERNAL_BOARD_NAMES[self.minor]

# If this is a non-LUNA board, we'll look up its name in our table.
# If this is a non-Cynthion board, we'll look up its name in our table.
if self.major in self.SUBDEVICE_MAJORS:
product_name = self.SUBDEVICE_MAJORS[self.major]
major = 0 # For now?
else:
product_name = "LUNA"
product_name = "Cynthion"
major = self.major

# Otherwise, identify it by its revision number.
return f"{product_name} r{major}.{self.minor}"


def get_compatibility_string(self):
""" Returns 'LUNA' for a LUNA board; or 'LUNA-compatible' for supported external board."""
""" Returns 'Cynthion' for a Cynthion board; or 'Apollo' for supported external board."""

if self.major == self.EXTERNAL_BOARD_MAJOR:
return 'LUNA-compatible'
return 'Apollo'
elif self.major in self.SUBDEVICE_MAJORS:
return self.SUBDEVICE_MAJORS[self.major]

return 'LUNA'
return 'Cynthion'


def create_jtag_programmer(self, jtag_chain):
Expand Down
15 changes: 9 additions & 6 deletions apollo_fpga/ecp5.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#
# This file is part of LUNA
# This file is part of Apollo.
#
# Copyright (c) 2020 Great Scott Gadgets <[email protected]>
# Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause

""" ECP5 configuration code for LUNA. """
""" ECP5 configuration. """

from logging import disable
from re import U
Expand Down Expand Up @@ -423,9 +423,12 @@ def configure(self, bitstream):
# Perform any pre-configuration tasks necessary.
self._perform_preconfiguration_tasks()

# Capture the part ID, and then verify that our bitstream matches.
# FIXME: use the bitstream file to get the ID, not our exected LUNA ID
# Read the part ID from the FPGA and verify that it is in the valid range.
self._capture_part_id()

# We could check that the FPGA's part ID matches the bitstream's
# part ID at this point, but for now we try to proceed without
# verification. If there is a mismatch, configuration will fail.
#self._execute_command(self.Opcode.VERIFY_ID, b"\x21\x11\x10\x43")

# ???
Expand Down Expand Up @@ -1297,4 +1300,4 @@ def _enter_background_spi(self, reset_flash=True):
def _background_spi_transfer(self, data, reverse=False, ignore_response=False):
""" Performs a SPI transfer, targeting the configuration flash."""
return self.bridge.transfer(data)


6 changes: 3 additions & 3 deletions apollo_fpga/ila.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This file is part of LUNA.
# This file is part of Apollo.
#
# Copyright (c) 2020 Great Scott Gadgets <[email protected]>
# Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause

""" Apollo-based ILA transports. """
Expand Down Expand Up @@ -159,7 +159,7 @@ def _emit_gtkw(self, filename, dump_filename, *, add_clock=True):
gtkw = GTKWSave(f)

# Comments / context.
gtkw.comment("Generated by the LUNA ILA.")
gtkw.comment("Generated by the Apollo ILA.")

# Add a reference to the dumpfile we're working with.
gtkw.dumpfile(dump_filename)
Expand Down
6 changes: 3 additions & 3 deletions apollo_fpga/intel.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#
# This file is part of LUNA
# This file is part of Apollo.
#
# Copyright (c) 2020 Great Scott Gadgets <[email protected]>
# Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause

""" ECP5 configuration code for LUNA. """
""" Intel FPGA configuration. """

import time

Expand Down
4 changes: 2 additions & 2 deletions apollo_fpga/jtag.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This file is part of LUNA
# This file is part of Apollo.
#
# Copyright (c) 2020 Great Scott Gadgets <[email protected]>
# Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause

from re import A
Expand Down
6 changes: 3 additions & 3 deletions apollo_fpga/onboard_jtag.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This file is part of LUNA
# This file is part of Apollo.
#
# Copyright (c) 2020 Great Scott Gadgets <[email protected]>
# Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause

""" JTAG definitions for on-board JTAG devices. """
Expand All @@ -10,7 +10,7 @@


#
# ECP5 FPGAs that can be populated onto LUNA boards.
# ECP5 FPGAs that can be populated onto Cynthion boards.
#

class LatticeECP5_12F(JTAGDevice):
Expand Down
4 changes: 2 additions & 2 deletions apollo_fpga/spi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This file is part of LUNA.
# This file is part of Apollo.
#
# Copyright (c) 2020 Great Scott Gadgets <[email protected]>
# Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause

# Vendor requests.
Expand Down
4 changes: 2 additions & 2 deletions apollo_fpga/support/selftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This file is part of LUNA.
# This file is part of Apollo.
#
# Copyright (c) 2020 Great Scott Gadgets <[email protected]>
# Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause

""" Helpers for building self-test applets around Apollo."""
Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d11/board.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Build specifics for SAMD11 Xplained hardware.
# Build specifics for Cynthion.
#

SOURCES += $(wildcard src/mcu/samd11/*.c)
SOURCES += $(wildcard src/mcu/samd11/*.c)
2 changes: 1 addition & 1 deletion firmware/src/boards/cynthion_d11/led.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* LED control abstraciton code.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d11/spi.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* SPI driver code.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d11/spi.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* SPI driver code.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d11/uart.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* UART driver code.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d21/apollo_board.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Apollo board definitions for LUNA hardware.
* Apollo board definitions for Cynthion r0.1 and r0.2.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion firmware/src/boards/cynthion_d21/board.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Build specifics for LUNA hardware.
# Build specifics for Cynthion.
#

SOURCES += $(wildcard src/mcu/samd11/*.c)
Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d21/debug_spi.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Interface code for communicating with the FPGA over the Debug SPI connection.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d21/led.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* LED control abstraciton code.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
6 changes: 3 additions & 3 deletions firmware/src/boards/cynthion_d21/selftest.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Self-test & factory validation functionality for LUNA.
* Self-test & factory validation functionality for Cynthion.
*
* This file is part of LUNA.
* This file is part of Cynthion.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d21/selftest.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Self-test & factory validation helpers.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d21/spi.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* SPI driver code.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d21/spi.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* SPI driver code.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/cynthion_d21/uart.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* UART driver code.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
6 changes: 3 additions & 3 deletions firmware/src/boards/daisho/apollo_board.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Apollo board definitions for LUNA hardware.
* Apollo board definitions for Daisho.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/daisho/led.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* LED control abstraciton code.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
4 changes: 2 additions & 2 deletions firmware/src/boards/daisho/uart.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* UART driver code.
*
* This file is part of LUNA.
* This file is part of Apollo.
*
* Copyright (c) 2020 Great Scott Gadgets <[email protected]>
* Copyright (c) 2020-2024 Great Scott Gadgets <[email protected]>
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down
Loading

0 comments on commit 941e128

Please sign in to comment.