Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitequark/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 91dfc35ec4a4
Choose a base ref
...
head repository: whitequark/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7e47987d65e0
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Mar 8, 2019

  1. *.xc9500→*.xc9500xl

    The XC9500 and XC9500XL series have completely different programming
    interfaces, and rather large other differences as well.
    whitequark committed Mar 8, 2019
    Copy the full SHA
    7e47987 View commit details
2 changes: 1 addition & 1 deletion software/glasgow/applet/all.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
from .program.ice40_flash import ProgramICE40FlashApplet
from .program.ice40_sram import ProgramICE40SRAMApplet
from .program.mec16xx import ProgramMEC16xxApplet
from .program.xc9500 import ProgramXC9500Applet
from .program.xc9500xl import ProgramXC9500XLApplet

from .control.tps6598x import ControlTPS6598xApplet

Original file line number Diff line number Diff line change
@@ -219,8 +219,8 @@
from bitarray import bitarray

from ....arch.jtag import *
from ....arch.xilinx.xc9500 import *
from ....database.xilinx.xc9500 import *
from ....arch.xilinx.xc9500xl import *
from ....database.xilinx.xc9500xl import *
from ...interface.jtag_probe import JTAGProbeApplet
from ... import *

@@ -247,11 +247,11 @@ def bitstream_to_device_address(word_address):
return 32 * block_num + 8 * (block_off // GROUP_WORDS) + block_off % GROUP_WORDS


class XC9500Error(GlasgowAppletError):
class XC9500XLError(GlasgowAppletError):
pass


class XC9500Interface:
class XC9500XLInterface:
def __init__(self, interface, logger, frequency):
self.lower = interface
self._logger = logger
@@ -348,7 +348,7 @@ async def bulk_erase(self):
isaddr_bits = await self.lower.read_dr(18)
isaddr = DR_ISADDRESS.from_bitarray(isaddr_bits)
if not (isaddr.valid and not isaddr.strobe):
raise XC9500Error("bulk erase failed %s" % isaddr.bits_repr())
raise XC9500XLError("bulk erase failed %s" % isaddr.bits_repr())

async def _fpgm(self, address, words):
await self.lower.write_ir(IR_FPGM)
@@ -413,11 +413,11 @@ async def program(self, address, words, fast=True):
return await self._fpgm(address, words)


class ProgramXC9500Applet(JTAGProbeApplet, name="program-xc9500"):
class ProgramXC9500XLApplet(JTAGProbeApplet, name="program-xc9500xl"):
logger = logging.getLogger(__name__)
help = "program Xilinx XC9500 CPLDs via JTAG"
help = "program Xilinx XC9500XL CPLDs via JTAG"
description = """
Program, verify, and read out Xilinx XC9500 series CPLD bitstreams via the JTAG interface.
Program, verify, and read out Xilinx XC9500XL series CPLD bitstreams via the JTAG interface.
It is recommended to use TCK frequency between 100 and 250 kHz for programming.
@@ -427,7 +427,7 @@ class ProgramXC9500Applet(JTAGProbeApplet, name="program-xc9500"):
Supported devices are:
{devices}
The Glasgow .bit XC9500 bitstream format is a flat, unstructured sequence of 32-bit words
The Glasgow .bit XC9500XL bitstream format is a flat, unstructured sequence of 32-bit words
comprising the bitstream, written in little endian binary. It is substantially different
from both .jed and .svf bitstream formats, but matches the internal device programming
architecture.
@@ -451,7 +451,7 @@ async def run(self, device, args):
if not tap_iface:
raise GlasgowAppletError("cannot select TAP #%d" % args.tap_index)

return XC9500Interface(tap_iface, self.logger, args.frequency * 1000)
return XC9500XLInterface(tap_iface, self.logger, args.frequency * 1000)

@classmethod
def add_interact_arguments(cls, parser):
@@ -536,8 +536,8 @@ async def interact(self, device, args, xc9500_iface):

# -------------------------------------------------------------------------------------------------

class ProgramXC9500AppletTool(GlasgowAppletTool, applet=ProgramXC9500Applet):
help = "manipulate Xilinx XC9500 CPLD bitstreams"
class ProgramXC9500XLAppletTool(GlasgowAppletTool, applet=ProgramXC9500XLApplet):
help = "manipulate Xilinx XC9500XL CPLD bitstreams"
description = """
See `run jtag-xc9500 --help` for details.
"""
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -4,13 +4,13 @@
__all__ = ["devices", "devices_by_idcode"]


XC9500Device = namedtuple("XC9500Device", (
XC9500XLDevice = namedtuple("XC9500XLDevice", (
"name", "idcode", "bitstream_words", "usercode_low", "usercode_high"
))


devices = [
XC9500Device("XC9572XL",
XC9500XLDevice("XC9572XL",
idcode=(0x049, 0x9604),
bitstream_words=1620,
usercode_low=90, usercode_high=105),