[Contents] [TitleIndex] [WordIndex


Since Scilab is an open source, various practitioners use it to simulate real-time applications and systems. However, Simulation cannot be achieved in zero time. Knowing execution time is a key to develop an accurate simulation in real-time areas. Precise measurement of execution time is important in area about life safety, such as military equipments, automotive and aerospace industries. As we known, Matlab has a Profiler function which could measure where a program spends time. By using Matlab Profiler, we could evaluate and improve performance of programs. What I want to do is to make a similar function for Scilab. We use Xcos to make models that have many blocks. In some cases, we want to know execution time of these blocks. A variety of literatures introduce the way of measuring execution time but they did not present directly time to users. Therefore, in this project, I will measure time and present time to users.



Discuss what should i do



Adding codes to do_compile_superblock42.sci file to automatically test execution time



Transfer outputs to workspace by adding codes



Make a "Profiler" button



Collecting outputs during simulation and make a json file to present results



Write a "Profiler.sci" file to present json result



Make json result has a 'rpar' structure in model details


Week 1-2 report

1. Be familiar with scilab code generation function.

2. Find a way to add codes to test execution time

3. Make sure adding codes in standalone file or computational file

Week 3-4 report

1. Be sure to add codes in computational file

2. Change do_compile_superblock42.sci file

3. Make a bin file for new do_compile_superblock42.sci file

Week 5 report

1. Adding some codes to transfer outputs to workspace, but failed

2. Find another way. Make a "profiler" button. And collecting outputs during simulation and make a json file to present resluts.

Week 5-6 report

1. I add codes to test execution time for every block in superblock

2. I wrote codes to put time result in a json code

3. When i did code generation, it can work.But there is a critical error in scilab. I think there are potential error in my json codes.

4. In every "call of block" i add time codes and json codes. But this extends excution time. So i will put these time results of everyblock in buffers, and transfer to jsonc in the last.

Week 7 report

1. I have add codes to transfer result to json file. It has some errors firstly when i add pointers. So i changed to write in scilab language and it succeeded.

Week 8-9 report

1. I will think about more complex models. Like a superblock has a superblock inside.How to transfer all time results in json file.(done)

2. Write a 'Profiler.sci' file to present json result in workspace.

3. "time.h" way to test time is not accurate. I use "Windows.h". QueryPerformanceCounter is more accurate but it is only for windows.

Week 10-12 report

1. Present json result like 'rpar' structure

2. Make 'Linux' edition(use "time.h")


Try to transfer json to html which is easier for user to see



Contact way

Email: rui.shi@tu-clausthal.de

2022-09-08 09:27