diff --git a/example-config.toml b/example-config.toml index 15133fc..f7fb8d6 100644 --- a/example-config.toml +++ b/example-config.toml @@ -31,22 +31,22 @@ ip = "dhcp" # Can also be e.g. "192.168.0.123" strict = true # allows some wacky configurations, like panels that overlap. [[display.strings]] -position = { x = 64, y = 0 } +position = { x = 0, y = 0 } dimensions = { length = 256, height = 64 } -rotation = "UPDOWN" +rotation = "R90" [[display.strings]] position = { x = 65, y = 0 } dimensions = { length = 256, height = 64 } -rotation = "LEFTRIGHT" +rotation = "R0" [[display.strings]] position = { x = 65, y = 65 } dimensions = { length = 256, height = 64 } -rotation = "LEFTRIGHT" +rotation = "R0" [[display.strings]] position = { x = 65, y = 130 } dimensions = { length = 256, height = 64 } -rotation = "LEFTRIGHT" +rotation = "R0" [[display.strings]] position = { x = 65, y = 195 } dimensions = { length = 256, height = 64 } -rotation = "LEFTRIGHT" +rotation = "R0" diff --git a/src/groovylight/main.py b/src/groovylight/main.py index 4a4a0f2..3fb41e1 100644 --- a/src/groovylight/main.py +++ b/src/groovylight/main.py @@ -3,6 +3,7 @@ import logging import argparse from groovylight.config import Config +from groovylight.platforms.cxxrtl_sim import emit_cxxrtl logger = logging.getLogger(__loader__.name) @@ -54,7 +55,12 @@ def main(): setup_logger(args) conf = Config(args.config) - print(conf) + + # use the config to create the module. + + if conf.conf["hardware"]["type"] == "cxxrtl": + logger.info("Generating CXXRTL based graphical simulator.") + emit_cxxrtl(conf) diff --git a/src/groovylight/platforms/cxxrtl_sim.py b/src/groovylight/platforms/cxxrtl_sim.py index 2efd6e8..e4cfe0f 100644 --- a/src/groovylight/platforms/cxxrtl_sim.py +++ b/src/groovylight/platforms/cxxrtl_sim.py @@ -7,3 +7,14 @@ # black box the UDP streaming. # provide code for display outputs to render onto SDL2 canvas. # compile code (optionally) +from amaranth.back import cxxrtl +from amaranth import Module + + + +def emit_cxxrtl(config): + m = Module() + + cxxrtl.convert(m) + + diff --git a/src/groovylight/top.py b/src/groovylight/top.py new file mode 100644 index 0000000..93e418d --- /dev/null +++ b/src/groovylight/top.py @@ -0,0 +1,9 @@ +# Creates a top-level module based on the display configuration. + + +from amaranth import Signal +from amaranth.lib import wiring, data + +from .hub75 + +