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: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1a7bf7abb1d7
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 79d671638292
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 27, 2020

  1. applet.memory.prom: encourage (sic) metastability during reads.

    This change is tested with Atmel AT29C flash and may or may not have
    any effect on other memories. In case of this Atmel flash, output
    buffers have parasitic feedback (likely through power supply) and
    will oscillate if encouraged, e.g. if OE is kept asserted, or if data
    transitions are maximized.
    whitequark committed Jul 27, 2020
    Copy the full SHA
    8b9bc15 View commit details

Commits on Jul 28, 2020

  1. Copy the full SHA
    79d6716 View commit details
Showing with 9 additions and 1 deletion.
  1. +7 −1 software/glasgow/applet/memory/prom/__init__.py
  2. +2 −0 software/glasgow/database/microchip/avr.py
8 changes: 7 additions & 1 deletion software/glasgow/applet/memory/prom/__init__.py
Original file line number Diff line number Diff line change
@@ -227,7 +227,12 @@ def elaborate(self, platform):

with m.State("READ-CYCLE"):
with m.If(timer == 0):
m.d.sync += bus.oe.eq(0)
# Normally, this would be the place to deassert OE. However, this would reduce
# metastability (during burst reads) in the output buffers of a memory that is
# reading bits close to the buffer threshold. Wait, isn't metastability bad?
# Normally yes, but this is a special case! Metastability causes unstable
# bits, and unstable bits reduce the chance that corrupt data will slip
# through undetected.
m.d.sync += dq_latch.eq(bus.q)
m.next = "READ-SEND"
with m.Else():
@@ -244,6 +249,7 @@ def elaborate(self, platform):
with m.State("WRITE-RECV"):
with m.If(dq_index == dq_bytes):
m.d.sync += bus.d.eq(dq_latch)
m.d.sync += bus.oe.eq(0) # see comment in READ-CYCLE
m.d.sync += bus.we.eq(1)
m.d.sync += timer.eq(write_cycle_cyc)
m.next = "WRITE-CYCLE"
2 changes: 2 additions & 0 deletions software/glasgow/database/microchip/avr.py
Original file line number Diff line number Diff line change
@@ -41,6 +41,8 @@ def ATmega(name, signature, program_size, program_page, eeprom_size):
ATmega("168P", (0x1e, 0x94, 0x0b), program_size=16384, program_page=128, eeprom_size=512),
ATmega("328", (0x1e, 0x95, 0x14), program_size=32768, program_page=128, eeprom_size=1024),
ATmega("328P", (0x1e, 0x95, 0x0f), program_size=32768, program_page=128, eeprom_size=1024),
ATmega("16U4", (0x1e, 0x94, 0x88), program_size=16384, program_page=64, eeprom_size=4),
ATmega("32U4", (0x1e, 0x95, 0x87), program_size=16384, program_page=64, eeprom_size=4),
]

devices_by_signature = defaultdict(lambda: None,