-
-
Save awygle/821434bc1b2846453bcba3c46e032973 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nmigen import * | |
from nmigen.lib.io import * | |
from nmigen.back.pysim import * | |
from nmigen.cli import main | |
from nmigen.asserts import Rose, Fell | |
from cic_bus import CICBus | |
import random | |
region_id = Const(0b0001) # NTSC, make configurable later | |
# CIC control module | |
class CICTop(Elaboratable): | |
def __init__(self): | |
pass | |
def ports(self): | |
pass | |
def elaborate(self, platform): | |
m = Module() | |
bus_input = Signal() | |
counter = Signal(range(region_id.width)) | |
# state machine | |
with m.FSM() as fsm: | |
""" | |
REGION ID STATE: | |
write the 4 bits of the Region ID | |
""" | |
with m.State("REGION_ID"): | |
m.d.sync += bus_input.eq(region_id[counter]) | |
m.d.sync += counter.eq(counter + 1 ) | |
return m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment