Adding some instructions for using the sim, also improving the --help

output to be more consistent
This commit is contained in:
Rob Emery committed 2026-10-28 11:23:14 +00:00
1 parent f22bf9cf82
commit 8d20af475e
2 files changed
+32 -8

No files matched your search

+28 -4
View File
@@ -103,11 +103,11 @@ Build host tools only:
docker run --rm -v $(pwd):/workspace rtlplayground-dev make -C tools docker run --rm -v $(pwd):/workspace rtlplayground-dev make -C tools
``` ```
Run the web-interface simulator locally: Run the web-interface simulator through docker:
``` ```
docker run --rm -p 8080:8080 -v $(pwd):/workspace rtlplayground-dev \ docker run --rm -p 8081:8081 -v $(pwd):/workspace rtlplayground-dev \
tools/output/httpd_sim /workspace/html tools/output/httpd_sim.py /workspace/html
``` ```
Edit `config.txt` on your host, then re-run `make` — the Edit `config.txt` on your host, then re-run `make` — the
@@ -362,7 +362,31 @@ session xxxx = Web session timeout in seconds (default 200)
Enjoy playing! Enjoy playing!
## (11) Other documents ## (13) HTTP Simulator for front-end development
The simulator is available in tools as `./httpd_sim.py`
By default it will serve the content in the current working directory so the easiest way to run this is to:
```
cd ./html
../tools/httpd_sim.py
```
And the simulator will be available on http://127.0.0.1:8081
There are commandline options available:
```
usage: httpd_sim.py [-h] [--machine MACHINE] [--port PORT] [--bindaddr BINDADDR] [--verbose]
options:
-h, --help show this help message and exit
--machine MACHINE path to machine.c or .h file to parse (optional)
--port PORT port to bind to (default 8081)
--bindaddr BINDADDR address to bind (default 127.0.0.1)
--verbose enable verbose output
```
The machine parsing is somewhat experimental.
## (12) Other documents
The following documents give further documentation on specific features of the RTL837x SoCs: The following documents give further documentation on specific features of the RTL837x SoCs:
- [Adding a new device](doc/adding-a-device.md) - [Adding a new device](doc/adding-a-device.md)
+4 -4
View File
@@ -707,10 +707,10 @@ def loadMachineConfig(filename):
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--machine", default=None, help="Path to machine.c or .h file to parse") parser.add_argument("--machine", default=None, help="path to machine.c or .h file to parse (optional)")
parser.add_argument("--port", default=8081, type=int, help="Port to bind to") parser.add_argument("--port", default=8081, type=int, help="port to bind to (default 8081)")
parser.add_argument("--bindaddr", default="127.0.0.1", help="Address to bind") parser.add_argument("--bindaddr", default="127.0.0.1", help="address to bind (default 127.0.0.1)")
parser.add_argument("--verbose", action="store_true", help="Enable verbose output") parser.add_argument("--verbose", action="store_true", help="enable verbose output")
args = parser.parse_args() args = parser.parse_args()