During the past two years, I have received a number of emails regarding EMSIM. Some of these correspondences are attached below. Of course, if you have further questions after reading the FAQ, you can still contact me at tktan@alumni.princeton.edu
Q:
Recently,we try to install the EMSIM on our pcs. But we can not build
the toolchain according the instructions you provide. When we install
GLIBC, the system always tells us that some critical program is
missing or too old. Although we tried other versions of GLIBC and
patched the gcc 2.95.3, it still does not work correctly. Could you
please tell us how to solve this problem?
Thank you so much for your help!
A:
The toolchain is not part of the EMSIM. I was providing a link to it
only for your convenience.
Installing the ARM toolchain is definitely not trivial. Please refer
to relevant instructions
on the web for help.
Q:
I still have some questions. After we failed to install the
toolchain introduced in the instruction, we tried a pre-build
toolchain, Lart toolchain(cross-2.95.3.tar.gz) and we installed it
successfully on our Linux 7.2. But when we finally run the example
you provide, the system tells us something below:
HostName = yehua (my host name)
connect:connection refused
Can't open init/usrappl
we don't know what's wrong with it. Could you please tell us the
reason or how we can solve it? By the way, do you have detailed user
instructions of EMSIM to provide?
Thank you so much for your help.
A:
The connection refused is not an error. You can just ignore it.
You need to put your crossed-compiled application (to be simulated)
under the init/ directory, named
it usrappl.
The simulator read the symbol table of the simulated application from
this file (usrappl).
Q:
We think we must express unclearly. We had cross-compiled
the application ,put it in the init/directory and named it
usrappl. The connection refused happens in the final step and
the example will not be executed.
We suppose that the simulator may not connect to our real
machine, but don't know what's wrong. Could you please help us?
A:
The connection refused is not a problem. The EMSIM was just trying to
connect to a
terminal emulator at some TCP port. If connection is successful, it
will dump the UART0
output to that port, otherwise, it will just dump the UART0 output to
the screen.
If you follow the instruction correctly to config the arm-linux, you
should have UART0
as the default console output, and whatever console output from the
arm-linux will show up
on screen. So, believe me, connection refused is not a problem.
Have you made sure that your usrappl is readable ? Use arm-linux-nm
to check if you can read its symbol.
Also, I am not sure if your pre-built toolchain is compatible with
the toolchain I used. Please check
the GNU website for compatibility issues.
Q:
Hi,
Thank u so much for your help! We have succeeded in installing
the EMSIM. Smiley emoticon The example ran and if we ended the
program compulsively with CTRL+C, the result would be
displayed. Then we wanted to know how the program can end
automatically. So we wrote a little program and added the
function sa110_terminate(). But the program still does not end
automatically. Could you please tell us how we can implement
the automatic end?
A:
you need to make sure that your main() has been executed.
You can define a dummy function func1() and call it from the main().
Of course, you should also call sa110_terminate() from main().
After running it for a while, if the program does not terminate, do a
control-C
and look at the function-based energy profile to make sure that
func1() has been executed.
Note, you should have run EMSIM with arm-linux-run -E vmlinux.
Q:
Hi,
When we execute the example you provide, the screen will display like the following and no
other outputs:
[root@yehua linux]arm-linux-run -E vmlinux
Host Name = yehua
connect: Connection refused
It seems the program is executed, but it does not output the sentences in the program.
So we will do a control c to terminate the program. After we terminate it, it will display
the following:
[root@yehua linux]arm-linux-run -E vmlinux
Host Name = yehua
connect: Connection refused
__lookup_processor_type 1 102 268.689320
Task[c0002000] 78316045 195409327.500000
total instructions = 11958045
total cycles = 78316045
total energy = 195409327.500000
program stopped with signal 2.
It seems that the program had run and the simulator had accountted the energy
consumption. However, EMSIM does not support the tracing. So we don't know from where we can
be sure whether the program executes correctly and can not find why it does not terminate
automatically. Could you please give us some suggestions to solve the problem?
Thank you so much for your help!
A:
No, this is not right. After the Connection refused message, you should see a lot of things, things
that you see
when you boot a linux. I don't know what is wrong with your installation. Seems like the simulated
Linux
has gone into an infinite loop. You can try running with
arm-linux-run -E -f start_kernel vmlinux
to see the function call trace after start_kernel. If you still don't see anything, then something
is seriously wrong.
Q:
Hi,
We tried the instruction: arm-linux-run -E -f start_kernel vmlinux, and still could not see
anything. It seems that something is really wrong.
We used the pre-built toolchain and the following sources were used to build this toolchain:
linux-2.4.18.tar.gz*
patch-2.4.18-rmk3.gz
binutils-2.9.5.0.22.tar.bz2
diff-2.2.13-rmk2-np14.gz
gcc-2.95.2.tar.gz*
gcc-2.95.2-diff-991022.gz
chris-rutter-patch-for-gcc-2.95.2
glibc-2.1.2.tar.gz*
glibc-crypt-2.1.tar.gz*
glibc-linuxthreads-2.1.2.tar.gz*
and we use RedHat Linux 7.2.
Is this toolchain compatible with the simulator? If it is not, could you please tell us which
pre-built toolchain we should download? or could you please provide the pre-built toolchain
to us? Whether should some files in the env-1.0 and the bootsim be modified? Whether must we
use certain version of Linux?
Thank u so much for your help!
A:
Can you put the following at one of your public downloadable site. Let me look at them
1) Your arm-linux-run binary executable
2) Your vmlinux
3) Your usrappl
4) Your bootsim.rom
I have checked your file. Your arm-linux-run is good. You can safely use it.
But your vmlinux is not good. I have put my vmlinux at http://www.princeton.edu/~tktan/download/
You can download and use it, since it doesn't need to be changed from run to run.
Your bootsim.rom is partially good. I can boot vmlinux using that, but the ramdisk embedded in
it may be bad. Please check your bootsim.rom generation step. In particular, make sure
there is no error in the autogen step. Did you make sure you have the root privilege?
Since bootsim.rom and usrappl go together, I can't verify your usrappl.
Q:
We had downloaded the vmlinux you provide from http://www.princeton.edu/~tktan/download/ .
Thank you!
When we run ./autogen, there will display results in one file of the attach files -- the
autogen. And when we make the bootsim, there will display the results in the boot_make file.
Finally, when we run arm-linux-run -E vmlinux, there displays something in the run file of
the attach files. But while it appears the warning, there is no other result any more and we
have to stop it by control c. Then there are lots of results in the result file.
we can not find where is wrong in our bootsim that we make. Could you please help us to find
where are wrong according to the attach files we provide?
Thank u so much for your help!
A:
Hi,
1) You autogen didn't run correctly. I have attached a typical autogen screen output that you
should see.
2) run file is alright until the final line. If your bootsim.rom is good, it shows that the console
is opened.
3) from result file, I can tell that main() is never called. This is normal now since your
bootsim.rom is bad.
If bootsim.rom is good, and your usrappl is good, the simulator should terminate by itself when it
comes to
sa110_terminate().
Other comments:
1) From your autogen file, I notice that your usrappl is very small. This is not right. I think you
didn't compile
usrappl with the -static option. Please read the instruction carefully.
2) If you look at mkinitrd in the env-1.0/ directory, there is a step that perform mount. I don't
see that in your
autogen logfile. Did you accidentally changed the mkinitrd incorrectly?
Q:
Now our EMSIM seems to run correctly. But we still have some questions. They are:
Whether is the energy measured consumed by the simulated hardware system or including by the
real hardware system?
Where can we see the energy consumed by the program? Whether does the total energy in the
data sheet denote the energy consumed by the program or by the whole system?
After every function or thread display some data. What are the meanings and the units of each
column data? For example:
parse_tags 1 1556 3377.402913
dummy_leds_event 2 38 86.941748
In the function sa110_terminate(), what is the meaning of #ifndef host? When we use #ifndef
host, it will terminate by itself but not output the print statements; when we use #ifdef
host, it will not terminate automatically but output the print statements, like displaying in
the attach file -- www3.
And we met strange situations. When we run the program you provide, the output seems to show
that the main is called, but it will not stop automatically. Therefore, we wrote a simple
program that just loops 10000 times and add 1 each time. This program will terminate
automatically, but it does not output the print statements in the program, like displaying in
the attach file -- www. However, after we change it to 1000000 times, it will output one
statement -- the main starts, and then terminate by itself, like displaying in the attach
file -- www2. Whether does it mean that our EMSIM works correctly? We can not find the
reason. Whether does EMSIM need some special requests to programs?
Note: In all attach files, we deleted the result data.
กก
A:
The first column shows the number of times the function is called,
second column shows the number of CPU cycle.
third column shows the energy in nJ.
The total energy at the end shows the total energy consumed since the CPU started execution,
including the linux boot up
until sa110_terminate() is encountered.
I have those #ifdef host so that if I define HOST, then the corresponding code are not built. This
is used to conveniently
switch between host compilation and target compilation.
Note that if you use printf in your main(), you need to allow time for the linux to dispatch your
output to UART.
If you do an sa110_terminate() immediately after a printf, you will most probably miss the print
out.
Q:
Mr. T.K.Tan, Sorry for disturb you again.
Because our research are about dynamic voltage scaling algorithms and power management in the embedded
OS. Therefore, we suppose whether the EMSIM simulates the variable voltages of the processor SA110? Can
we give instructions to the simulated hardwares to make them in the sleep mode or to adjust the supply
voltages of the simulated processor?
A:
Yes, you can give instruction to put the SA110 into sleep mode. EMSIM support
that. However, no dynamic voltage scaling is supported. You will have to implement
that.
Q:
I met a problem when I first used EMSIM. when I type "arm-linux-run -E vmlinux",it response "Host
name =LinuxServer" and "connect: connection refused",then
it stop. why? How to do deal it with ? Could you help
me ? Thanke you very much.
A:
That message about connection refused can be
ignored. It
is not a problem. It always display that regardless
of whether
you install it properly or not.
If you don't see anything after the message, that
mean your either
your bootsim.rom is bad, or your vmlinux is bad.
You can download a good vmlinux from my website at
http://www.princeton.edu/~tktan/download/vmlinux
If you still don't see anything with this vmlinux,
that mean your
bootsim.rom is bad. Then you should check carefully
your steps in
making bootsim.rom. I have also put a typical
messages you should see
when making bootsim.rom in
http://www.princeton.edu/~tktan/download/autogen.log
Q:
Thank you very much for your help.
When i use your vmlinux, it can boot the linux
kernel. But it will stop when show "Warning: Unable to
open an initial console". Could you tell me why and
how to solve the problem? I guess it was working, but
why it don't show some information? When i press
Ctrl+C to stop it, it can show some information, such
as Total Cycle, Total Energy,ect.
In order to analyse the problem, I want to tell
some detail.
(1) I cannot make toolchain successful with you
recommence package, such as, linux-2.4.18,
binutils-2.11,etc. The error occur when i make glibc.
But I can make toolchain with more later version,
linux-2.4.21, binutils-2.14,etc. So I use the later
version toolchain. I want know whether EMSIM2.0 is
compatible with late vrsion.
(2)I want know you select which type of procrssor
when you compile and make vmlinux. I choose
SA1100-based. Do you choose EBSA110?
Thank you !
A:
I use ebsa110. You should check the default config I put on the
webpage for the required setting.
When you see the 'cannot open initial console',
That mean your initrd is not created properly, please check your step.
Q:
I am sorry for my mistake in previous e-mail. I
find EMSIM2.0 already be in work after I send the
email. The reason that it didn't response any
information is that your example cost much time for
running.
Now I have two question about using EMSIM2.0.
(1) Should I re-make bootsim.rom and replace
usrappl in init directory again for changing a new
application? I don't think it is convenient to use
EMSIM.
(2) what is the uint of total energy? Is it ¦ÌJ?
Could you do me a favor? Thank you very much.
A:
1) Yes, you need to remake bootsim.rom and
usrappl for new application. It is inconvenient,
but I don't have time to do this kind of improvement.
2) The unit is nJ. The first column shows the function,
the second column is the number of times this function
is invoked,
the third column is the number of target CPU cycle consumed
by the function, the fourth column is the energy in nJ.