OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 1023 to Rev 1024
    Reverse comparison

Rev 1023 → Rev 1024

/trunk/or1ksim/cpu/or1k/spr_defs.h
424,6 → 424,6
#define NOP_NOP 0x0000 /* Normal nop instruction */
#define NOP_EXIT 0x0001 /* End of simulation */
#define NOP_REPORT 0x0002 /* Simple report */
#define NOP_PRINTF 0x0003 /* Simprintf instruction */
#define NOP_printf 0x0003 /* Simprintf instruction */
#define NOP_REPORT_FIRST 0x0400 /* Report with number */
#define NOP_REPORT_LAST 0x03ff /* Report with number */
/trunk/or1ksim/testbench/mmu.c
54,7 → 54,7
SPR_ITLBTR_UXE )
 
#if 1
#define debug PRINTF
#define debug printf
#else
#define debug
#endif
/trunk/or1ksim/testbench/dmatest.c
152,16 → 152,16
int main()
{
int pass_simple, pass_chunks, pass_list;
PRINTF( "Starting DMA test\n" );
printf( "Starting DMA test\n" );
 
PRINTF( " Simple DMA: " );
PRINTF( (pass_simple = simple()) ? "Passed\n" : "Failed\n" );
PRINTF( " Chunks DMA: " );
PRINTF( (pass_chunks = chunks()) ? "Passed\n" : "Failed\n" );
PRINTF( " List DMA: " );
PRINTF( (pass_list = list()) ? "Passed\n" : "Failed\n" );
printf( " Simple DMA: " );
printf( (pass_simple = simple()) ? "Passed\n" : "Failed\n" );
printf( " Chunks DMA: " );
printf( (pass_chunks = chunks()) ? "Passed\n" : "Failed\n" );
printf( " List DMA: " );
printf( (pass_list = list()) ? "Passed\n" : "Failed\n" );
 
PRINTF( "Ending DMA test\n" );
printf( "Ending DMA test\n" );
if (pass_simple && pass_chunks && pass_list) {
report (0xdeaddead);
return 0;
/trunk/or1ksim/testbench/dhry.c
156,20 → 156,20
/* Initalize Data and Instruction Cache */
 
 
/* PRINTF ("\n");
PRINTF ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
PRINTF ("\n");
/* printf ("\n");
printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
printf ("\n");
if (Reg)
{
PRINTF ("Program compiled with 'register' attribute\n");
PRINTF ("\n");
printf ("Program compiled with 'register' attribute\n");
printf ("\n");
}
else
{
PRINTF ("Program compiled without 'register' attribute\n");
PRINTF ("\n");
printf ("Program compiled without 'register' attribute\n");
printf ("\n");
}
PRINTF ("Please give the number of runs through the benchmark: ");
printf ("Please give the number of runs through the benchmark: ");
*/
{
int n;
178,9 → 178,9
n = NUM_RUNS;
Number_Of_Runs = n;
}
PRINTF ("\n");
printf ("\n");
 
PRINTF ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
 
/***************/
187,7 → 187,7
/* Start timer */
/***************/
/* PRINTF("%d", my_test2(Number_Of_Runs));*/
/* printf("%d", my_test2(Number_Of_Runs));*/
start_timer(TIMER0);
Begin_Time = read_timer(TIMER0);
 
223,24 → 223,24
report(5);
/* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
#if DBG
PRINTF("a) Int_1_Loc: %x\n", Int_1_Loc);
PRINTF("a) Int_2_Loc: %x\n", Int_2_Loc);
PRINTF("a) Int_3_Loc: %x\n\n", Int_3_Loc);
printf("a) Int_1_Loc: %x\n", Int_1_Loc);
printf("a) Int_2_Loc: %x\n", Int_2_Loc);
printf("a) Int_3_Loc: %x\n\n", Int_3_Loc);
#endif
Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
/* Int_Glob == 5 */
#if DBG
PRINTF("b) Int_1_Loc: %x\n", Int_1_Loc);
PRINTF("b) Int_2_Loc: %x\n", Int_2_Loc);
PRINTF("b) Int_3_Loc: %x\n\n", Int_3_Loc);
printf("b) Int_1_Loc: %x\n", Int_1_Loc);
printf("b) Int_2_Loc: %x\n", Int_2_Loc);
printf("b) Int_3_Loc: %x\n\n", Int_3_Loc);
#endif
report(6);
 
Proc_1 (Ptr_Glob);
#if DBG
PRINTF("c) Int_1_Loc: %x\n", Int_1_Loc);
PRINTF("c) Int_2_Loc: %x\n", Int_2_Loc);
PRINTF("c) Int_3_Loc: %x\n\n", Int_3_Loc);
printf("c) Int_1_Loc: %x\n", Int_1_Loc);
printf("c) Int_2_Loc: %x\n", Int_2_Loc);
printf("c) Int_3_Loc: %x\n\n", Int_3_Loc);
#endif
report(7);
 
255,9 → 255,9
Int_2_Loc = Run_Index;
Int_Glob = Run_Index;
#if DBG
PRINTF("d) Int_1_Loc: %x\n", Int_1_Loc);
PRINTF("d) Int_2_Loc: %x\n", Int_2_Loc);
PRINTF("d) Int_3_Loc: %x\n\n", Int_3_Loc);
printf("d) Int_1_Loc: %x\n", Int_1_Loc);
printf("d) Int_2_Loc: %x\n", Int_2_Loc);
printf("d) Int_3_Loc: %x\n\n", Int_3_Loc);
#endif
}
}
265,10 → 265,10
 
/* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
#if DBG
PRINTF("e) Int_1_Loc: %x\n", Int_1_Loc);
PRINTF("e) Int_2_Loc: %x\n", Int_2_Loc);
PRINTF("e) Int_3_Loc: %x\n", Int_3_Loc);
PRINTF("e) Ch_1_Glob: %c\n\n", Ch_1_Glob);
printf("e) Int_1_Loc: %x\n", Int_1_Loc);
printf("e) Int_2_Loc: %x\n", Int_2_Loc);
printf("e) Int_3_Loc: %x\n", Int_3_Loc);
printf("e) Ch_1_Glob: %c\n\n", Ch_1_Glob);
#endif
Int_2_Loc = Int_2_Loc * Int_1_Loc;
Int_1_Loc = Int_2_Loc / Int_3_Loc;
279,9 → 279,9
 
/* Int_1_Loc == 5 */
#if DBG
PRINTF("f) Int_1_Loc: %x\n", Int_1_Loc);
PRINTF("f) Int_2_Loc: %x\n", Int_2_Loc);
PRINTF("f) Int_3_Loc: %x\n\n", Int_3_Loc);
printf("f) Int_1_Loc: %x\n", Int_1_Loc);
printf("f) Int_2_Loc: %x\n", Int_2_Loc);
printf("f) Int_3_Loc: %x\n\n", Int_3_Loc);
#endif
 
} /* loop "for Run_Index" */
292,57 → 292,57
End_Time = read_timer(TIMER0);
 
/* PRINTF ("Execution ends\n");
PRINTF ("\n");
PRINTF ("Final values of the variables used in the benchmark:\n");
PRINTF ("\n");
PRINTF ("Int_Glob: %d\n", Int_Glob);
PRINTF (" should be: %d\n", 5);
PRINTF ("Bool_Glob: %d\n", Bool_Glob);
PRINTF (" should be: %d\n", 1);
PRINTF ("Ch_1_Glob: %c\n", Ch_1_Glob);
PRINTF (" should be: %c\n", 'A');
PRINTF ("Ch_2_Glob: %c\n", Ch_2_Glob);
PRINTF (" should be: %c\n", 'B');
PRINTF ("Arr_1_Glob[8]: %d\n", Arr_1_Glob[8]);
PRINTF (" should be: %d\n", 7);
PRINTF ("Arr_2_Glob[8][7]: %d\n", Arr_2_Glob[8][7]);
PRINTF (" should be: Number_Of_Runs + 10\n");
PRINTF ("Ptr_Glob->\n");
PRINTF (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
PRINTF (" should be: (implementation-dependent)\n");
PRINTF (" Discr: %d\n", Ptr_Glob->Discr);
PRINTF (" should be: %d\n", 0);
PRINTF (" Enum_Comp: %d\n", Ptr_Glob->variant.var_1.Enum_Comp);
PRINTF (" should be: %d\n", 2);
PRINTF (" Int_Comp: %d\n", Ptr_Glob->variant.var_1.Int_Comp);
PRINTF (" should be: %d\n", 17);
PRINTF (" Str_Comp: %s\n", Ptr_Glob->variant.var_1.Str_Comp);
PRINTF (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
PRINTF ("Next_Ptr_Glob->\n");
PRINTF (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
PRINTF (" should be: (implementation-dependent), same as above\n");
PRINTF (" Discr: %d\n", Next_Ptr_Glob->Discr);
PRINTF (" should be: %d\n", 0);
PRINTF (" Enum_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Enum_Comp);
PRINTF (" should be: %d\n", 1);
PRINTF (" Int_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Int_Comp);
PRINTF (" should be: %d\n", 18);
PRINTF (" Str_Comp: %s\n",
/* printf ("Execution ends\n");
printf ("\n");
printf ("Final values of the variables used in the benchmark:\n");
printf ("\n");
printf ("Int_Glob: %d\n", Int_Glob);
printf (" should be: %d\n", 5);
printf ("Bool_Glob: %d\n", Bool_Glob);
printf (" should be: %d\n", 1);
printf ("Ch_1_Glob: %c\n", Ch_1_Glob);
printf (" should be: %c\n", 'A');
printf ("Ch_2_Glob: %c\n", Ch_2_Glob);
printf (" should be: %c\n", 'B');
printf ("Arr_1_Glob[8]: %d\n", Arr_1_Glob[8]);
printf (" should be: %d\n", 7);
printf ("Arr_2_Glob[8][7]: %d\n", Arr_2_Glob[8][7]);
printf (" should be: Number_Of_Runs + 10\n");
printf ("Ptr_Glob->\n");
printf (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
printf (" should be: (implementation-dependent)\n");
printf (" Discr: %d\n", Ptr_Glob->Discr);
printf (" should be: %d\n", 0);
printf (" Enum_Comp: %d\n", Ptr_Glob->variant.var_1.Enum_Comp);
printf (" should be: %d\n", 2);
printf (" Int_Comp: %d\n", Ptr_Glob->variant.var_1.Int_Comp);
printf (" should be: %d\n", 17);
printf (" Str_Comp: %s\n", Ptr_Glob->variant.var_1.Str_Comp);
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
printf ("Next_Ptr_Glob->\n");
printf (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
printf (" should be: (implementation-dependent), same as above\n");
printf (" Discr: %d\n", Next_Ptr_Glob->Discr);
printf (" should be: %d\n", 0);
printf (" Enum_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Enum_Comp);
printf (" should be: %d\n", 1);
printf (" Int_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Int_Comp);
printf (" should be: %d\n", 18);
printf (" Str_Comp: %s\n",
Next_Ptr_Glob->variant.var_1.Str_Comp);
PRINTF (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
PRINTF ("Int_1_Loc: %d\n", Int_1_Loc);
PRINTF (" should be: %d\n", 5);
PRINTF ("Int_2_Loc: %d\n", Int_2_Loc);
PRINTF (" should be: %d\n", 13);
PRINTF ("Int_3_Loc: %d\n", Int_3_Loc);
PRINTF (" should be: %d\n", 7);
PRINTF ("Enum_Loc: %d\n", Enum_Loc);
PRINTF (" should be: %d\n", 1);
PRINTF ("Str_1_Loc: %s\n", Str_1_Loc);
PRINTF (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
PRINTF ("Str_2_Loc: %s\n", Str_2_Loc);
PRINTF (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
printf ("Int_1_Loc: %d\n", Int_1_Loc);
printf (" should be: %d\n", 5);
printf ("Int_2_Loc: %d\n", Int_2_Loc);
printf (" should be: %d\n", 13);
printf ("Int_3_Loc: %d\n", Int_3_Loc);
printf (" should be: %d\n", 7);
printf ("Enum_Loc: %d\n", Enum_Loc);
printf (" should be: %d\n", 1);
printf ("Str_1_Loc: %s\n", Str_1_Loc);
printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
printf ("Str_2_Loc: %s\n", Str_2_Loc);
printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
 
*/
 
350,15 → 350,15
User_Time = End_Time - Begin_Time;
/* microseconds */
 
PRINTF("Begin Time = %d\n",Begin_Time);
PRINTF("End Time = %d\n",End_Time);
printf("Begin Time = %d\n",Begin_Time);
printf("End Time = %d\n",End_Time);
 
if (User_Time < Too_Small_Time)
{
PRINTF ("Measured time too small to obtain meaningful results\n");
PRINTF ("Please increase number of runs\n");
PRINTF ("\n");
printf ("Measured time too small to obtain meaningful results\n");
printf ("Please increase number of runs\n");
printf ("\n");
}
else
{
365,25 → 365,25
#if DLX || OR1K
User_Time /= DLX_FREQ;
#if DLX
PRINTF("DLX ");
printf("DLX ");
#else
#if OR1K
PRINTF("OR1K ");
printf("OR1K ");
#else
PRINTF("Unknown CPU ");
printf("Unknown CPU ");
#endif
#endif
PRINTF("at %u MHz ", DLX_FREQ);
printf("at %u MHz ", DLX_FREQ);
if (PROC_6)
PRINTF("(+PROC_6)");
PRINTF("\n");
printf("(+PROC_6)");
printf("\n");
#endif
Microseconds = User_Time / Number_Of_Runs;
Dhrystones_Per_Second = Number_Of_Runs * 1000 / User_Time;
PRINTF ("Microseconds for one run through Dhrystone: ");
PRINTF ("%d us / %d runs\n", User_Time,Number_Of_Runs);
PRINTF ("Dhrystones per Second: ");
PRINTF ("%d \n", Dhrystones_Per_Second);
printf ("Microseconds for one run through Dhrystone: ");
printf ("%d us / %d runs\n", User_Time,Number_Of_Runs);
printf ("Dhrystones per Second: ");
printf ("%d \n", Dhrystones_Per_Second);
}
report (0xdeaddead);
return 0;
608,8 → 608,8
REG One_Fifty Int_Loc;
 
#if DBG
PRINTF("X) Int_1_Par_Val: %x\n", Int_1_Par_Val);
PRINTF("X) Int_2_Par_Val: %x\n", Int_2_Par_Val);
printf("X) Int_1_Par_Val: %x\n", Int_1_Par_Val);
printf("X) Int_2_Par_Val: %x\n", Int_2_Par_Val);
#endif
 
report(0x20080);
625,8 → 625,8
Int_Glob = 5;
 
#if DBG
PRINTF("Y) Int_1_Par_Val: %x\n", Int_1_Par_Val);
PRINTF("Y) Int_2_Par_Val: %x\n", Int_2_Par_Val);
printf("Y) Int_1_Par_Val: %x\n", Int_1_Par_Val);
printf("Y) Int_2_Par_Val: %x\n", Int_2_Par_Val);
#endif
 
} /* Proc_8 */
/trunk/or1ksim/testbench/mc_common.c
88,7 → 88,7
pattern32 = pattern16 = pattern = 0; inc = 1; break;
} /*switch*/
 
PRINTF ("\tmc_test_row_8(0x%02dX, %d, 0x%08lX, 0x%08lX);\n", pattern, seq, nFrom, nTo);
printf ("\tmc_test_row_8(0x%02dX, %d, 0x%08lX, 0x%08lX);\n", pattern, seq, nFrom, nTo);
 
switch (seq) {
case 0: /*seq. row write, row read*/
104,7 → 104,7
read = *mem8;
 
if ( read != pattern ) {
PRINTF("\ti=%lX, read=0x%02dX, pattern=0x%02dX\n", i, read, pattern);
printf("\ti=%lX, read=0x%02dX, pattern=0x%02dX\n", i, read, pattern);
return (unsigned long)mem8;
}
 
118,7 → 118,7
read = *mem8;
 
if (read != pattern ) {
PRINTF("\ti=%lX, read=0x%02dX, pattern=0x%02dX\n", i, read, pattern);
printf("\ti=%lX, read=0x%02dX, pattern=0x%02dX\n", i, read, pattern);
return (unsigned long)mem8;
}
 
125,13 → 125,13
mem16 = (unsigned short*)(i & 0xFFFFFFFELU);
read16 = *mem16;
if (read16 != pattern16) {
PRINTF("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
printf("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
return (unsigned long)mem16;
}
mem32 = (unsigned long*)(i & 0xFFFFFFFCLU);
read32 = *mem32;
if (read32 != pattern32) {
PRINTF("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
return (unsigned long)mem32;
}
 
159,7 → 159,7
read = *mem8;
if (read != pattern ) {
PRINTF("\ti=%lX, read=0x%02dX, pattern=0x%02dX\n", i, read, pattern);
printf("\ti=%lX, read=0x%02dX, pattern=0x%02dX\n", i, read, pattern);
return (unsigned long)mem8;
}
 
203,7 → 203,7
pattern16 = pattern32 = 0; inc = 1; break;
} /*switch*/
 
PRINTF ("\tmc_test_row_16(0x%04dX, %d, 0x%08lX, 0x%08lX);\n", pattern16, seq, nFrom, nTo);
printf ("\tmc_test_row_16(0x%04dX, %d, 0x%08lX, 0x%08lX);\n", pattern16, seq, nFrom, nTo);
 
switch (seq) {
case 0: /*seq. row write, row read*/
219,7 → 219,7
read16 = *mem16;
 
if ( read16 != pattern16 ) {
PRINTF("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
printf("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
return (unsigned long)mem16;
}
 
233,7 → 233,7
read16 = *mem16;
 
if (read16 != pattern16 ) {
PRINTF("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
printf("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
return (unsigned long)mem16;
}
 
240,7 → 240,7
mem32 = (unsigned long*)(i & 0xFFFFFFFCLU);
read32 = *mem32;
if (read32 != pattern32) {
PRINTF("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
return (unsigned long)mem32;
}
 
260,7 → 260,7
read16 = *mem16;
 
if (read16 != pattern16 ) {
PRINTF("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
printf("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
return (unsigned long)mem16;
}
 
296,7 → 296,7
pattern32 = nFrom; inc = 1; break;
} /*switch*/
 
PRINTF ("\tmc_test_row_32(0x%08lX, %d, 0x%08lX, 0x%08lX);\n", pattern32, seq, nFrom, nTo);
printf ("\tmc_test_row_32(0x%08lX, %d, 0x%08lX, 0x%08lX);\n", pattern32, seq, nFrom, nTo);
 
switch (seq) {
case 0: /*seq. row write, row read*/
312,7 → 312,7
read32 = *mem32;
 
if ( read32 != pattern32 ) {
PRINTF("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
return (unsigned long)mem32;
}
 
326,7 → 326,7
read32 = *mem32;
 
if (read32 != pattern32 ) {
PRINTF("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
return (unsigned long)mem32;
}
 
343,7 → 343,7
read32 = *mem32;
 
if (read32 != pattern32 ) {
PRINTF("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
return (unsigned long)mem32;
}
} /*for*/
362,7 → 362,7
int nRun, nSize, nSeq;
int ret = 0;
 
PRINTF("\nmc_test_row(0x%08lX, 0x%08lX)\n", nFrom, nTo);
printf("\nmc_test_row(0x%08lX, 0x%08lX)\n", nFrom, nTo);
 
for (nRun = 0; nRun < 5; nRun++) {
switch (nRun) {
/trunk/or1ksim/testbench/eth0.tx
174,4 → 174,36
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêë + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêë + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêë + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêë + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ + !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéê \ No newline at end of file
/trunk/or1ksim/testbench/dhry.h
26,7 → 26,7
*
* In this C version, the following C library functions are used:
* - strcpy, strcmp (inside the measurement loop)
* - PRINTF, scanf (outside the measurement loop)
* - printf, scanf (outside the measurement loop)
* In addition, Berkeley UNIX system calls "times ()" or "time ()"
* are used for execution time measurement. For measurements
* on other systems, these calls have to be changed.
/trunk/or1ksim/testbench/eth.c
42,42 → 42,42
{
unsigned i,len;
PRINTF ("Int\n");
printf ("Int\n");
switch (*eth_int_source & 0x7f) {
case 0x2 :
PRINTF ("Transmit Error.\n");
printf ("Transmit Error.\n");
*eth_int_source = 0x2;
break;
case 0x8 :
PRINTF ("Receive Error\n");
printf ("Receive Error\n");
*eth_int_source = 0x8;
break;
case 0x4 :
PRINTF ("Receive Frame\n");
printf ("Receive Frame\n");
*eth_int_source = 0x4;
 
CLEAR_FLAG(*eth_moder, ETH_MODER, RXEN);
len = GET_FIELD(eth_bd_base[*eth_tx_bd_num + 2], ETH_RX_BD, LENGTH);
len = GET_FIELD(eth_bd_base[(*eth_tx_bd_num << 1) + 2], ETH_RX_BD, LENGTH);
for (i=0; i<len; i++)
if (r_packet[i] != (unsigned char)i)
{
PRINTF("Failed at byte %d. expect %d, received %d\n", i, i, r_packet[i]);
printf("Failed at byte %d. expect %d, received %d\n", i, i, r_packet[i]);
exit(1);
}
break;
case 0x10:
PRINTF ("Busy\n");
printf ("Busy\n");
*eth_int_source = 0x10;
break;
case 0x1 :
PRINTF ("Transmit Frame.\n");
printf ("Transmit Frame.\n");
*eth_int_source = 0x1;
CLEAR_FLAG(*eth_moder, ETH_MODER, TXEN);
break;
default:
PRINTF ("Invalid int @ %0x\n", (unsigned int)*eth_int_source & 0x7f);
printf ("Invalid int @ %0x\n", (unsigned int)*eth_int_source & 0x7f);
*eth_int_source = 0x7f;
exit (1);
}
120,17 → 120,17
int_happend = 0;
/* Initialize packet */
PRINTF("Init\n");
printf("Init\n");
for ( i = 0; i < sizeof(s_packet); ++ i )
s_packet[i] = (unsigned char)i;
 
/* Set Ethernet BD */
PRINTF("Set BD\n");
printf("Set BD\n");
SET_FIELD(eth_bd_base[tx_bindex], ETH_TX_BD, LENGTH, sizeof(s_packet));
eth_bd_base[tx_bindex + 1] = (unsigned long)s_packet;
 
/* Start Ethernet */
PRINTF("Set Flags\n");
printf("Set Flags\n");
SET_FLAG(eth_bd_base[tx_bindex], ETH_TX_BD, IRQ);
SET_FLAG(eth_bd_base[tx_bindex], ETH_TX_BD, READY);
SET_FLAG(*eth_moder, ETH_MODER, TXEN);
155,7 → 155,7
for (i=0; i<len; i++)
if (r_packet[i] != (unsigned char)i)
{
PRINTF("Failed at byte %d. expect %d, received %d\n", i, i, r_packet[i]);
printf("Failed at byte %d. expect %d, received %d\n", i, i, r_packet[i]);
exit(1);
}
}
163,10 → 163,10
static void receive_one_packet_int(void)
{
int_happend = 0;
PRINTF("Set BD\n");
printf("Set BD\n");
eth_bd_base[rx_bindex + 1] = (unsigned long)r_packet;
PRINTF("SetFlags\n");
printf("SetFlags\n");
SET_FLAG(eth_bd_base[rx_bindex], ETH_RX_BD, IRQ);
SET_FLAG(eth_bd_base[rx_bindex], ETH_RX_BD, READY);
SET_FLAG(*eth_moder, ETH_MODER, RXEN);
174,10 → 174,10
 
int main()
{
PRINTF( "Starting Ethernet test\n" );
printf( "Starting Ethernet test\n" );
 
tx_bindex = 0;
rx_bindex = *eth_tx_bd_num;
rx_bindex = *eth_tx_bd_num << 1;
 
set_mac();
197,28 → 197,28
/* interrupt test */
excpt_int = (unsigned long)interrupt_handler;
/* Enable interrup ts */
PRINTF("enable ints\n");
printf("enable ints\n");
mtspr (SPR_SR, mfspr(SPR_SR) | SPR_SR_IEE);
mtspr (SPR_PICMR, mfspr(SPR_PICMR) | (0x00000001L << ETH_IRQ));
PRINTF("set mask flags TX\n");
printf("set mask flags TX\n");
SET_FLAG(*eth_int_mask, ETH_INT_MASK, TXB_M);
transmit_one_packet_int();
tx_bindex += 2;
PRINTF("waiting for int\n");
printf("waiting for int\n");
while (!int_happend);
CLEAR_FLAG(*eth_int_mask, ETH_INT_MASK, TXB_M);
PRINTF("seting mask flag RX\n");
printf("seting mask flag RX\n");
SET_FLAG(*eth_int_mask, ETH_INT_MASK, RXB_M);
receive_one_packet_int();
rx_bindex += 2;
PRINTF("waiting for int\n");
printf("waiting for int\n");
while (!int_happend);
CLEAR_FLAG(*eth_int_mask, ETH_INT_MASK, RXB_M);
PRINTF( "Ending Ethernet test\n" );
printf( "Ending Ethernet test\n" );
report (0xdeaddead);
exit(0);
/trunk/or1ksim/testbench/cbasic.c
94,17 → 94,17
for(j = i; j < 35; j++) {
shl += 1 << j;
#if 0
PRINTF("%u. shl:%.8lx", j, shl);
printf("%u. shl:%.8lx", j, shl);
report(shl);
#endif
shr += 0x80000000 >> j;
#if 0
PRINTF(" shr:%.8lx", shr);
printf(" shr:%.8lx", shr);
report(shr);
#endif
bit += ((~j ^ 0x11223344) & 0x33557788) + (j | 0x11223344);
#if 0
PRINTF(" bit:%.8lx\n", bit);
printf(" bit:%.8lx\n", bit);
report(bit);
#endif
}
133,14 → 133,14
ul = i;
sl = i;
#if 0
PRINTF("%u. i:%.8lx ", j, i);
PRINTF("uc:%.8lx sc:%.8lx ", uc, sc);
printf("%u. i:%.8lx ", j, i);
printf("uc:%.8lx sc:%.8lx ", uc, sc);
report(uc);
report(sc);
PRINTF("us:%.8lx ss:%.8lx ", us, ss);
printf("us:%.8lx ss:%.8lx ", us, ss);
report(us);
report(ss);
PRINTF("ul:%.8lx sl:%.8lx\n", ul, sl);
printf("ul:%.8lx sl:%.8lx\n", ul, sl);
report(ul);
report(sl);
#endif
178,7 → 178,7
signed long result3 = 0;
 
#if DEBUG
PRINTF("Start...\n");
printf("Start...\n");
#endif
result1 = test_cond(1);
result2 = test_cond(-1);
185,7 → 185,7
result3 -= result1 + result2;
report(result2);
#if DEBUG
PRINTF("After test_cond: 0x%.8lx 0x%.8lx\n", result1, result2);
printf("After test_cond: 0x%.8lx 0x%.8lx\n", result1, result2);
#endif
 
result1 = test_loops(1);
193,7 → 193,7
result3 -= result1 + result2;
report(result2);
#if DEBUG
PRINTF("After test_loops: 0x%.8lx 0x%.8lx\n", result1, result2);
printf("After test_loops: 0x%.8lx 0x%.8lx\n", result1, result2);
#endif
 
result1 = test_arith(1);
201,7 → 201,7
result3 -= result1 + result2;
report(result2);
#if DEBUG
PRINTF("After test_arith: 0x%.8lx 0x%.8lx\n", result1, result2);
printf("After test_arith: 0x%.8lx 0x%.8lx\n", result1, result2);
#endif
 
result1 = test_bitop(1);
209,7 → 209,7
result3 -= result1 + result2;
report(result2);
#if DEBUG
PRINTF("After test_bitop: 0x%.8lx 0x%.8lx\n", result1, result2);
printf("After test_bitop: 0x%.8lx 0x%.8lx\n", result1, result2);
#endif
 
result1 = test_types(1);
217,7 → 217,7
result3 -= result1 + result2;
report(result2);
#if DEBUG
PRINTF("After test_types: 0x%.8lx 0x%.8lx\n", result1, result2);
printf("After test_types: 0x%.8lx 0x%.8lx\n", result1, result2);
#endif
result1 = test_array(1);
result2 = test_array(-1);
224,7 → 224,7
result3 -= result1 + result2;
report(result2);
#if DEBUG
PRINTF("After test_array: 0x%.8lx 0x%.8lx\n", result1, result2);
printf("After test_array: 0x%.8lx 0x%.8lx\n", result1, result2);
#endif
 
#ifdef XXX
231,7 → 231,7
#warning xxx
#endif
 
PRINTF("RESULT: %.8lx\n", result3 ^ 0x4bad2569 ^ 0xdeaddead);
printf("RESULT: %.8lx\n", result3 ^ 0x4bad2569 ^ 0xdeaddead);
report(result3 ^ 0x4bad2569 ^ 0xdeaddead);
 
exit(0);
/trunk/or1ksim/testbench/functest.c
24,7 → 24,7
 
while (c++ < 10) {
j = fun1(gk, k + 1, k + 2, k + 3, k + 4, k + 5, k + 6);
PRINTF ("%i\n", gk);
printf ("%i\n", gk);
if(j > 40)
gk = j - 20;
else
/trunk/or1ksim/testbench/kbdtest.c
10,7 → 10,7
#define ASSERT(x) ((x)?1: fail (__FUNCTION__, __LINE__))
/* Waits a few cycles that uart can prepare its data */
#define WAIT() {asm ("l.nop");asm ("l.nop");asm ("l.nop");asm ("l.nop");}
#define MARK() PRINTF ("Passed line %i\n", __LINE__)
#define MARK() printf ("Passed line %i\n", __LINE__)
 
#ifndef __LINE__
#define __LINE__ 0
36,7 → 36,7
#ifndef __FUNCTION__
#define __FUNCTION__ "?"
#endif
PRINTF ("Test failed in %s:%i\n", func, line);
printf ("Test failed in %s:%i\n", func, line);
report(0xeeeeeeee);
exit (1);
}
54,14 → 54,14
void interrupt_handler ()
{
unsigned x;
PRINTF ("Int\n");
printf ("Int\n");
do {
x = getreg (KBD_BASE_ADD);
if (x) PRINTF ("0x%02x, ", x);
if (x) printf ("0x%02x, ", x);
report(x);
if (x == 1) done = 1;
#if !INTERACTIVE
PRINTF ("expecting (0x%02x), ", incoming_scan[current_scan]);
printf ("expecting (0x%02x), ", incoming_scan[current_scan]);
if (x) {
ASSERT (incoming_scan[current_scan++] == x);
}
68,7 → 68,7
if ((current_scan + 1) >= sizeof (incoming_scan) / sizeof (char)) done = 1;
#endif
} while (x);
PRINTF ("%i", done);
printf ("%i", done);
mtspr(SPR_PICSR, 0);
}
 
77,8 → 77,8
/* Use our low priority interrupt handler */
excpt_int = (unsigned long)interrupt_handler;
 
PRINTF ("Reading from keyboard.\n");
PRINTF ("Enabling interrupts.\n");
printf ("Reading from keyboard.\n");
printf ("Enabling interrupts.\n");
done = 0;
/* Enable interrupts */
85,7 → 85,7
mtspr (SPR_SR, mfspr(SPR_SR) | SPR_SR_IEE);
mtspr (SPR_PICMR, mfspr(SPR_PICMR) | (0x00000001L << KBD_IRQ));
 
while (!done) PRINTF ("[%i]", done);
while (!done) printf ("[%i]", done);
report (0xdeaddead);
return 0;
}
/trunk/or1ksim/testbench/mycompress.c
258,7 → 258,7
ratio = 0;
in_count = 1;
 
PRINTF("main: bytes_out %d... hsize %d\n", (int)bytes_out, (int)hsize);
printf("main: bytes_out %d... hsize %d\n", (int)bytes_out, (int)hsize);
 
checkpoint = CHECK_GAP;
maxcode = MAXCODE(n_bits = INIT_BITS);
271,7 → 271,7
for ( fcode = (long) hsize; fcode < 65536L; fcode *= 2L )
hshift++;
hshift = 8 - hshift; /* set hash code range bound */
PRINTF("main: hshift %d...\n", hshift);
printf("main: hshift %d...\n", hshift);
 
hsize_reg = hsize;
cl_hash( (count_int) hsize_reg); /* clear hash table */
281,13 → 281,13
#else
while ( (c = getchar()) != EOF ) {
#endif*/
PRINTF("main: bytes_out %d...\n", (int)bytes_out);
PRINTF("main: hsize_reg %d...\n", (int)hsize_reg);
PRINTF("main: before compress %d...\n", (int)in_count);
printf("main: bytes_out %d...\n", (int)bytes_out);
printf("main: hsize_reg %d...\n", (int)hsize_reg);
printf("main: before compress %d...\n", (int)in_count);
while (in_count < BYTES_TO_COMPRESS) {
c = in_count % 255;
PRINTF("main: compressing %d...\n", (int)in_count);
printf("main: compressing %d...\n", (int)in_count);
in_count++;
fcode = (long) (((long) c << maxbits) + ent);
i = (((long)c << hshift) ^ ent); /* xor hashing */
329,7 → 329,7
/*
* Put out the final code.
*/
PRINTF("main: output...\n");
printf("main: output...\n");
output( (code_int)ent );
out_count++;
output( (code_int)-1 );
336,7 → 336,7
 
if(bytes_out > in_count) /* exit(2) if no savings */
exit_stat = 2;
PRINTF("main: end...\n");
printf("main: end...\n");
report (0xdeaddead);
return 0;
}
/trunk/or1ksim/testbench/mc_dram.c
59,7 → 59,7
SET_FIELD(*mc_csc, MC_CSC, BW, mc_sdram_cs[ch].BW);
SET_FIELD(*mc_csc, MC_CSC, SEL, mc_sdram_cs[ch].M);
SET_FLAG(*mc_csc, MC_CSC, EN);
PRINTF ("Channel Config %d - CSC = 0x%08lX\n", ch, *mc_csc);
printf ("Channel Config %d - CSC = 0x%08lX\n", ch, *mc_csc);
}
}
 
83,13 → 83,13
mc_sdram_cs[ch].M = GET_FIELD(*mc_csc, MC_CSC, SEL);
mc_cs |= (1 << ch);
 
PRINTF("get_config(%d) : MS=0x%0lx, BW=0x%0lx, M=0x%0lx\n", ch,
printf("get_config(%d) : MS=0x%0lx, BW=0x%0lx, M=0x%0lx\n", ch,
mc_sdram_cs[ch].MS,
mc_sdram_cs[ch].BW,
mc_sdram_cs[ch].M);
}
}
PRINTF("get_config() : cs=0x%0x\n", mc_cs);
printf("get_config() : cs=0x%0x\n", mc_cs);
return 0;
}
 
120,7 → 120,7
 
#ifdef MC_READ_CONF
if (get_config()) {
PRINTF("Error reading MC configuration\n");
printf("Error reading MC configuration\n");
report(0x00000001);
return(1);
}
130,7 → 130,7
 
for (ch=0; ch<8; ch++) {
if (mc_cs & (0x01 << ch) ) {
PRINTF ("--- Begin Test on CS%d ---\n", ch);
printf ("--- Begin Test on CS%d ---\n", ch);
 
mc_csc = (unsigned long*)(MC_BASE + MC_CSC(ch));
mc_tms = (unsigned long*)(MC_BASE + MC_TMS(ch));
172,7 → 172,7
nRowSh = MC_SDRAM_ROWSH_8; break;
}
 
PRINTF ("CS configuration : CSC - 0x%08lX, TMS - 0x%08lX, rs = %lu, nr = %lu, sh = %lu, sel = %lu\n",
printf ("CS configuration : CSC - 0x%08lX, TMS - 0x%08lX, rs = %lu, nr = %lu, sh = %lu, sel = %lu\n",
*mc_csc, *mc_tms, nRowSize, nRows, nRowSh, mc_sel);
 
/*nRows -= MC_SDRAM_ROW_OFF;*/
283,11 → 283,11
break;
} /*switch test*/
 
PRINTF ("Begin TEST %lu : CSC - 0x%08lX, TMS - 0x%08lX\n", test, *mc_csc, *mc_tms);
printf ("Begin TEST %lu : CSC - 0x%08lX, TMS - 0x%08lX\n", test, *mc_csc, *mc_tms);
 
if (MC_SDRAM_ACC & MC_SDRAM_SROW) {
/* perform sequential row access */
PRINTF("Seuential Row\n");
printf("Seuential Row\n");
for (j=0; j<T_ROWS; j++) {
nAddress = mc_sel << 21;
nAddress |= MC_MEM_BASE;
297,7 → 297,7
*rgpio_out = gpio_pat;
ret = mc_test_row(nAddress, nAddress + T_ROW_SIZE, MC_SDRAM_FLAGS);
 
PRINTF("\trow - %lu: nAddress = 0x%08lX, ret = 0x%08lX\n", j, nAddress, ret);
printf("\trow - %lu: nAddress = 0x%08lX, ret = 0x%08lX\n", j, nAddress, ret);
 
if (ret) {
gpio_pat ^= 0x00000080;
310,7 → 310,7
 
if (MC_SDRAM_ACC & MC_SDRAM_RROW) {
/* perform random row access */
PRINTF("Random Row\n");
printf("Random Row\n");
for (j=0; j<T_ROWS; j++) {
nAddress = mc_sel << 21;
nAddress |= MC_MEM_BASE;
320,7 → 320,7
*rgpio_out = gpio_pat;
ret = mc_test_row(nAddress, nAddress + T_ROW_SIZE, MC_SDRAM_FLAGS);
PRINTF("\trow - %lu: nAddress = 0x%08lX, ret = 0x%08lX\n", j, nAddress, ret);
printf("\trow - %lu: nAddress = 0x%08lX, ret = 0x%08lX\n", j, nAddress, ret);
if (ret) {
gpio_pat ^= 0x00000080;
333,9 → 333,9
 
if (MC_SDRAM_ACC & MC_SDRAM_SGRP) {
/* perform sequential row in group access */
PRINTF("Sequential Group ");
printf("Sequential Group ");
PRINTF("Group Size = %d\n", MC_SDRAM_GROUPSIZE);
printf("Group Size = %d\n", MC_SDRAM_GROUPSIZE);
for (i=0; i<T_GROUPS; i++) {
nRowGrp = random(nRows - MC_SDRAM_GROUPSIZE) + T_ROW_OFF;
for (j=0; j<MC_SDRAM_GROUPSIZE; j++) {
347,7 → 347,7
*rgpio_out = gpio_pat;
ret = mc_test_row(nAddress, nAddress + T_ROW_SIZE, MC_SDRAM_FLAGS);
PRINTF("\trow - %lu: nAddress = 0x%08lX, ret = 0x%08lX\n", j, nAddress, ret);
printf("\trow - %lu: nAddress = 0x%08lX, ret = 0x%08lX\n", j, nAddress, ret);
 
if (ret) {
gpio_pat ^= 0x00000080;
361,9 → 361,9
 
if (MC_SDRAM_ACC & MC_SDRAM_RGRP) {
/* perform random row in group access */
PRINTF("Random Group ");
printf("Random Group ");
 
PRINTF("Group Size = %d\n", MC_SDRAM_GROUPSIZE);
printf("Group Size = %d\n", MC_SDRAM_GROUPSIZE);
for (i=0; i<T_GROUPS; i++) {
nRowGrp = random(nRows - T_GROUPS) + T_ROW_OFF;
for (j=0; j<MC_SDRAM_GROUPSIZE; j++) {
375,7 → 375,7
*rgpio_out = gpio_pat;
ret = mc_test_row(nAddress, nAddress + T_ROW_SIZE, MC_SDRAM_FLAGS);
PRINTF("\trow - %lu: nAddress = 0x%08lX, ret = 0x%08lX\n", j, nAddress, ret);
printf("\trow - %lu: nAddress = 0x%08lX, ret = 0x%08lX\n", j, nAddress, ret);
 
if (ret) {
gpio_pat ^= 0x00000080;
390,7 → 390,7
} /*for test*/
} /*if*/
} /*for CS*/
PRINTF("--- End SDRAM tests ---\n");
printf("--- End SDRAM tests ---\n");
report(0xDEADDEAD);
 
gpio_pat ^= 0x00000020;
/trunk/or1ksim/testbench/acv_uart.c
50,7 → 50,7
/* fails if there is an error */
#define NO_ERROR() { unsigned x = getreg (UART_LSR); if ((x & (LSR_BREAK|LSR_FE|LSR_PE|LSR_OE)) && !(x & LSR_ERR)) \
printf ("LSR7 (0x%02x) ERR @ %i\n", x, __LINE__); ASSERT(!(x & LSR_ERR) && ((x & 0x60) != 0x40));}
#define MARK() PRINTF ("Passed line %i\n", __LINE__)
#define MARK() printf ("Passed line %i\n", __LINE__)
 
#ifndef __LINE__
#define __LINE__ 0
61,7 → 61,7
#ifndef __FUNCTION__
#define __FUNCTION__ "?"
#endif
PRINTF ("Test failed in %s:%i\n", func, line);
printf ("Test failed in %s:%i\n", func, line);
report(0xeeeeeeee);
exit (1);
}
84,7 → 84,7
void interrupt_handler ()
{
unsigned x;
PRINTF ("Int\n");
printf ("Int\n");
report(0xdeaddead);
report(int_iir = getreg (UART_IIR));
report(int_lsr = getreg (UART_LSR));
91,23 → 91,23
int_cnt++;
ASSERT (int_iir != 1);
switch (int_iir & 0xf) {
case 0x6: PRINTF ("Receiver LS int.\n"); break;
case 0x4: PRINTF ("Received Data available. Expecting %02x, received %02x\n",
case 0x6: printf ("Receiver LS int.\n"); break;
case 0x4: printf ("Received Data available. Expecting %02x, received %02x\n",
int_rbr, x = getreg(UART_RBR));
ASSERT (x == int_rbr);
report (x);
report (int_rbr);
break;
case 0xc: PRINTF ("Character timeout. Expecting %02x, received %02x\n",
case 0xc: printf ("Character timeout. Expecting %02x, received %02x\n",
int_rbr, x = getreg(UART_RBR));
ASSERT (x == int_rbr);
report (x);
report (int_rbr);
break;
case 0x2: PRINTF ("THR empty.\n"); break;
case 0x0: PRINTF ("Modem Status.\n"); break;
case 0x2: printf ("THR empty.\n"); break;
case 0x0: printf ("Modem Status.\n"); break;
default:
PRINTF ("Invalid iir @ %i\n", __LINE__);
printf ("Invalid iir @ %i\n", __LINE__);
exit (1);
}
mtspr(SPR_PICSR, 0);
122,10 → 122,10
report (ch);
/* Wait for rx fifo to be */
while (!((x = getreg (UART_LSR)) & LSR_DR));
if ((x & (LSR_BREAK|LSR_FE|LSR_PE|LSR_OE)) && !(x & LSR_ERR)) PRINTF ("LSR7 (0x%02x) ERR @ recv_char\n", x);
if ((x & (LSR_BREAK|LSR_FE|LSR_PE|LSR_OE)) && !(x & LSR_ERR)) printf ("LSR7 (0x%02x) ERR @ recv_char\n", x);
ASSERT(!(x & LSR_ERR));
 
PRINTF ("expected %02x, read %02x\n", ch, r = getreg (UART_RBR));
printf ("expected %02x, read %02x\n", ch, r = getreg (UART_RBR));
ASSERT (r == ch); /* compare character */
}
 
164,7 → 164,7
 
void register_test ()
{
PRINTF ("register test\n");
printf ("register test\n");
MARK();
{ /* test reset values */
ASSERT(getreg (UART_RBR) == 0x00); //0
301,11 → 301,11
void send_recv_test ()
{
char *s;
PRINTF ("send_recv_test\n");
printf ("send_recv_test\n");
/* Init */
MARK();
//PRINTF ("basic\n");
//printf ("basic\n");
ASSERT (!(getreg (UART_LSR) & LSR_DR));
MARK();
 
348,7 → 348,7
s = "recv";
while (*s) recv_char (*s++);
MARK();
PRINTF ("OK\n");
printf ("OK\n");
}
 
/* sends break in both directions */
357,7 → 357,7
{
unsigned x;
char *s;
PRINTF ("break_test\n");
printf ("break_test\n");
MARK();
/* Send a break */
376,7 → 376,7
MARK();
while (!((x = getreg (UART_LSR)) & LSR_DR));
/* we should receive zero character with broken frame and break bit should be set */
PRINTF("[%x]\n", (LSR_DR | LSR_BREAK | LSR_ERR | LSR_TXFE | LSR_TXE));
printf("[%x]\n", (LSR_DR | LSR_BREAK | LSR_ERR | LSR_TXFE | LSR_TXE));
ASSERT (x == (LSR_DR | LSR_BREAK | LSR_ERR | LSR_TXFE | LSR_TXE));
ASSERT (getreg (UART_RBR) == 0);
MARK();
409,7 → 409,7
while (!((x = getreg (UART_LSR)) & LSR_DR));
/* we should receive zero character with broken frame and break bit
should not be set, because we cleared it */
PRINTF("[%x:%x]\n", x, (LSR_DR | LSR_BREAK |LSR_ERR | LSR_TXFE | LSR_TXE));
printf("[%x:%x]\n", x, (LSR_DR | LSR_BREAK |LSR_ERR | LSR_TXFE | LSR_TXE));
ASSERT (x == (LSR_DR | LSR_BREAK |LSR_ERR | LSR_TXFE | LSR_TXE));
ASSERT (getreg (UART_RBR) == 0);
MARK();
417,7 → 417,7
MARK();
while (!(getreg (UART_LSR) & LSR_DR));
recv_char ('!');
PRINTF ("OK\n");
printf ("OK\n");
}
 
/* Tries to send data in different modes in both directions */
443,7 → 443,7
void different_modes_test ()
{
int speed, parity, length;
PRINTF ("different modes test\n");
printf ("different modes test\n");
init_8n1();
/* Init */
499,7 → 499,7
send_char ('T');
while (getreg (UART_LSR) != 0x60); /* Wait for THR to be empty */
MARK();
PRINTF ("OK\n");
printf ("OK\n");
}
 
/* Test various FIFO levels, break and framing error interrupt, etc */
507,7 → 507,7
void interrupt_test ()
{
int i;
PRINTF ("interrupt_test\n");
printf ("interrupt_test\n");
/* Configure UART for interrupt mode */
ASSERT(getreg (UART_IIR) == 0xc1); /* nothing should be happening */
setreg (UART_LCR, LCR_DIVL);
699,7 → 699,7
send_char ('T');
MARK ();
PRINTF ("OK\n");
printf ("OK\n");
}
 
/* Test if all control bits are set correctly. Lot of this was already tested
741,7 → 741,7
/* SCR already tested in register_test () */
MARK ();
PRINTF ("OK\n");
printf ("OK\n");
}
 
/* Tests parity error and frane error behaviour */
748,7 → 748,7
 
void line_error_test ()
{
PRINTF ("line_error_test\n");
printf ("line_error_test\n");
/* Test framing error if we change speed */
setreg (UART_LCR, LCR_DIVL);
789,7 → 789,7
#endif
 
MARK ();
PRINTF ("OK\n");
printf ("OK\n");
}
 
int main ()
814,6 → 814,6
modem_test ();
modem_error_test ();*/
recv_char ('@');
PRINTF ("ALL TESTS PASSED\n");
printf ("ALL TESTS PASSED\n");
return 0;
}
/trunk/or1ksim/testbench/mc_ssram.c
50,7 → 50,7
mc_csc = (unsigned long*)(MC_BASE + MC_CSC(ch));
SET_FIELD(*mc_csc, MC_CSC, SEL, mc_ssram_cs[ch].M);
SET_FLAG(*mc_csc, MC_CSC, EN);
PRINTF ("Channel Config %d - CSC = 0x%08lX\n", ch, *mc_csc);
printf ("Channel Config %d - CSC = 0x%08lX\n", ch, *mc_csc);
}
}
 
72,11 → 72,11
mc_ssram_cs[ch].M = GET_FIELD(*mc_csc, MC_CSC, SEL);
mc_cs |= (1 << ch);
 
PRINTF("get_config(%d) : M=0x%0lx\n", ch,
printf("get_config(%d) : M=0x%0lx\n", ch,
mc_ssram_cs[ch].M);
}
}
PRINTF("get_config() : cs=0x%0x\n", mc_cs);
printf("get_config() : cs=0x%0x\n", mc_cs);
return 0;
}
 
99,7 → 99,7
 
#ifdef MC_READ_CONF
if (get_config()) {
PRINTF("Error reading MC configuration\n");
printf("Error reading MC configuration\n");
report(0x000000001);
return(1);
}
110,13 → 110,13
*rgpio_out = 0;
for (ch=0; ch<8; ch++) {
if (mc_cs & (0x01 << ch) ) {
PRINTF ("--- Begin Test on CS%d ---\n", ch);
printf ("--- Begin Test on CS%d ---\n", ch);
 
mc_csc = (unsigned long*)(MC_BASE + MC_CSC(ch));
mc_tms = (unsigned long*)(MC_BASE + MC_TMS(ch));
mc_sel = GET_FIELD(*mc_csc, MC_CSC, SEL);
 
PRINTF ("CS configuration : CSC - 0x%08lX, TMS - 0x%08lXu\n",
printf ("CS configuration : CSC - 0x%08lX, TMS - 0x%08lXu\n",
*mc_csc, *mc_tms);
for (test=0; test<4; test++) {
147,7 → 147,7
break;
} /*switch test*/
 
PRINTF ("Begin TEST %lu : CSC - 0x%08lX, TMS - 0x%08lX\n", test, *mc_csc, *mc_tms);
printf ("Begin TEST %lu : CSC - 0x%08lX, TMS - 0x%08lX\n", test, *mc_csc, *mc_tms);
 
nAddress = mc_sel << 21;
nAddress |= MC_MEM_BASE;
157,7 → 157,7
*rgpio_out = gpio_pat;
ret = mc_test_row(nAddress, nAddress + nMemSize, MC_SSRAM_FLAGS);
 
PRINTF("\trow tested: nAddress = 0x%08lX, ret = 0x%08lX\n", nAddress, ret);
printf("\trow tested: nAddress = 0x%08lX, ret = 0x%08lX\n", nAddress, ret);
 
if (ret) {
gpio_pat ^= 0x00000080;
169,7 → 169,7
} /*for test*/
} /*if*/
} /*for CS*/
PRINTF("--- End SSRAM tests ---\n");
printf("--- End SSRAM tests ---\n");
report(0xDEADDEAD);
 
gpio_pat ^= 0x00000020;
/trunk/or1ksim/testbench/uos/task.c
16,7 → 16,7
unsigned long count;
} msg;
 
PRINTF("Task %d started\n", id);
printf("Task %d started\n", id);
if(id == 1) {
msg.id = 1;
28,9 → 28,9
rc = uos_msgrcv(0, (char *)&msg, sizeof(msg));
 
if(rc != 0) {
PRINTF("Task %d: Waiting for massage\n", id);
printf("Task %d: Waiting for massage\n", id);
} else {
PRINTF("Task %d: Got massage from task %d: 0x%.8x. Sending message to task %d: 0x%.8x \n", id, msg.id, (int)msg.count, (id == 3 ? 1 : (id + 1)), (int)(msg.count + 1));
printf("Task %d: Got massage from task %d: 0x%.8x. Sending message to task %d: 0x%.8x \n", id, msg.id, (int)msg.count, (id == 3 ? 1 : (id + 1)), (int)(msg.count + 1));
msg.id = id;
 
if((id == 1) && (msg.count > 15)) {
/trunk/or1ksim/testbench/uos/uos.c
56,8 → 56,8
void kernel_show_mcbs(struct mcb *mcb)
{
for(;mcb; mcb = mcb->next) {
PRINTF("MCB len=%u origintask=%u ", mcb->length, mcb->origin);
PRINTF("msg:%s\n", mcb->msg);
printf("MCB len=%u origintask=%u ", mcb->length, mcb->origin);
printf("msg:%s\n", mcb->msg);
}
}
 
68,20 → 68,20
tid_t t;
for(t = 1; t <= MAX_TASKS; t++) {
PRINTF("\ntask TID=%d: PC=0x%x ", t, (unsigned)tasks[t].regs.pc & ~0x3);
PRINTF("SP(r1)=0x%x ", (unsigned)tasks[t].regs.sp);
PRINTF("SR[IEE]=%d\n", (unsigned)tasks[t].regs.sr & SPR_SR_IEE);
PRINTF("SR[TEE]=%d\n", (unsigned)tasks[t].regs.sr & SPR_SR_TEE);
PRINTF("SR[SM]=%d\n", (unsigned)tasks[t].regs.sr & SPR_SR_SM);
printf("\ntask TID=%d: PC=0x%x ", t, (unsigned)tasks[t].regs.pc & ~0x3);
printf("SP(r1)=0x%x ", (unsigned)tasks[t].regs.sp);
printf("SR[IEE]=%d\n", (unsigned)tasks[t].regs.sr & SPR_SR_IEE);
printf("SR[TEE]=%d\n", (unsigned)tasks[t].regs.sr & SPR_SR_TEE);
printf("SR[SM]=%d\n", (unsigned)tasks[t].regs.sr & SPR_SR_SM);
for(i = 1; i < GPRS; i++) {
if (i % 4 == 0)
PRINTF("\n");
PRINTF("r%d=0x%.8x ", i, (unsigned)tasks[t].regs.gprs[i]);
printf("\n");
printf("r%d=0x%.8x ", i, (unsigned)tasks[t].regs.gprs[i]);
}
PRINTF("\n");
printf("\n");
kernel_show_mcbs(tasks[t].waiting_msgs);
}
PRINTF("\n");
printf("\n");
}
 
/* Simple round-robin scheduler that directly calls dispatcher. It is
94,8 → 94,8
task_context = (unsigned long *)&tasks[curtask].regs;
 
#if KERNEL_OUTPUT
PRINTF("kernel_sched(): entry number %d, ", ++kernel_sched_cnt);
PRINTF("dispatching task TID=%d, time %u cycles", curtask, timestamp());
printf("kernel_sched(): entry number %d, ", ++kernel_sched_cnt);
printf("dispatching task TID=%d, time %u cycles", curtask, timestamp());
 
kernel_show_contexts();
#endif
229,8 → 229,8
unsigned short syscall_num;
 
#if KERNEL_OUTPUT
PRINTF("kernel_syscall(): entry number %d, ", ++kernel_syscall_cnt);
PRINTF("current TID=%d, time %u cycles", curtask, timestamp());
printf("kernel_syscall(): entry number %d, ", ++kernel_syscall_cnt);
printf("current TID=%d, time %u cycles", curtask, timestamp());
kernel_show_contexts();
#endif
244,7 → 244,7
kernel_msgrcv(curtask);
break;
default:
PRINTF("kernel_syscall(): unknown syscall (%u)\n", syscall_num);
printf("kernel_syscall(): unknown syscall (%u)\n", syscall_num);
}
 
#if KERNEL_SYSCALL_SCHED
260,19 → 260,19
tid_t t;
int i;
PRINTF("Initializing kernel:\n");
printf("Initializing kernel:\n");
 
PRINTF(" Clearing kernel structures...\n");
printf(" Clearing kernel structures...\n");
memset(tasks, 0, sizeof(tasks));
memset(stacks, 0, sizeof(stacks));
memset(msgs, 0, sizeof(msgs));
PRINTF(" Initializing MCBs... %d MCB(s)\n", MAX_MSGS);
printf(" Initializing MCBs... %d MCB(s)\n", MAX_MSGS);
for(i = 0; i < (MAX_MSGS - 1); i++)
msgs[i].next = &msgs[i+1];
free_mcbs = &msgs[0];
PRINTF(" Initializing TCBs... %d user task(s)\n", MAX_TASKS);
printf(" Initializing TCBs... %d user task(s)\n", MAX_TASKS);
 
tasks_entries();
 
295,8 → 295,8
/* Initialize initrrupt controller */
int_init();
 
PRINTF(" Exceptions will be enabled when first task is dispatched.\n");
PRINTF("Kernel initalized. Starting first user task.\n");
printf(" Exceptions will be enabled when first task is dispatched.\n");
printf("Kernel initalized. Starting first user task.\n");
 
#if KERNEL_SYSCALL_SCHED
kernel_sched(); /* Lets schedule and dispatch our first task */
/trunk/or1ksim/testbench/uos/spr_defs.h
423,6 → 423,6
#define NOP_NOP 0x0000 /* Normal nop instruction */
#define NOP_EXIT 0x0001 /* End of simulation */
#define NOP_REPORT 0x0002 /* Simple report */
#define NOP_PRINTF 0x0003 /* Simprintf instruction */
#define NOP_printf 0x0003 /* Simprintf instruction */
#define NOP_REPORT_FIRST 0x0400 /* Report with number */
#define NOP_REPORT_LAST 0x03ff /* Report with number */
/trunk/or1ksim/testbench/except_test.c
68,7 → 68,7
#define V_TRAP 14
 
#if 1
#define debug PRINTF
#define debug printf
#else
#define debug
#endif
1098,7 → 1098,7
{
int ret;
 
PRINTF("except_test\n");
printf("except_test\n");
 
/* Register bus error handler */
excpt_buserr = (unsigned long)bus_err_handler;
/trunk/or1ksim/testbench/acv_gpio.c
40,7 → 40,7
 
static void fail (char *file, int line)
{
PRINTF( "Test failed in %s:%i\n", file, line );
printf( "Test failed in %s:%i\n", file, line );
report( 0xeeeeeeee );
exit( 1 );
}
56,7 → 56,7
if ( curr == value )
return;
if ( curr != first ) {
PRINTF( "While waiting for 0x%08lX, input changed from 0x%08lX to 0x%08lX\n", value, first, curr );
printf( "While waiting for 0x%08lX, input changed from 0x%08lX to 0x%08lX\n", value, first, curr );
ASSERT( 0 );
}
}
83,7 → 83,7
 
static void test_registers( void )
{
PRINTF( "Testing initial values of all registers\n" );
printf( "Testing initial values of all registers\n" );
ASSERT( *rgpio_oe == 0 );
ASSERT( *rgpio_inte == 0 );
ASSERT( *rgpio_ptrig == 0 );
90,7 → 90,7
ASSERT( *rgpio_ctrl == 0 );
ASSERT( *rgpio_ints == 0 );
 
PRINTF( "Verifying that RGPIO_IN is read-only\n" );
printf( "Verifying that RGPIO_IN is read-only\n" );
{
unsigned long value = *rgpio_in;
unsigned i;
110,7 → 110,7
unsigned i;
unsigned long oe;
 
PRINTF( "Testing simple I/O\n" );
printf( "Testing simple I/O\n" );
for ( i = 1, oe = 1; i < 31; ++ i, oe = (oe << 1) | 1 ) {
*rgpio_oe = oe;
141,7 → 141,7
{
unsigned i;
PRINTF( "Testing interrupts\n" );
printf( "Testing interrupts\n" );
*rgpio_oe = 0x80000000;
int_count = 0;
165,7 → 165,7
static void test_external_clock( void )
{
unsigned i;
PRINTF( "Testing external clock\n" );
printf( "Testing external clock\n" );
 
*rgpio_oe = 0x80000000;
*rgpio_inte = 0x7fffffff;
200,7 → 200,7
 
static void endshake( void )
{
PRINTF( "Finishing simulation\n" );
printf( "Finishing simulation\n" );
*rgpio_oe = 0xffff0000;
*rgpio_out = 0x12340000;
wait_input( 0x12345678 );
211,7 → 211,7
 
int main()
{
PRINTF( "Starting GPIO test\n" );
printf( "Starting GPIO test\n" );
 
init_interrupts();
221,7 → 221,7
test_external_clock();
endshake();
 
PRINTF( "Ending GPIO test\n" );
printf( "Ending GPIO test\n" );
report (0xdeaddead);
return 0;
/trunk/or1ksim/testbench/mc_sync.c
51,7 → 51,7
SET_FIELD(*mc_csc, MC_CSC, SEL, mc_sync_cs[ch].M);
SET_FIELD(*mc_csc, MC_CSC, BW, 2);
SET_FLAG(*mc_csc, MC_CSC, EN);
PRINTF ("Channel Config %d - CSC = 0x%08lX\n", ch, *mc_csc);
printf ("Channel Config %d - CSC = 0x%08lX\n", ch, *mc_csc);
}
}
 
73,11 → 73,11
mc_sync_cs[ch].M = GET_FIELD(*mc_csc, MC_CSC, SEL);
mc_cs |= (1 << ch);
 
PRINTF("get_config(%d) : M=0x%0lx\n", ch,
printf("get_config(%d) : M=0x%0lx\n", ch,
mc_sync_cs[ch].M);
}
}
PRINTF("get_config() : cs=0x%0x\n", mc_cs);
printf("get_config() : cs=0x%0x\n", mc_cs);
return 0;
}
 
99,7 → 99,7
 
#ifdef MC_READ_CONF
if (get_config()) {
PRINTF("Error reading MC configuration.\n");
printf("Error reading MC configuration.\n");
report(1);
return(1);
}
110,13 → 110,13
*rgpio_out = 0;
for (ch=0; ch<8; ch++) {
if (MC_SYNC_CSMASK & (0x01 << ch) ) {
PRINTF ("--- Begin Test on CS%d ---\n", ch);
printf ("--- Begin Test on CS%d ---\n", ch);
 
mc_csc = (unsigned long*)(MC_BASE + MC_CSC(ch));
mc_tms = (unsigned long*)(MC_BASE + MC_TMS(ch));
mc_sel = GET_FIELD(*mc_csc, MC_CSC, SEL);
 
PRINTF ("CS configuration : CSC - 0x%08lX, TMS - 0x%08lXu\n",
printf ("CS configuration : CSC - 0x%08lX, TMS - 0x%08lXu\n",
*mc_csc, *mc_tms);
 
for (test=0; test<4; test++) {
147,7 → 147,7
break;
} /*switch test*/
 
PRINTF ("Begin TEST %lu : CSC - 0x%08lX, TMS - 0x%08lX\n", test, *mc_csc, *mc_tms);
printf ("Begin TEST %lu : CSC - 0x%08lX, TMS - 0x%08lX\n", test, *mc_csc, *mc_tms);
 
nAddress = mc_sel << 21;
nAddress |= MC_MEM_BASE;
157,7 → 157,7
*rgpio_out = gpio_pat;
ret = mc_test_row(nAddress, nAddress + nMemSize, MC_SYNC_FLAGS);
 
PRINTF("\trow tested: nAddress = 0x%08lX, ret = 0x%08lX\n", nAddress, ret);
printf("\trow tested: nAddress = 0x%08lX, ret = 0x%08lX\n", nAddress, ret);
 
if (ret) {
gpio_pat ^= 0x00000080;
169,7 → 169,7
} /*for test*/
} /*if*/
} /*for CS*/
PRINTF("--- End SYNC tests ---\n");
printf("--- End SYNC tests ---\n");
report(0xDEADDEAD);
 
gpio_pat ^= 0x00000020;
/trunk/or1ksim/testbench/support/support.h
17,7 → 17,7
#define REG16(add) *((volatile unsigned short *)(add))
#define REG32(add) *((volatile unsigned long *)(add))
 
void PRINTF(const char *fmt, ...);
void printf(const char *fmt, ...);
 
/* For writing into SPR. */
void mtspr(unsigned long spr, unsigned long value);
/trunk/or1ksim/testbench/support/support.c
39,14 → 39,14
while (1);
}
 
/* activate PRINTF support in simulator */
void PRINTF(const char *fmt, ...)
/* activate printf support in simulator */
void printf(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
__asm__ __volatile__ (" l.addi\tr3,%0,0\n": : "r" (fmt) : "r3", "r4");
__asm__ __volatile__ (" l.addi\tr4,%0,0\n": : "r" (args): "r3", "r4");
__asm__ __volatile__ (" l.nop %0": : "K" (NOP_PRINTF));
__asm__ __volatile__ (" l.nop %0": : "K" (NOP_printf));
}
 
/* print long */
95,7 → 95,7
#else
void report(unsigned long value)
{
PRINTF("report(0x%x);\n", (unsigned) value);
printf("report(0x%x);\n", (unsigned) value);
}
 
/* start_TIMER */
/trunk/or1ksim/testbench/mc_async.c
51,7 → 51,7
SET_FIELD(*mc_csc, MC_CSC, SEL, mc_async_cs[ch].M);
SET_FIELD(*mc_csc, MC_CSC, BW, mc_async_cs[ch].BW);
SET_FLAG(*mc_csc, MC_CSC, EN);
PRINTF ("Channel Config %d - CSC = 0x%08lX\n", ch, *mc_csc);
printf ("Channel Config %d - CSC = 0x%08lX\n", ch, *mc_csc);
}
}
 
74,12 → 74,12
mc_async_cs[ch].M = GET_FIELD(*mc_csc, MC_CSC, SEL);
mc_cs |= (1 << ch);
 
PRINTF("get_config(%d) : BW=0x%0lx, M=0x%0lx\n", ch,
printf("get_config(%d) : BW=0x%0lx, M=0x%0lx\n", ch,
mc_async_cs[ch].BW,
mc_async_cs[ch].M);
}
}
PRINTF("get_config() : cs=0x%0x\n", mc_cs);
printf("get_config() : cs=0x%0x\n", mc_cs);
return 0;
}
 
100,7 → 100,7
*rgpio_out = 0xFFFFFFFF;
#ifdef MC_READ_CONF
if (get_config()) {
PRINTF("Error reading MC configuration.\n");
printf("Error reading MC configuration.\n");
report(1);
return(1);
}
110,13 → 110,13
 
for (ch=0; ch<8; ch++) {
if (mc_cs & (0x01 << ch) ) {
PRINTF ("--- Begin Test on CS%d ---\n", ch);
printf ("--- Begin Test on CS%d ---\n", ch);
 
mc_csc = (unsigned long*)(MC_BASE + MC_CSC(ch));
mc_tms = (unsigned long*)(MC_BASE + MC_TMS(ch));
mc_sel = GET_FIELD(*mc_csc, MC_CSC, SEL);
 
PRINTF ("CS configuration : CSC - 0x%08lX, TMS - 0x%08lXu\n",
printf ("CS configuration : CSC - 0x%08lX, TMS - 0x%08lXu\n",
*mc_csc, *mc_tms);
 
for (test=0; test<4; test++) {
147,7 → 147,7
break;
} /*switch test*/
 
PRINTF ("Begin TEST %lu : CSC - 0x%08lX, TMS - 0x%08lX\n", test, *mc_csc, *mc_tms);
printf ("Begin TEST %lu : CSC - 0x%08lX, TMS - 0x%08lX\n", test, *mc_csc, *mc_tms);
 
nAddress = mc_sel << 21;
nAddress |= MC_MEM_BASE;
157,7 → 157,7
*rgpio_out = gpio_pat;
ret = mc_test_row(nAddress, nAddress + nMemSize, MC_ASYNC_FLAGS);
 
PRINTF("\trow tested: nAddress = 0x%08lX, ret = 0x%08lX\n", nAddress, ret);
printf("\trow tested: nAddress = 0x%08lX, ret = 0x%08lX\n", nAddress, ret);
 
if (ret) {
gpio_pat ^= 0x00000080;
169,7 → 169,7
} /*for test*/
} /*if*/
} /*for CS*/
PRINTF("--- End ASYNC tests ---\n");
printf("--- End ASYNC tests ---\n");
report(0xDEADDEAD);
 
gpio_pat ^= 0x00000020;
/trunk/or1ksim/testbench/mul.c
12,14 → 12,14
 
LONGEST acc = 0;
#define MAC(x,y) {\
PRINTF ("[%08x,%08x]\t", (unsigned long)(x), (unsigned long)(y));\
printf ("[%08x,%08x]\t", (unsigned long)(x), (unsigned long)(y));\
acc += (LONGEST)(x) * (LONGEST)(y);\
PRINTF ("(%08x,%08x)\n", (unsigned long)(acc >> 32), (unsigned long)(acc & 0xffffffff));\
printf ("(%08x,%08x)\n", (unsigned long)(acc >> 32), (unsigned long)(acc & 0xffffffff));\
}
#define MACRC (macrc())
static inline long macrc() {
long result = acc >> 28;
//PRINTF ("<%08x>\n", (unsigned long)result);
//printf ("<%08x>\n", (unsigned long)result);
acc = 0;
return result;
}
44,7 → 44,7
a = t - a * 17;
b = t + b * 13333;
 
/*PRINTF ("(%08x,%08x)", a, b);*/
/*printf ("(%08x,%08x)", a, b);*/
}
return a;
}
63,7 → 63,7
MAC (a, 3);
MAC (a, 5);
MAC (a, 7);
//PRINTF ("(%08x,%08x)", a, b);
//printf ("(%08x,%08x)", a, b);
}
return a;
}
85,7 → 85,7
} else {
a = MACRC;
}
// PRINTF ("(%08x,%08x)", a, b);
// printf ("(%08x,%08x)", a, b);
}
return a;
}
94,23 → 94,23
unsigned t1;
unsigned t2;
unsigned t3;
PRINTF ("%08x\n", MACRC);
printf ("%08x\n", MACRC);
MAC (888888887, 0x87654321);
PRINTF ("%08x\n", MACRC);
printf ("%08x\n", MACRC);
t1 = test_mul (888888887, 0x87654321);
t2 = test_mac (888888887, 0x87654321);
t3 = test_mul_mac (888888887, 0x87654321);
PRINTF ("%08x, expected %08x\n", t1, T1);
PRINTF ("%08x, expected %08x\n", t2, T2);
PRINTF ("%08x, expected %08x\n", t3, T3);
printf ("%08x, expected %08x\n", t1, T1);
printf ("%08x, expected %08x\n", t2, T2);
printf ("%08x, expected %08x\n", t3, T3);
report (t1 ^ t2 ^ t3 ^ T1 ^ T2 ^ T3 ^ 0xdeaddead);
if (t1 != T1 || t2 != T2 || t3 != T3) {
PRINTF ("Test failed!\n");
printf ("Test failed!\n");
if (t1 != T1) exit (1);
if (t2 != T2) exit (2);
if (t3 != T3) exit (3);
} else {
PRINTF ("Test succesful.\n");
printf ("Test succesful.\n");
exit (0);
}
exit (0);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.