Skip to content

Commit 8d5972e

Browse files
committed
feat: Add [chipflow.silicon.debug] section and a key for enabling heartbeat
1 parent 5de52b9 commit 8d5972e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

chipflow_lib/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import importlib
1+
import importlib.metadata
22
import jsonschema
33
import os
44
import sys
@@ -87,6 +87,12 @@ def _ensure_chipflow_root():
8787
},
8888
"pads": {"$ref": "#/$defs/pin"},
8989
"power": {"$ref": "#/$defs/pin"},
90+
"debug": {
91+
"type": "object",
92+
"properties": {
93+
"heartbeat": {"type": "boolean"}
94+
}
95+
}
9096
},
9197
},
9298
},

chipflow_lib/steps/silicon.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ def elaborate(self, platform: SiliconPlatform):
3131

3232
platform.instantiate_ports(m)
3333

34-
# TODO: heartbeat led (to confirm clock/reset alive)
35-
# heartbeat_ctr = Signal(23)
36-
# m.d.sync += heartbeat_ctr.eq(heartbeat_ctr + 1)
37-
# m.d.comb += platform.request("heartbeat").o.eq(heartbeat_ctr[-1])
34+
# heartbeat led (to confirm clock/reset alive)
35+
if self._config["chipflow"]["silicon"]["debug"]["heartbeat"]:
36+
heartbeat_ctr = Signal(23)
37+
m.d.sync += heartbeat_ctr.eq(heartbeat_ctr + 1)
38+
m.d.comb += platform.request("heartbeat").o.eq(heartbeat_ctr[-1])
3839

3940
top, interfaces = top_interfaces(self._config)
4041
for n, t in top.items():
4142
setattr(m.submodules, n, t)
4243

43-
# TODO: heartbeat
4444
return m
4545

4646

0 commit comments

Comments
 (0)