📄 emidelay.cfg
字号:
##
## emidelay.cfg
##
## Copyright (C) STMicroelectronics Ltd. 2001
##
## Implementation of rom bootstrap delays in the for programming the EMI
##
## this is the version of emidelay to be used on older toolsets, this creates
## very large poke tables in ROM to cause delays during rom booting
proc _ST_NormalPokeEMIDelay
_ST_local_delay = $1;
_ST_local_i = 0;
{
## On a C1 the best (fastest) case execution of the poke loop
## is 12 cycles, assuming a clock speed of 200Mhz this makes
## each poke takes 60ns (or more). For a C2 these figures are
## 20 cycles and 100ns. Since we are making a time/space trade
## off we will assume 100ns (C1 cannot be faster than 120MHz).
## It is assumed that people working on very fast parts will
## be using a later toolset.
_ST_local_delay *= 10
for (_ST_local_i=0; _ST_local_i<_ST_local_delay; _ST_local_i++) {
## this is the top of internal memory on a STi5500
poke 0x80000ffc 0
}
}
## this is the version of emidelay for use on newer toolsets whose rom
## bootstrap support magic poke values
proc _ST_MagicPokeEMIDelay
_ST_local_delay = $1;
_ST_local_magic = 0x7ffffffc;
{
## The poke loop in the ROM bootstrap code accepts a magic
## value (the C2 boot vector, almost!) that causes the target
## to delay. The delay loop in the bootstrap code is
## callibrated to take exactly 10 processor cycles, here we
## assume a clock speed of 500Mhz meaning each cycle round the
## delay loop takes 20ns. This means we must multiply our
## argument (in us) by 50.
_ST_local_delay *= 50
poke (_ST_local_magic, _ST_local_delay)
}
proc emidelay
_ST_local_delay = $1;
{
## we only take any action if the current tool is the linker, only
## the linker has alias built in
if ((clsymbol alias) == 3) {
if (!(clsymbol st20toolsetversion)) {
## if st20toolsetversion does not exist then we certainly
## cannot use the magic poke version
_ST_NormalPokeEMIDelay _ST_local_delay
} else if ((st20toolsetversion -q) < st20toolsetversion "1.9.3") {
## if the toolset is before 1.9.3 then the magic poke still does
## not exist
_ST_NormalPokeEMIDelay (_ST_local_delay)
} else {
_ST_MagicPokeEMIDelay (_ST_local_delay)
}
}
}
addhelp emidelay "\
emidelay (<delay>)\n\
cause the boot code to delay for a specified amount of time\n\
where\n\
<delay> minimum time to delay for in us (microseconds)\n\n\
This command only actually affects the linker when generating ROM\n\
images, when the EMI is programmed by the debugger the roundtrip time\n\
between the HTI and the host is sufficiently large to make emidelay\n\
redundant.\n"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -