Created
December 30, 2018 13:29
-
-
Save the6p4c/dc7d0c0243971ae026fbae479b9998b9 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.cli import main | |
class Test: | |
def __init__(self): | |
self.out = Signal(8) | |
def get_fragment(self, platform): | |
data = list(range(10)) | |
arr = Array(data) | |
idx = Signal(max=len(data)) | |
m = Module() | |
m.d.comb += self.out.eq(arr[idx]) | |
m.d.sync += idx.eq(idx + 1) | |
return m.lower(platform) | |
test = Test() | |
main(test, ports=[test.out]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment