
GRMON3-UM
June 2019, Version 3.1.0
229
www.cobham.com/gaisler
mctrl0 Cobham Gaisler Memory controller with EDAC
AHB: 00000000 - 20000000
AHB: 20000000 - 40000000
AHB: 40000000 - 80000000
APB: 80000000 - 80000100
8-bit prom @ 0x00000000
32-bit static ram: 1 * 8192 kbyte @ 0x40000000
32-bit sdram: 2 * 128 Mbyte @ 0x60000000
col 10, cas 2, ref 7.8 us
...
grmon3> puts [ format 0x%x $mctrl0:: [TAB-COMPLETION]
mctrl0::mcfg1 mctrl0::mcfg2 mctrl0::mcfg3 mctrl0::pnp::
mctrl0::mcfg1:: mctrl0::mcfg2:: mctrl0::mcfg3::
grmon3> puts [ format 0x%x $mctrl0::pnp:: [TAB-COMPLETION]
mctrl0::pnp::ahb:: mctrl0::pnp::device mctrl0::pnp::ver
mctrl0::pnp::apb:: mctrl0::pnp::vendor
grmon3> puts [ format 0x%x $mctrl0::pnp::apb:: [TAB-COMPLETION]
mctrl0::pnp::apb::irq mctrl0::pnp::apb::mask mctrl0::pnp::apb::start
grmon3> puts [ format 0x%x $mctrl0::pnp::apb::start ]
0x80000000
3. User defined hooks
GRMON supports user implemented hooks using Tcl procedures. Each hook is variable containing a list of pro-
cedure names. GRMON will call all the procedures in the list.
Like normal procedures in TCL, each hook can return a code and a result value using the TCL command return. If
a hook returns a code that is not equal to zero, then the GRMON will skip the rest of the hooks that are registered in
that list. Some hooks will change GRMONs behavior depending on the return code, see hook descriptions below.
Hooks in the system shell can only be installed using a startup script, see
for more
information.api.udrv
Hooks can be installed in the execution shell using the command grmon::execsh eval <
script
> or using a
startup script.
To uninstall hooks, either remove the procedure name from the list using the Tcl lreplace or delete the variable
using unset to uninstall all hooks. Hooks in the system shell can only be uninstalled in the startup script or by
letting the hook uninstall itself. Always use lreplace when uninstalling hooks in the system shell, otherwise it's
possible to delete hooks the GRMON has installed that may lead to undefined behavior.
preinit
The preinit hooks is called after GRMON has connected to the board and before any driver initialization
is done. It is also called before the plug and play area is scanned. The hook may only be defined in the
system shell.
postinit
The post init hook is called after all drivers have been initialized. The hook may only be defined in the
system shell.
init#
During GRMON's startup, 9 hooks are executed. These hooks are called
init1
,
init2
, etc. Each hook
is called before the corresponding init function in a user defined driver is called. In addition
init1
is
called after the plug and play area is scanned, but before any initialization. The
init#
hooks may only
be defined in the system shell.
deinit
Called when GRMON is closing down. The
deinit
hooks may only be defined in the system shell.
closedown
Called when a TCL is closing down.
preexec
These hooks are called before the CPU:s are started, when issuing a run, cont or go command. They must
be defined in the execution shell.
exec
The
exec
hooks are called once each iteration of the polling loop, when issuing a run, cont or go command.
They must be defined in the execution shell.
postexec
These hooks are called after the CPU:s have stopped, when issuing a run, cont or go command. They must
be defined in the execution shell.