浏览代码

rv32: reduce the verbosity of test code

It's a bit too noisy to be practical when not actively debugging.
H. Peter Anvin 3 年之前
父节点
当前提交
ef2d958d8f
共有 6 个文件被更改,包括 7225 次插入7230 次删除
  1. 二进制
      fpga/output_files/max80.jbc
  2. 二进制
      fpga/output_files/max80.jic
  3. 二进制
      fpga/output_files/max80.pof
  4. 二进制
      fpga/output_files/max80.sof
  5. 7216 7216
      rv32/boot.mif
  6. 9 14
      rv32/system.c

二进制
fpga/output_files/max80.jbc


二进制
fpga/output_files/max80.jic


二进制
fpga/output_files/max80.pof


二进制
fpga/output_files/max80.sof


文件差异内容过多而无法显示
+ 7216 - 7216
rv32/boot.mif


+ 9 - 14
rv32/system.c

@@ -5,6 +5,9 @@
 #include "sys.h"
 #include "console.h"
 
+#define DEBUG     0
+#define MINITESTS 1
+
 volatile uint32_t timer_irq_count;
 IRQHANDLER(sysclock)
 {
@@ -12,7 +15,7 @@ IRQHANDLER(sysclock)
 
     count++;
     timer_irq_count = count;
-    if (!(count & ((1U << TIMER_SHIFT)-1))) {
+    if (DEBUG && !(count & ((1U << TIMER_SHIFT)-1))) {
 	register size_t oldpc asm("s10");
 	CON_DATA = '.';		/* Console heartbeat */
 	con_printf("\n<%08x>\r", oldpc);
@@ -70,7 +73,7 @@ void init(void)
     wait_romcopy_done();
     set_leds(5);
 
-#if 1
+#if DEBUG
     con_puts("Waiting 5 s for testing...");
     udelay(5000000);
     con_putc('\n');
@@ -89,7 +92,7 @@ void init(void)
 		   (uint16_t)boardcfg);
     }
 
-    if ( 1 ) {
+    if ( MINITESTS ) {
 	con_puts("Quick DRAM test:\n");
 	for (int i = 0; i < 8; i++) {
 	    uint32_t v = (i*0x11111111) + 0x44332211;
@@ -102,18 +105,10 @@ void init(void)
 	for (int i = 0; i < 8; i++) {
 	    con_printf("%08x ", test_dram[i]);
 	}
+	con_puts("\n\nRandom number generator test:\n");
+	for (int i = 0; i < 8; i++)
+	    con_printf("%08x ", rdrand());
 	con_puts("\n\n");
-
-	udelay(1000000);
-    }
-
-    if ( 1 ) {
-	con_puts("Random number generator test:\n");
-	for (int i = 0; i < 8; i++) {
-	    uint32_t a = rdrand();
-	    uint32_t b = rdrand();
-	    con_printf("%08x %08x delta %08x\n", a, b, a^b);
-	}
     }
 
     rom_get_serial();

部分文件因为文件数量过多而无法显示