📄 dcu3_build.cfg
字号:
###################
## DCU3 procedures
###################
##
## To run with DCU3, setup socket id, start simulator (either st20sim
## or vhdlsim) and then start st20run.
## Example build a C2 ROM and run on Unix, notice the -child option to
## st20sim to indicate no bootfile supplied:
##
## > st20cc -p dcu3c2 fart.c -romimage -g
## > setenv REMOTEJTAGPORTNO 34005
## > st20sim -p dcu3c2 -child &
## > st20run -t dcu3c2 fart.dbg fart.hex
##
## Example build a C1 lku and run on Unix
## > st20cc -p dcu3c1 fart.c -g
## > setenv REMOTEJTAGPORTNO 34005
## > st20sim -p dcu3c1 -child &
## > st20run -t dcu3c1 fart.lku
##
## The following cl symbols are defined to default values, they may
## be overriden by defining the symbols before the chip command:
##
## DCU_base == 0x3000
## DCU3_capability == 0x200110e1
## DCU3_sequencing == 0x00e110e1
## DCU3_debug == 0
##
proc dcu3_external_memory {
memory EXTERNAL 0x40000000 (2*M) RAM
memory ROM1 0x7FF80000 (512*K) ROM
}
proc dcu3c2internal {
chip ST20DCU3C2SIM
PlaceDebugTrapHandler INTERNAL
stack INTERNAL
heap INTERNAL
}
proc dcu3c2 {
chip ST20DCU3C2SIM
dcu3_external_memory
PlaceDebugTrapHandler EXTERNAL
stack EXTERNAL
heap EXTERNAL
}
proc dcu3c1internal {
chip ST20DCU3C1SIM
PlaceDebugTrapHandler INTERNAL
stack INTERNAL
heap INTERNAL
}
proc dcu3c1 {
chip ST20DCU3C1SIM
dcu3_external_memory
PlaceDebugTrapHandler EXTERNAL
stack EXTERNAL
heap EXTERNAL
bootiptr (addressof -q "ROM1")
}
target dcu3c2 tap "remote_jtag localhost" "reset; dcu3c2"
target dcu3c1 tap "remote_jtag localhost" "reset; dcu3c1"
###################
## Targets to spawn st20sim with a DCU3 model and then connect via
## remote JTAG comms. Avoids need to start st20sim first. Only supported
## on Solaris. Example run:
##
## > st20run -t dcu3c1_spawn fart.lku
##
## proc substr_delim
## Return the result of substituting the occurence of delim substring within
## str with sub_delim.
##
proc substr_delim str=$1 delim=$2 sub_delim=$3 res="" head_str="" {
##write "str=" (str) "delim=" (delim) "sub_delim=" (sub_delim)
while ( str != "" ) {
head_str=(str)/(delim)
if ( head_str == str ) {
str = "" ## no delim left, so terminate loop
} else {
str=(str)%(delim)
}
res=(res)+(head_str)+(sub_delim)
##write "str sofar=" (str) "res=" (res) "head_str=" (head_str)
}
$$ = (res)
}
## proc dcu3_spawn_target
## Create target statement suitable for spawning st20sim with DCU3 model.
## The remote_jtag parameter is passed to Unix system() command by tapmonitor
## to start simulation before st20run attempts to connect.
## If -sleep <integer> provided, it is removed before the call to system(),
## and tapmonitor sleeps for given time. This is to give the spawned
## simulation time to startup and then be waiting for the host
## connection before st20run attempts to connect.
##
## The remote_jtag parameter tokens are seperated by a meta_space. A space
## cannot be used as a space is the delimeter for the target statement
## options.
##
## Example usage:
## dcu3_spawn_target "dcu3c2"
## creates target:
## dcu3c2_spawn tap "remote_jtag localhost st20sim^-q^-p^dcu3c2^-child^-sleep^2^&^" "reset; dcu3c2"
##
if( ! ( clsymbol sleep_interval_str )) sleep_interval_str="2"
proc dcu3_spawn_target
name=$1
sim_opt=""
meta_space="^"
sim_command=""
sim_command_meta="" {
if ( $# > 1 ) {
sim_opt = ($2)
}
sim_command=("st20sim -q "+sim_opt+" -p \"_ST_target_st20sim_dcu3=1; "+name+"\" -child -sleep "+sleep_interval_str+" &")
## subst space for ^
sim_command_meta=substr_delim (sim_command) " " (meta_space)
target (name+"_spawninternal") tap ("remote_jtag localhost "+sim_command_meta) ("reset; "+name+"internal")
target (name+"_spawn") tap ("remote_jtag localhost "+sim_command_meta) ("reset; "+name)
}
proc mkdcu3spawn name=$1 {
dcu3_spawn_target (name)
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -