Skip to content

Instantly share code, notes, and snippets.

@cr1901
Created September 16, 2015 12:08
Show Gist options
  • Save cr1901/8c6f2c4ac30fb0b01576 to your computer and use it in GitHub Desktop.
Save cr1901/8c6f2c4ac30fb0b01576 to your computer and use it in GitHub Desktop.
Migen Case Bug?
from migen import *
from migen.fhdl import verilog
class CaseTest(Module):
def __init__(self):
self.a = Signal(1)
self.b = Signal(1)
self.choose = Signal(1)
self.o = Signal(1)
case_index = [self.a, self.b]
act = dict((i, self.o.eq(case_index[i])) for i in range(2))
self.comb += [Case(self.choose, act)]
print(verilog.convert(CaseTest()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment