diff --git a/re-bba/counter.py b/re-bba/Counter/counter.py similarity index 100% rename from re-bba/counter.py rename to re-bba/Counter/counter.py diff --git a/re-bba/LEDBlinker.py b/re-bba/LedBlinker/LedBlinker.py similarity index 100% rename from re-bba/LEDBlinker.py rename to re-bba/LedBlinker/LedBlinker.py diff --git a/re-bba/shift_register.py b/re-bba/ShiftRegister/ShiftRegister.py similarity index 96% rename from re-bba/shift_register.py rename to re-bba/ShiftRegister/ShiftRegister.py index e544cff..46a71fc 100644 --- a/re-bba/shift_register.py +++ b/re-bba/ShiftRegister/ShiftRegister.py @@ -2,7 +2,6 @@ import sys import os from amaranth import * -from amaranth_boards.icebreaker import * from amaranth.back import verilog from amaranth.sim import Simulator @@ -139,9 +138,6 @@ def main(): mod = ShiftRegister(8) with open(os.path.dirname(os.path.abspath(__file__)) + "/shift_register.v", "w") as f: f.write(verilog.convert(mod, ports=[mod.exiClk, mod.inb, mod.data])) - - if sys.argv[1] == "p": - ICEBreakerPlatform().build(ShiftRegister(8), do_program=True) else: bench = TestBench() diff --git a/re-bba/re-bba.py b/re-bba/re-bba.py new file mode 100644 index 0000000..7a03db4 --- /dev/null +++ b/re-bba/re-bba.py @@ -0,0 +1,44 @@ +import sys +import os +from amaranth import * +from amaranth.back import verilog +from amaranth.sim import Simulator +from amaranth_boards.icebreaker import *; + +class ReBba: + def __init__(): + pass + +class TestBench: + def __init__(self): + pass + + def simulate(self): + pass + +def main(): + if(len(sys.argv) == 2): + + if sys.argv[1] == "s": + bench = TestBench() + bench.simulate() + + if sys.argv[1] == "v": + mod = ReBba() + with open(os.path.dirname(os.path.abspath(__file__)) + "/bba.v", "w") as f: + f.write(verilog.convert(mod, ports=[mod.exiClk, mod.inb, mod.data])) + + if sys.argv[1] == "p": + mod = ReBba() + + else: + bench = TestBench() + bench.simulate() + + +##### +# Main portion +##### + +if __name__ == "__main__": + main()