From: Phuah Y. K. <yk....@ne...> - 2004-07-27 07:46:22
|
Sorry, did not realize I was only sending to Daniel. -------- Original Message -------- Subject: Re: [sdcc-devel] Proposal for return-from-main and exit(), and simplifying the regression tests. Date: Tue, 27 Jul 2004 15:45:25 +0800 From: Phuah Yee Keat <yk....@ne...> To: Daniel Drotos <dr...@ma...> Daniel Drotos wrote: > On Tue, 27 Jul 2004, Phuah Yee Keat wrote: > >>Are you saying to put extra codes into the firmware to check whether >>itself is simulated or not? Because if so, I would be strongly against >>this. It will bloat the firmware if its not run under the simulator. > > I don't know what do you mean, what the firmware is. If firmware is > the application developed for the microcontroller then my answer is > no. It must not do any special depending on simulation/real run. > > If firmware is the code of a regression test, my answer is yes. We can > include something into a test: As I understand... the codes in regression tests are supposed to be similiar to the applications developed for the microcontroller. That's why they are pumped through the simulator. (By firmware I means the programs that eventually gets turned into .ihx and loaded into the hardware). > if (simulated()) { > set_return_code_of_simulator(error_happened_or_not); > stop_simulator(); > } Don't really get where this piece of codes should be added to? testfwk.c? support.c? or the testcode.c? > Ps: what functionality of the simulator do you need for test of loop > optimization? Machine cycles. Let say if I do <code> unsigned char i,j=10,k=100; for (i=0;i<100;++i) { P1 = j+k; } </code> I will check how many machine cycles does it takes to execute this piece of C-code. If its x machine cycles, its optimized, if its more than that, its not optimized. (This might need some changes to the regression framework as well) Its useful when fixing optimization bugs, when fixing a bug might cause some certain conditions to turn un-optimized instead. Cheers, Phuah Yee Keat |