Skip to content

Instantly share code, notes, and snippets.

@mithro
Last active December 24, 2018 01:32
Show Gist options
  • Save mithro/32e4bcbba355f9bb498f80f51f56b26d to your computer and use it in GitHub Desktop.
Save mithro/32e4bcbba355f9bb498f80f51f56b26d to your computer and use it in GitHub Desktop.
from migen import *
class M(Module):
def __init__(self):
self.i_data = Signal()
self.o_data = Signal()
self.sync += [
self.o_data.eq(self.i_data),
]
def stim():
d = '01100111'
for i in range(len(d)+1):
if i < len(d):
yield dut.i_data.eq(int(d[i]))
yield
if i > 0:
print((yield dut.o_data))
dut = M()
run_simulation(dut, stim())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment