Skip to content

Commit 1e2e71d

Browse files
committed
refactor: streamline verilator API steps
1 parent 0d8ecd9 commit 1e2e71d

2 files changed

Lines changed: 2 additions & 26 deletions

File tree

api/steps/verilator/03_build_api_step.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@ async def handler(req, context):
1616
body = req.get("body") or {}
1717
data = {
1818
"jobs": body.get("jobs", 16),
19-
"cosim": body.get("cosim", False),
2019
"coverage": body.get("coverage", False),
2120
}
2221
await context.emit({"topic": "verilator.build", "data": data})
2322

24-
# ==================================================================================
25-
# Wait for simulation result
26-
# ==================================================================================
2723
while True:
2824
result = await wait_for_result(context)
2925
if result is not None:

api/steps/verilator/05_run_api_step.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
config = {
55
"type": "api",
66
"name": "Verilator Complete Workflow",
7-
"description": "trigger complete verilator workflow",
7+
"description": "trigger complete verilator workflow: clean → verilog → build → sim",
88
"path": "/verilator/run",
99
"method": "POST",
1010
"emits": ["verilator.run"],
@@ -17,7 +17,7 @@ async def handler(req, context):
1717

1818
config = {
1919
"binary": body.get("binary", ""),
20-
"config": body.get("config", "sims.verilator.BuckyballToyBBSimConfig"),
20+
"config": body.get("config", "sims.verilator.BuckyballToyVerilatorConfig"),
2121
"jobs": body.get("jobs", "16"),
2222
"batch": body.get("batch", False),
2323
"coverage": body.get("coverage", False),
@@ -26,26 +26,6 @@ async def handler(req, context):
2626

2727
await context.emit({"topic": "verilator.run", "data": config})
2828

29-
# ==================================================================================
30-
# Wait for simulation result
31-
#
32-
# Expected return result format:
33-
# {
34-
# "status": 200/400/500,
35-
# "body": {
36-
# "success": true/false,
37-
# "failure": true/false,
38-
# "processing": true/false,
39-
# "return_code": 0,
40-
# other fields
41-
# }
42-
# }
43-
#
44-
# Since the Motia framework wraps data in the data field, it needs to be unpacked
45-
# if isinstance(result, dict) and 'data' in result:
46-
# return result['data']
47-
# return result
48-
# ==================================================================================
4929
while True:
5030
result = await wait_for_result(context)
5131
if result is not None:

0 commit comments

Comments
 (0)