EasyManua.ls Logo

COBHAM GRMON3 - Page 233

COBHAM GRMON3
239 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
GRMON3-UM
June 2019, Version 3.1.0
233 www.cobham.com/gaisler
# regname: Register name
# Return Address of requested register
#
# Required only if any registers have been defined.
# This is a suggestion how the procedure could be implemented
proc regaddr {devname regname} {
array set offsets {myreg1 0x0 myreg2 0x4}
if {[namespace exists ::[set devname]::pnp::apb]} {
set start [set ::[set devname]::pnp::apb::start]
} elseif {[namespace exists ::[set devname]::pnp::ahb]} {
set start [set ::[set devname]::pnp::ahb::0::start]
} else {
error "Unknown register adress for $devnam::$regname"
}
return [format 0x%08x [expr ($start + $offsets($regname)) & 0xFFFFFFFF]]
}
# Register descriptions
#
# All description must be put in the regs-namespace. Each register concist
# of a name, description and an optional list of fields.
# The fields are quadruple of the format {name pos bits description}
#
# Registers and fields can be added, removed or changed up to initialization
# level 8. After level 8 TCL variables are created and the regs variable
# should be considered to a constant.
variable regs {
{"myreg1" "Register1 description"
{"myfld3" 4 8 "Field3 descpription"}
{"myfld2" 1 1 "Field2 descpription"}
{"myfld1" 0 1 "Field1 descpription"}
}
{"myreg2" "Register2 description"
}
}
}; # End of mydrv
5. User defined commands
User defined commands can be implemented as Tcl procedures, and then loaded into all shells. See the docu-
mentation of the proc command [http://www.tcl.tk/man/tcl8.6/TclCmd/proc.htm] on the Tcl website for more in-
formation.
6. Links
More about Tcl, its syntax and other useful information can be found at:
Tcl Website [http://www.tcl.tk]
Tcl Commands [http://www.tcl.tk/man/tcl8.6/TclCmd/contents.htm]
Tcl Tutorial [http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html]
Tcler's Wiki [http://wiki.tcl.tk/]

Table of Contents