-
Notifications
You must be signed in to change notification settings - Fork 177
cxxsim: random garbage in memory traces #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is expected;
Will look into this. |
This is a problem with the way the simulation is reset. It is not entirely trivial to fix. |
This is fixed by YosysHQ/yosys#2495. |
Just to confirm that I've tried the above Yosys branch, and it does seem to fix the random garbage. from nmigen import Module, Memory
from nmigen.sim import Simulator
m = Module()
mem = Memory(width=64, depth=8)
wrport = mem.write_port()
rdport = mem.read_port()
m.submodules.rdport = rdport
m.submodules.wrport = wrport
def process():
yield wrport.en.eq(1)
yield wrport.data.eq(0x5432123412345678)
yield
yield
sim = Simulator(m, engine="cxxsim")
sim.add_clock(1e-6)
sim.add_sync_process(process)
with sim.write_vcd("bug27.vcd"):
sim.run() In the VCD trace, Not all is well, though. The branch seems to introduce a regression. from nmigen import Module, Signal
from nmigen.sim import Simulator
m = Module()
s = Signal()
m.d.sync += s.eq(1)
def process():
yield
sim = Simulator(m, engine="cxxsim")
sim.add_clock(1e-6)
sim.add_sync_process(process)
sim.run() Result:
|
This regression is something that will be fixed by the changes I will apply before merging. Nevertheless, I wasn't aware of it, so thanks anyway! |
That PR has been superseded by YosysHQ/yosys#3105. |
Fixed upstream, with no Amaranth-specific changes needed. |
Consider:
The CXXSim VCD file shows some strange behavior:
rdport
sub-module is absenttop
module has somemem[<i>][63:0]
signals that appear to contain random garbage.The text was updated successfully, but these errors were encountered: