This shows you the differences between two versions of the page.
|
gnucap:manual:modelgen-verilog [2024/01/30 11:58] felixs more links |
gnucap:manual:modelgen-verilog [2025/11/06 03:25] (current) felixs man page: copy in current version |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | man page below, for now, see repo for [[https://git.savannah.gnu.org/cgit/gnucap/gnucap-modelgen-verilog.git/tree/gnucap-mg-vams.1?h=develop|current version]]. Relevant [[gnucap:projects:nlnet:verilogams|project page]]. | + | See below for man page (as of Nov '25). The current version is available [[https://git.savannah.gnu.org/cgit/gnucap/gnucap-modelgen-verilog.git/tree/man/gnucap-mg-vams.1?h=develop|here]]. Relevant [[gnucap:projects:nlnet:verilogams|project page]]. |
| Modelgen-verilog implementation notes are [[gnucap:manual:tech:modelgen|here]]. | Modelgen-verilog implementation notes are [[gnucap:manual:tech:modelgen|here]]. | ||
| <code> | <code> | ||
| - | GNUCAP-MG-VAMS(1) Gnucap Modelgen GNUCAP-MG-VAMS(1) | + | GNUCAP-MG-VAMS(1) Gnucap Modelgen GNUCAP-MG-VAMS(1) |
| NAME | NAME | ||
| Line 12: | Line 12: | ||
| DESCRIPTION | DESCRIPTION | ||
| - | Gnucap-Modelgen is a translator tool in the Gnucap suite. It will | + | Gnucap-Modelgen is a translator tool in the Gnucap suite. It will trans‐ |
| - | transform Verilog-AMS models into C++ code implementing Gnucap com‐ | + | form Verilog-AMS models into C++ code implementing Gnucap component plu‐ |
| - | ponent plugins. | + | gins. |
| - | Basic usage (with bash, on a posix system) may look as follows. | + | Basic usage (with bash, on a posix system) may look as follows. For |
| - | For more examples, see the examples directory. | + | more examples, see the examples directory. |
| - | $ gnucap-mg-vams -I /path/to/include --cc mymodel.vams -o my‐ | + | $ gnucap-mg-vams -I path/to/include -o mymodel.cc --cc mymodel.vams |
| - | model.cc | + | $ g++ `gnucap-conf --cppflags` -fPIC -shared mymodel.cc -o mymodel.so |
| - | $ g++ `gnucap-conf --cppflags` -fPIC -shared mymodel.cc -o my‐ | + | |
| - | model.so | + | |
| $ gnucap -a ./mymodel.so -a mgsim | $ gnucap -a ./mymodel.so -a mgsim | ||
| gnucap> ... | gnucap> ... | ||
| - | The mgsim directory contains the plugins used in modelgen models. | + | The mgsim directory contains the plugins used when simulating modelgen |
| + | models. | ||
| + | |||
| + | The following options, actions and pragmas are supported, they are | ||
| + | processed in the order specified at the command line. | ||
| OPTIONS | OPTIONS | ||
| -I path | -I path | ||
| - | Set preprocessor include path | + | Set preprocessor include path, relative to cwd. |
| - | -D "name value" | + | -D "name value" | -D name=value |
| - | Set preprocessor constant | + | Set preprocessor constant. |
| -o "filename" | -o "filename" | ||
| Line 39: | Line 41: | ||
| --flag | --noflag | --flag | --noflag | ||
| - | Various flags, under construction, see mg_options.{h,cc}. | + | Various flags, under construction, see mg_options.{h,cc}. Also |
| - | Also available through `pragma during preprocessing. | + | available through `pragma during preprocessing. |
| + | |||
| + | -a plugin | ||
| + | Load plugin, add and replace functionality. Example plugin: | ||
| + | mgopt/nonoise.so. | ||
| ACTIONS | ACTIONS | ||
| Line 48: | Line 54: | ||
| --cc generate c++ file | --cc generate c++ file | ||
| + | |||
| + | PRAGMAS | ||
| + | Pragmas control the behaviour of the program. The preprocessor supports | ||
| + | the `pragma command, and will act upon pragmas directed to "modelgen". | ||
| + | |||
| + | --{pragma_name} | ||
| + | enables pragma the way `pragma modelgen {pragma_name} does. But | ||
| + | in the order specified at command line. | ||
| + | |||
| + | --gen-module | --nogen-module | ||
| + | Affects --cc. Generate (no) code for devices specified in terms | ||
| + | of a "module". | ||
| + | |||
| + | --gen-paramset | --nogen-paramset | ||
| + | Affects --cc. Generate (no) code for devices specified in terms | ||
| + | of a "paramset". | ||
| + | |||
| + | --dump-module | --nodump-module | ||
| + | Affects --dump. Output (no) source for "modules". | ||
| + | |||
| + | --dump-paramset | --nodump-paramset | ||
| + | Affects --dump. Output (no) source for "paramsets". | ||
| + | |||
| + | --dump-annotate | --nodump-annotate | ||
| + | Affects --dump. Annotate verilog code. Mostly for testing and de‐ | ||
| + | bugging. | ||
| + | |||
| + | --debug | --log | --trace | ||
| + | Set error level to "debug", "log" or "trace" respectively. | ||
| + | |||
| + | [..] see mg_options.h | ||
| COMPILER FLAGS | COMPILER FLAGS | ||
| - | These may be passed to the compiler supplementing `gnucap-conf | + | These may be passed to a/the C++ compiler supplementing `gnucap-conf |
| --cppflags`. | --cppflags`. | ||
| -O0, -O2 | -O0, -O2 | ||
| - | Turn on, off optimisation respectively. For details, consult | + | Turn on, off optimisation respectively. For details, consult your |
| - | your compiler manual. | + | compiler manual. |
| - | -g Include debugging symbols. For details, consult your com‐ | + | -g Include debugging symbols. For details, consult your compiler |
| - | piler manual. | + | manual. |
| -DNDEBUG | -DNDEBUG | ||
| - | Drop debugging code, essentially run time assertions. This | + | Drop debugging code, essentially run time assertions. This will |
| - | will speed up execution significantly. | + | speed up execution significantly. |
| -DTRACE_UNTESTED | -DTRACE_UNTESTED | ||
| - | Discover test status. Untested code notification will be | + | Discover test status. Untested code notification will be printed |
| - | printed to standard error output. | + | to standard error output. |
| -DTRACE_ITESTED | -DTRACE_ITESTED | ||
| Line 72: | Line 109: | ||
| EXAMPLES | EXAMPLES | ||
| - | Basic Verilog-AMS models are included with this package, covering | + | Basic Verilog-AMS models are included with this package, covering some |
| - | some of the primitives listed in Table E.1 of the LRM 2.4.0. | + | of the primitives listed in Table E.1 of the LRM 2.4.0. |
| - | For general usage, see examples directory shipped with modelgen- | + | For general usage, see examples directory shipped with modelgen-verilog |
| - | verilog source code. | + | source code. |
| BUGS | BUGS | ||
| Line 82: | Line 119: | ||
| AUTHOR | AUTHOR | ||
| - | Gnucap-mg-vams is being written by Felix Salfelder and Albert Davis | + | Gnucap-mg-vams is being written by Felix Salfelder and Albert Davis with |
| - | with financial support from NLnet Next Generation Internet pro‐ | + | financial support from NLnet Next Generation Internet programme. |
| - | gramme. | + | |
| - | This manual page was written by Felix Salfelder <fe‐ | + | This manual page was written by Felix Salfelder <felix@salfelder.org>. |
| - | lix@salfelder.org>. For the full documentation, visit http://gnu‐ | + | For the full documentation, visit http://gnucap.org. |
| - | cap.org. | + | |
| - | Gnucap Project May 2023 GNUCAP-MG-VAMS(1) | + | Gnucap Project May 2023 GNUCAP-MG-VAMS(1) |
| </code> | </code> | ||