05.07.2013 Views

Script for Laboratory: Designing embedded ASIPs - CES

Script for Laboratory: Designing embedded ASIPs - CES

Script for Laboratory: Designing embedded ASIPs - CES

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• Always have a look at the printed warnings when dlxsim runs the simulation. At the end<br />

of every simulation the warnings are summarized, i.e. the number of the printed warnings<br />

is shown. If the simulations aborts be<strong>for</strong>e its usual end this summary is not printed. To see<br />

the summary you can see them in the statistics with “stats warnings”.<br />

Changing the source code to find the bug:<br />

• When your CoSy compiled program is not running as expected then there are different<br />

possible steps to find the problem. First, you should try to locate which code is causing<br />

the problem. There<strong>for</strong>e, you should find a minimal C-code that still causes the problem.<br />

The further steps are much easier when the created assembly code is as small as possible.<br />

• You have to understand, what the assembly code is doing to find and understand the error.<br />

The output of a compiler is usually very difficult to read and to understand. Sometimes it<br />

is very helpful to use SINAS (Support <strong>for</strong> Inline Assembly) to make the code more readable.<br />

With SINAS, you can add your own assembler instructions or comments to the created<br />

assembly code. With SINAS, you can also <strong>for</strong>ce the compiler not to rearrange the<br />

created assembly code <strong>for</strong> optimizations. For example:<br />

asm int addComment() {<br />

@[.barrier]<br />

; COMMENT: Between the i- and the j-loop<br />

}<br />

void main() {<br />

<strong>for</strong> (int i=0; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!