diff options
author | whitequark <whitequark@whitequark.org> | 2020-04-05 10:03:23 +0000 |
---|---|---|
committer | whitequark <whitequark@whitequark.org> | 2020-04-09 04:08:36 +0000 |
commit | 4737f426ff20324316ab037cef719da4b5c520dd (patch) | |
tree | a2e80fe8df17fa9fba08a960c61750ecbff6f11d /backends | |
parent | 753e34007d64e1bf9d9d5fa19d6a39b328672d88 (diff) | |
download | yosys-4737f426ff20324316ab037cef719da4b5c520dd.tar.gz yosys-4737f426ff20324316ab037cef719da4b5c520dd.tar.bz2 yosys-4737f426ff20324316ab037cef719da4b5c520dd.zip |
write_cxxrtl: add basic documentation.
Diffstat (limited to 'backends')
-rw-r--r-- | backends/cxxrtl/cxxrtl.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/backends/cxxrtl/cxxrtl.cc b/backends/cxxrtl/cxxrtl.cc index d204364ca..465882858 100644 --- a/backends/cxxrtl/cxxrtl.cc +++ b/backends/cxxrtl/cxxrtl.cc @@ -1601,7 +1601,22 @@ struct CxxrtlBackend : public Backend { log("\n"); log(" write_cxxrtl [options] [filename]\n"); log("\n"); - log("Write C++ code for simulating the design.\n"); + log("Write C++ code for simulating the design. The generated code requires a driver;\n"); + log("the following simple driver is provided as an example:\n"); + log("\n"); + log(" #include \"top.cc\"\n"); + log("\n"); + log(" int main() {\n"); + log(" cxxrtl_design::p_top top;\n"); + log(" while (1) {\n"); + log(" top.p_clk.next = value<1> {1u};\n"); + log(" top.step();\n"); + log(" top.p_clk.next = value<1> {0u};\n"); + log(" top.step();\n"); + log(" }\n"); + log(" }\n"); + log("\n"); + log("The following options are supported by this backend:\n"); log("\n"); log(" -O <level>\n"); log(" set the optimization level. the default is -O%d. higher optimization\n", DEFAULT_OPT_LEVEL); |