The modules subdirectory contains source code for modules, one module per directory entry.
To add a DML module to a workspace, specify the --device option.
$ cd $HOME/my-simics-workspace $ [simics]/bin/workspace-setup --device mydevice
This will create some skeleton code under the modules/ directory.
After adding a module, you can build it using the top-level makefile:
$ gmake
To emphasize that the makefile require GNU Make, it is called GNUmakefile. The sub-makefiles in the module directories are named Makefile.
When running make, command lines will not be printed by default. To see the commands, pass VERBOSE=yes to make:
$ gmake VERBOSE=yes
An example module written in C can be added in the same way as DML modules, but using the --c-device option.
$ cd $HOME/my-simics-workspace $ [simics]/bin/workspace-setup --c-device my_c_device
The top-level makefile will automatically attempt to build all modules under the modules/ directory. If you have a module somewhere else, you may put a symlink there:
$ ln -s $HOME/mydevice ./my-workspace/modules/
You may need to adapt the Makefile for the workspace-based build environment. Use a generated skeleton Makefile as a template for your rewrite.
A module to which the source is distributed with Simics, can be copied into the workspace by using --copy-module.
$ cd $HOME/my-simics-workspace $ [simics]/bin/workspace-setup --copy-module gdb-remote