back.pysim: fix behavior of initial cycle for sync processes.
The current behavior was introduced in65702719
, which was a wrong fix for an issue that was actually fixed in12e04e4e
. This commit effectively reverts65702719
and1782b841
.
This commit is contained in:
parent
1782b841b2
commit
7b25665fde
|
@ -414,13 +414,13 @@ class Simulator:
|
||||||
process = self._check_process(process)
|
process = self._check_process(process)
|
||||||
def sync_process():
|
def sync_process():
|
||||||
try:
|
try:
|
||||||
result = None
|
cmd = None
|
||||||
while True:
|
while True:
|
||||||
self._process_loc[sync_process] = self._name_process(process)
|
|
||||||
cmd = process.send(result)
|
|
||||||
if cmd is None:
|
if cmd is None:
|
||||||
cmd = Tick(domain)
|
cmd = Tick(domain)
|
||||||
result = yield cmd
|
result = yield cmd
|
||||||
|
self._process_loc[sync_process] = self._name_process(process)
|
||||||
|
cmd = process.send(result)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
pass
|
pass
|
||||||
sync_process = sync_process()
|
sync_process = sync_process()
|
||||||
|
|
|
@ -72,9 +72,9 @@ class FIFOInterface:
|
||||||
|
|
||||||
def read(self):
|
def read(self):
|
||||||
"""Read method for simulation."""
|
"""Read method for simulation."""
|
||||||
|
assert (yield self.readable)
|
||||||
yield self.re.eq(1)
|
yield self.re.eq(1)
|
||||||
yield
|
yield
|
||||||
assert (yield self.readable)
|
|
||||||
value = (yield self.dout)
|
value = (yield self.dout)
|
||||||
yield self.re.eq(0)
|
yield self.re.eq(0)
|
||||||
return value
|
return value
|
||||||
|
|
|
@ -279,9 +279,6 @@ class SimulatorIntegrationTestCase(FHDLTestCase):
|
||||||
with self.assertSimulation(self.m) as sim:
|
with self.assertSimulation(self.m) as sim:
|
||||||
sim.add_clock(1e-6, domain="sync")
|
sim.add_clock(1e-6, domain="sync")
|
||||||
def process():
|
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.count), 4)
|
||||||
self.assertEqual((yield self.sync.clk), 1)
|
self.assertEqual((yield self.sync.clk), 1)
|
||||||
yield
|
yield
|
||||||
|
|
Loading…
Reference in a new issue