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: 4190b20fc603
Choose a base ref
...
head repository: whitequark/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cb4b8d38140e
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Nov 20, 2018

  1. Copy the full SHA
    2f0fe95 View commit details
  2. Copy the full SHA
    4fcd0b7 View commit details
  3. Copy the full SHA
    cb4b8d3 View commit details
Showing with 12 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +8 −5 software/glasgow/access/simulation/multiplexer.py
  3. +1 −1 software/glasgow/applet/jtag/pinout.py
  4. +2 −1 software/glasgow/applet/spi/flash_avr.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__pycache__/
*.egg-info/
*.eggs/
build/
*.pyc
*.v
13 changes: 8 additions & 5 deletions software/glasgow/access/simulation/multiplexer.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
from migen.genlib.fifo import _FIFOInterface, AsyncFIFO, SyncFIFOBuffered

from .. import AccessMultiplexer, AccessMultiplexerInterface
from ...gateware.fx2 import _FIFOWithFlush


class SimulationMultiplexer(AccessMultiplexer):
@@ -29,16 +30,16 @@ def get_pin_name(self, pin):
def build_pin_tristate(self, pin, oe, o, i):
pass

def _make_fifo(self, arbiter_side, logic_side, cd_logic, depth):
def _make_fifo(self, arbiter_side, logic_side, cd_logic, depth, wrapper=lambda x: x):
if cd_logic is None:
fifo = SyncFIFOBuffered(8, depth)
fifo = wrapper(SyncFIFOBuffered(8, depth))
else:
assert isinstance(cd_logic, ClockDomain)

fifo = ClockDomainsRenamer({
fifo = wrapper(ClockDomainsRenamer({
arbiter_side: "sys",
logic_side: "logic",
})(AsyncFIFO(8, depth))
})(AsyncFIFO(8, depth)))

fifo.clock_domains.cd_logic = ClockDomain()
self.comb += fifo.cd_logic.clk.eq(cd_logic.clk)
@@ -51,7 +52,9 @@ def get_in_fifo(self, depth=512, auto_flush=False, clock_domain=None):
assert self.in_fifo is None

self.submodules.in_fifo = self._make_fifo(
arbiter_side="read", logic_side="write", cd_logic=clock_domain, depth=depth)
arbiter_side="read", logic_side="write", cd_logic=clock_domain, depth=depth,
wrapper=lambda x: _FIFOWithFlush(x, async=clock_domain is not None,
auto_flush=auto_flush))
return self.in_fifo

def get_out_fifo(self, depth=512, clock_domain=None):
2 changes: 1 addition & 1 deletion software/glasgow/applet/jtag/pinout.py
Original file line number Diff line number Diff line change
@@ -292,4 +292,4 @@ async def interact(self, device, args, iface):
class JTAGPinoutAppletTestCase(GlasgowAppletTestCase, applet=JTAGPinoutApplet):
@synthesis_test
def test_build(self):
self.assertBuilds()
self.assertBuilds(args=["--pins-jtag", "0:3"])
3 changes: 2 additions & 1 deletion software/glasgow/applet/spi/flash_avr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
import math
import struct
import logging
import asyncio
@@ -269,7 +270,7 @@ def build(self, target, args):
pads=iface.get_pads(args, pins=self.__pins),
out_fifo=iface.get_out_fifo(),
in_fifo=iface.get_in_fifo(),
bit_rate=args.bit_rate * 1000,
period_cyc=math.ceil(target.sys_clk_freq / (args.bit_rate * 1000)),
sck_idle=0,
sck_edge="rising",
ss_active=0,