Skip to content

Commit 6118d46

Browse files
committed
[cocotb] Add option to dump waves and increase timescale
- Adds a `--waves` option to tell cocotb to dump a waveform. - Increases the timescale
1 parent 9468862 commit 6118d46

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/circt-cocotb-driver/circt-cocotb-driver.py.in

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ def parseArgs(args):
3131
required=True,
3232
help="Name of the python module.")
3333

34+
argparser.add_argument("--waves",
35+
action="store_true",
36+
help="Enable waveform dumping.")
37+
3438
argparser.add_argument(
3539
"--pythonFolders",
3640
type=str,
@@ -82,7 +86,7 @@ class Icarus(csim.Icarus):
8286
# lives easier and create a minimum timescale through the command-line.
8387
cmd_file = os.path.join(objDir, "cmds.f")
8488
with open(cmd_file, "w+") as f:
85-
f.write("+timescale+1ns/1ps\n")
89+
f.write("+timescale+1ns/100ps\n")
8690

8791
self.compile_args.extend([
8892
f"-f{cmd_file}",
@@ -117,7 +121,7 @@ class Questa(csim.Questa):
117121
# lives easier and create a minimum timescale through the command-line.
118122
cmd_file = os.path.join(objDir, "cmds.f")
119123
with open(cmd_file, "w+") as f:
120-
f.write("+timescale+1ns/1ps")
124+
f.write("+timescale+1ns/100ps")
121125

122126
self.gui = gui
123127
self.extra_compile_args = ["-f", f"{cmd_file}"]
@@ -151,6 +155,7 @@ def main():
151155
"verilog_sources": sources,
152156
"python_search": [f.strip() for f in args.pythonFolders.split(",")],
153157
"work_dir": objDir,
158+
"waves": args.waves,
154159
}
155160
try:
156161
if args.simulator == "icarus":

0 commit comments

Comments
 (0)