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: m-labs/nmigen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b5d3960691da
Choose a base ref
...
head repository: m-labs/nmigen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7b25665fde81
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Jan 25, 2019

  1. back.pysim: fix behavior of initial cycle for sync processes.

    The current behavior was introduced in 6570271, which was a wrong
    fix for an issue that was actually fixed in 12e04e4. This commit
    effectively reverts 6570271 and 1782b84.
    whitequark committed Jan 25, 2019
    Copy the full SHA
    7b25665 View commit details
Showing with 4 additions and 7 deletions.
  1. +3 −3 nmigen/back/pysim.py
  2. +1 −1 nmigen/lib/fifo.py
  3. +0 −3 nmigen/test/test_sim.py
6 changes: 3 additions & 3 deletions nmigen/back/pysim.py
Original file line number Diff line number Diff line change
@@ -414,13 +414,13 @@ def add_sync_process(self, process, domain="sync"):
process = self._check_process(process)
def sync_process():
try:
result = None
cmd = None
while True:
self._process_loc[sync_process] = self._name_process(process)
cmd = process.send(result)
if cmd is None:
cmd = Tick(domain)
result = yield cmd
self._process_loc[sync_process] = self._name_process(process)
cmd = process.send(result)
except StopIteration:
pass
sync_process = sync_process()
2 changes: 1 addition & 1 deletion nmigen/lib/fifo.py
Original file line number Diff line number Diff line change
@@ -72,9 +72,9 @@ def __init__(self, width, depth, fwft):

def read(self):
"""Read method for simulation."""
assert (yield self.readable)
yield self.re.eq(1)
yield
assert (yield self.readable)
value = (yield self.dout)
yield self.re.eq(0)
return value
3 changes: 0 additions & 3 deletions nmigen/test/test_sim.py
Original file line number Diff line number Diff line change
@@ -279,9 +279,6 @@ def test_counter_clock_and_sync_process(self):
with self.assertSimulation(self.m) as sim:
sim.add_clock(1e-6, domain="sync")
def process():
self.assertEqual((yield self.count), 4)
self.assertEqual((yield self.sync.clk), 0)
yield
self.assertEqual((yield self.count), 4)
self.assertEqual((yield self.sync.clk), 1)
yield