m-labs / migen

A Python toolbox for building complex digital hardware
https://m-labs.hk/migen
Other
1.2k stars 210 forks source link

How to link between Migen and Icarus Iverilog For simulation?? #122

Closed bhatmahadev6 closed 6 years ago

bhatmahadev6 commented 6 years ago

As given in docs i am not able to understand how to link to iverilog and simulate it further in gtkwave. I am not able to understand "make" commands in docs

sbourdeauducq commented 6 years ago

The docs you are reading are out of date, there is the migen built-in simulator now that does not require an external simulator. If you do want to use Icarus, you can resurrect the old migen code.

bhatmahadev6 commented 6 years ago

from migen import * from migen.sim.vcd import VCDWriter, DummyVCDWriter class ORGate(Module): def init(self): self.a = Signal() self.b = Signal() self.x = Signal()

###

self.comb += self.x.eq(self.a | self.b)

dut = ORGate()

def testbench(): yield dut.a.eq(0) yield dut.b.eq(0) yield assert (yield dut.x) == 0

yield dut.a.eq(0) yield dut.b.eq(1) yield assert (yield dut.x) == 1

run_simulation(dut, testbench(),vcd_name="file.vcd")

i Ran this code ,But i am not getting any output,its just executing

On Tue, Jul 31, 2018 at 5:46 PM, Sébastien Bourdeauducq < notifications@github.com> wrote:

The docs you are reading are out of date, there is the migen built-in simulator now that does not require an external simulator. If you do want to use Icarus, you can resurrect the old migen code.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/m-labs/migen/issues/122#issuecomment-409199893, or mute the thread https://github.com/notifications/unsubscribe-auth/AWjrOTZBxxUnTijb765BaXiPtOaRFofmks5uMEqxgaJpZM4VoIos .

bhatmahadev6 commented 6 years ago

sorry Got it...

On Tue, Jul 31, 2018 at 5:46 PM, Sébastien Bourdeauducq < notifications@github.com> wrote:

The docs you are reading are out of date, there is the migen built-in simulator now that does not require an external simulator. If you do want to use Icarus, you can resurrect the old migen code.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/m-labs/migen/issues/122#issuecomment-409199893, or mute the thread https://github.com/notifications/unsubscribe-auth/AWjrOTZBxxUnTijb765BaXiPtOaRFofmks5uMEqxgaJpZM4VoIos .