Previous - Up - Next

3.3   Adding modules to a workspace

The modules subdirectory contains source code for modules, one module per directory entry.

3.3.1   Creating a new DML module

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

3.3.2   Creating a new C module

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

3.3.3   Adding an Existing Module

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

Previous - Up - Next