-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tom Keddie
committed
Apr 25, 2020
1 parent
75ffe74
commit 88a9ae7
Showing
4 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
branch/ | ||
origin/ | ||
perbitoe/ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
all: origin branch perbitoe diff | ||
|
||
origin: singlebitoe.py | ||
python3 singlebitoe.py /home/tom/git/m-labs/migen origin | ||
|
||
branch: singlebitoe.py | ||
python3 singlebitoe.py /home/tom/git/TomKeddie/migen branch | ||
|
||
perbitoe: perbitoe.py | ||
python3 perbitoe.py /home/tom/git/TomKeddie/migen perbitoe | ||
|
||
clean: | ||
rm -rf origin branch perbitoe diff-* | ||
|
||
diff: diff_origin_branch diff_origin_perbitoe | ||
|
||
diff_origin_branch: | ||
diff origin/arty_a7_build/top.v branch/arty_a7_build/ | ||
diff origin/icebreaker_build/top.v branch/icebreaker_build/ | ||
diff origin/papilio_pro_build/top.v branch/papilio_pro_build/ | ||
diff origin/versaecp55g_build/top.v branch/versaecp55g_build/ | ||
|
||
diff_origin_perbitoe: | ||
-diff origin/arty_a7_build/top.v perbitoe/arty_a7_build/ | ||
-diff origin/icebreaker_build/top.v perbitoe/icebreaker_build/ | ||
-diff origin/papilio_pro_build/top.v perbitoe/papilio_pro_build/ | ||
-diff origin/versaecp55g_build/top.v perbitoe/versaecp55g_build/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import sys | ||
|
||
if len(sys.argv) != 3: | ||
print("Usage: {} <migenpath> <builddir>".format(sys.argv[0])) | ||
sys.exit(-1) | ||
|
||
sys.path.append(sys.argv[1]) | ||
build_dir=sys.argv[2] | ||
|
||
from migen import * | ||
from migen.build.generic_platform import Pins | ||
from migen.build.platforms import icebreaker, arty_a7, papilio_pro, versaecp55g | ||
|
||
_icebreaker_connector = [ | ||
("io", 0, Pins("PMOD1A:0", "PMOD1A:1")), | ||
] | ||
|
||
_papilio_pro_connector = [ | ||
("io", 0, Pins("A:0", "A:1")), | ||
] | ||
|
||
_arty_a7_connector = [ | ||
("io", 0, Pins("pmoda:0", "pmoda:1")), | ||
] | ||
|
||
_versaecp55g_connector = [ | ||
("io", 0, Pins("X3:4", "X3:5")), | ||
] | ||
|
||
class module(Module): | ||
def __init__(self, plat): | ||
pads = plat.request("io") | ||
counter = Signal(26) | ||
t = TSTriple(len(pads), per_bit_oe=True) | ||
self.comb += t.o.eq(counter[25:23:-1]) | ||
self.comb += t.oe.eq(counter[25:23:-1]) | ||
self.specials += t.get_tristate(pads) | ||
self.sync += If(t.i[0] | t.i[1], counter.eq(0)).Else(counter.eq(counter + 1)) | ||
|
||
plat_icebreaker = icebreaker.Platform() | ||
plat_icebreaker.add_extension(_icebreaker_connector) | ||
plat_icebreaker.build(module(plat_icebreaker), run=False, build_dir=build_dir + "/icebreaker_build") | ||
|
||
plat_papilio_pro = papilio_pro.Platform() | ||
plat_papilio_pro.add_extension(_papilio_pro_connector) | ||
plat_papilio_pro.build(module(plat_papilio_pro), run=False, build_dir=build_dir + "/papilio_pro_build") | ||
|
||
plat_versaecp55g = versaecp55g.Platform() | ||
plat_versaecp55g.add_extension(_versaecp55g_connector) | ||
plat_versaecp55g.build(module(plat_versaecp55g), run=False, build_dir=build_dir + "/versaecp55g_build") | ||
|
||
plat_arty_a7 = arty_a7.Platform() | ||
plat_arty_a7.add_extension(_arty_a7_connector) | ||
plat_arty_a7.build(module(plat_arty_a7), run=False, build_dir=build_dir + "/arty_a7_build") | ||
|
||
|
||
|
||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import sys | ||
|
||
if len(sys.argv) != 3: | ||
print("Usage: {} <migenpath> <builddir>".format(sys.argv[0])) | ||
sys.exit(-1) | ||
|
||
sys.path.append(sys.argv[1]) | ||
build_dir=sys.argv[2] | ||
|
||
from migen import * | ||
from migen.build.generic_platform import Pins | ||
from migen.build.platforms import icebreaker, arty_a7, papilio_pro, versaecp55g | ||
|
||
_icebreaker_connector = [ | ||
("io", 0, Pins("PMOD1A:0", "PMOD1A:1")), | ||
] | ||
|
||
_papilio_pro_connector = [ | ||
("io", 0, Pins("A:0", "A:1")), | ||
] | ||
|
||
_arty_a7_connector = [ | ||
("io", 0, Pins("pmoda:0", "pmoda:1")), | ||
] | ||
|
||
_versaecp55g_connector = [ | ||
("io", 0, Pins("X3:4", "X3:5")), | ||
] | ||
|
||
class module(Module): | ||
def __init__(self, plat): | ||
pads = plat.request("io") | ||
counter = Signal(26) | ||
t = TSTriple(len(pads)) | ||
self.comb += t.o.eq(counter[25:23:-1]) | ||
self.comb += t.oe.eq(counter[25:23:-1]) | ||
self.specials += t.get_tristate(pads) | ||
self.sync += If(t.i[0] | t.i[1], counter.eq(0)).Else(counter.eq(counter + 1)) | ||
|
||
plat_icebreaker = icebreaker.Platform() | ||
plat_icebreaker.add_extension(_icebreaker_connector) | ||
plat_icebreaker.build(module(plat_icebreaker), run=False, build_dir=build_dir + "/icebreaker_build") | ||
|
||
plat_papilio_pro = papilio_pro.Platform() | ||
plat_papilio_pro.add_extension(_papilio_pro_connector) | ||
plat_papilio_pro.build(module(plat_papilio_pro), run=False, build_dir=build_dir + "/papilio_pro_build") | ||
|
||
plat_versaecp55g = versaecp55g.Platform() | ||
plat_versaecp55g.add_extension(_versaecp55g_connector) | ||
plat_versaecp55g.build(module(plat_versaecp55g), run=False, build_dir=build_dir + "/versaecp55g_build") | ||
|
||
plat_arty_a7 = arty_a7.Platform() | ||
plat_arty_a7.add_extension(_arty_a7_connector) | ||
plat_arty_a7.build(module(plat_arty_a7), run=False, build_dir=build_dir + "/arty_a7_build") | ||
|
||
|
||
|
||
|
||
|
||
|