Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Functions | Variables
fpu.c File Reference
#include "leon3.h"
#include "testmod.h"
Include dependency graph for fpu.c:

Functions

 fputest ()
 
 asm (" .global a1, a2\n"" .align 8\n""a1: .word 0x48000001\n"" .word 0\n""b1: .word 0x48000000\n"" .word 0\n""c1: .word 0x46c00000\n"" .word 0\n""c2: .word 0x3ff00000\n"" .word 0 \n"" .word 0x40000000\n"" .word 0 \n"" .word 0x40080000\n"" .word 0 \n"" .word 0x3f800000\n")
 
 asm (" .global \n"" .text \n"" .align 4 \n"" \n""fpu_chkft: \n"" set 1, %o0 \n"" mov %asr16, %o2 \n"" srl %o2, 30, %o2 \n"" and %o2, 3, %o2 ! %o2 = fpft \n"" cmp %o2, %g0 \n"" beq 1f \n"" mov 0, %o0 \n"" cmp %o2, 3 \n"" beq 1f \n"" set c2, %o1 \n"" ldd [%o1], %f0 \n"" ldd [%o1 + 8], %f2 \n"" ld [%o1 + 0x18], %f30 ! f30 = 1.0 \n"" fmovs %f30, %f10 \n"" fmovs %f30, %f12 \n"" fmovs %f30, %f14 \n"" set 0x03007a, %o3 ! 4-bit error DP ram 0 \n"" mov %o3, %asr16 \n"" nop; nop; nop; nop; nop; nop; \n"" fmovs %f0, %f0 \n"" fmovs %f1, %f1 \n"" fmovs %f10, %f10 \n"" fmovs %f12, %f12 \n"" fmovs %f14, %f14 \n"" set 0x03007e, %o3 ! 4-bit error DP ram 1 \n"" mov %o3, %asr16 \n"" nop; nop; nop; nop; nop; nop; \n"" fmovs %f2, %f2 \n"" fmovs %f3, %f3 \n"" mov %g0, %asr16 \n"" nop; nop; nop; nop; nop; nop; \n"" faddd %f0, %f2, %f4 ! should correct 4 errors \n"" fadds %f10, %f30, %f20 ! should correct 1 error \n"" std %f12, [%o1] ! should correct 1 error \n"" st %f14, [%o1] ! should correct 1 error \n"" ldd [%o1 + 0x10], %f6 ! %f6 = 2.0 (DP) \n"" ld [%o1 + 0x8], %f8 ! %f8 = 2.0 (SP) \n"" fcmpd %f4, %f6 \n"" nop \n"" fbne 1f \n"" fcmps %f20, %f8 \n"" nop \n"" fbne 1f \n"" mov %asr16, %o1 \n"" srl %o1, 27, %o1 \n"" and %o1, 7, %o1 ! error counter \n"" mov 0, %o0 \n"" cmp %o2, 1 \n"" beq 1f \n"" sub %o1, 7, %o0 ! should be 7 for fpft = 1 \n"" sub %o1, 4, %o0 ! should be 4 for fpft = 2 \n""1: retl \n"" nop \n")
 
 fpu_main ()
 
 fpu_pipe ()
 
 asm (" .global set_fsr, get_fsr\n""get_fsr: \n"" st %fsr, [%sp-96]\n"" retl\n"" ld [%sp-96], %o0\n""set_fsr: \n"" st %o0, [%sp-96]\n"" retl\n"" ld [%sp-96], %fsr\n")
 

Variables

int __errno
 
float f1x = -1.0
 
int fsr1 [4] = { 0x80000000, 0 , 0, 0 }
 
int ftest [2] = { 0x48000000, 0x48100000 }
 

Function Documentation

asm ( " .global  a1,
a2\n"".align 8\n""a1:.word 0x48000001\n"".word 0\n""b1:.word 0x48000000\n"".word 0\n""c1:.word 0x46c00000\n"".word 0\n""c2:.word 0x3ff00000\n"".word 0\n"".word 0x40000000\n"".word 0\n"".word 0x40080000\n"".word 0\n"".word 0x3f800000\n"   
)
asm ( " .global \n"" .text \n"" .align 4 \n"" \n""fpu_chkft: \n"" set  1,
%o0\n""mov asr16,
%o2\n""srl%  o2,
30  ,
%o2\n""and%  o2,
,
%o2!%  o2 = fpft \n""       cmp     %o2,
%g0\n""beq 1f\n""mov  0,
%o0\n""cmp%  o2,
3\n""beq 1f\n""set  c2,
%o1\n""  ldd[%o1],
%f0\n""  ldd[%o1+8],
%f2\n""  ld[%o1+0x18],
%f30!  f30 = 1.0 \n""       fmovs   %f30,
%f10\n""fmovs%  f30,
%f12\n""fmovs%  f30,
%f14\n""set  0x03007a,
%o3!4-bit error DP ram 0\n""mov o3,
%asr16\n""nop;nop;nop;nop;nop;nop;\n""fmovs%  f0,
%f0\n""fmovs%  f1,
%f1\n""fmovs%  f10,
%f10\n""fmovs%  f12,
%f12\n""fmovs%  f14,
%f14\n""set  0x03007e,
%o3!4-bit error DP ram 1\n""mov o3,
%asr16\n""nop;nop;nop;nop;nop;nop;\n""fmovs%  f2,
%f2\n""fmovs%  f3,
%f3\n""mov g0,
%asr16\n""nop;nop;nop;nop;nop;nop;\n""faddd%  f0,
f2,
%f4!should correct 4 errors\n""fadds%  f10,
f30,
%f20!should correct 1 error\n""std%  f12,
[%o1] !should correct 1 error\n""st%  f14,
[%o1] !should correct 1 error\n""  ldd[%o1+0x10],
%f6!%  f6 = 2.0 (DP) \n""       ld      [%o1 + 0x8],
%f8!%  f8 = 2.0 (SP) \n""       fcmpd   %f4,
%f6\n""nop\n""fbne 1f\n""fcmps%  f20,
%f8\n""nop\n""fbne 1f\n""mov%  asr16,
%o1\n""srl%  o1,
27  ,
%o1\n""and%  o1,
,
%o1!error counter\n""mov  0,
%o0\n""cmp%  o2,
1\n""beq 1f\n""sub%  o1,
,
%o0!should be 7 for  fpft = 1 \n""       sub     %o1,
 
)
asm ( " .global  set_fsr,
get_fsr\n""get_fsr:\n""st%  fsr,
[%sp-96] \n""retl\n""  ld[%sp-96],
%o0\n""set_fsr:\n""st%  o0,
[%sp-96] \n""retl\n""  ld[%sp-96],
%fsr\n"   
)
fpu_main ( )

References b1, c1, d, fail, and fpu_pipe().

Referenced by fputest().

Here is the call graph for this function:

fpu_pipe ( )

Referenced by fpu_main().

fputest ( )

References fpu_main(), FPU_TEST, get_pid, report_subtest(), setpsr(), and xgetpsr().

Referenced by leon2_test(), and leon3_test().

Here is the call graph for this function:

Variable Documentation

int __errno
float f1x = -1.0
int fsr1[4] = { 0x80000000, 0 , 0, 0 }
int ftest[2] = { 0x48000000, 0x48100000 }