Skip to content

Commit 4a9cae3

Browse files
committed
write_cxxrtl: add basic documentation.
1 parent 88c622b commit 4a9cae3

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

backends/cxxrtl/cxxrtl.cc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,22 @@ struct CxxrtlBackend : public Backend {
16011601
log("\n");
16021602
log(" write_cxxrtl [options] [filename]\n");
16031603
log("\n");
1604-
log("Write C++ code for simulating the design.\n");
1604+
log("Write C++ code for simulating the design. The generated code requires a driver;\n");
1605+
log("the following simple driver is provided as an example:\n");
1606+
log("\n");
1607+
log(" #include \"top.cc\"\n");
1608+
log("\n");
1609+
log(" int main() {\n");
1610+
log(" cxxrtl_design::p_top top;\n");
1611+
log(" while (1) {\n");
1612+
log(" top.p_clk.next = value<1> {1u};\n");
1613+
log(" top.step();\n");
1614+
log(" top.p_clk.next = value<1> {0u};\n");
1615+
log(" top.step();\n");
1616+
log(" }\n");
1617+
log(" }\n");
1618+
log("\n");
1619+
log("The following options are supported by this backend:\n");
16051620
log("\n");
16061621
log(" -O <level>\n");
16071622
log(" set the optimization level. the default is -O%d. higher optimization\n", DEFAULT_OPT_LEVEL);

0 commit comments

Comments
 (0)