commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r5522 - in gnuradio/branches/developers/eb/u2f: firmwa


From: eb
Subject: [Commit-gnuradio] r5522 - in gnuradio/branches/developers/eb/u2f: firmware top/u2_sim
Date: Tue, 22 May 2007 22:57:49 -0600 (MDT)

Author: eb
Date: 2007-05-22 22:57:49 -0600 (Tue, 22 May 2007)
New Revision: 5522

Modified:
   gnuradio/branches/developers/eb/u2f/firmware/bootstrap.c
   gnuradio/branches/developers/eb/u2f/firmware/oldbootstrap.c
   gnuradio/branches/developers/eb/u2f/firmware/sim_io.c
   gnuradio/branches/developers/eb/u2f/firmware/sim_io.h
   gnuradio/branches/developers/eb/u2f/top/u2_sim/Makefile
   gnuradio/branches/developers/eb/u2f/top/u2_sim/u2_sim_top.v
Log:
work-in-progress on u2 firmware

Modified: gnuradio/branches/developers/eb/u2f/firmware/bootstrap.c
===================================================================
--- gnuradio/branches/developers/eb/u2f/firmware/bootstrap.c    2007-05-23 
04:25:31 UTC (rev 5521)
+++ gnuradio/branches/developers/eb/u2f/firmware/bootstrap.c    2007-05-23 
04:57:49 UTC (rev 5522)
@@ -5,16 +5,17 @@
 
 int main() {
 
-  sim_puthex(0);
-  sim_putc('X');
-  sim_puthex(1);
+  sim_puthex_nl(0);
+  sim_putc_nl('X');
+  sim_puthex_nl(1);
 
   // Set up AD9510
   spi_init();
 
-  sim_puthex(2);
-  sim_puts("This is a test");
+  sim_puthex_nl(2);
+  sim_puts("This is a test\n");
   sim_puthex(3);
+  sim_newline();
 
   spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00004500, 24, 0); // CLK2 drives 
distribution
   spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00003D80, 24, 0); // Turn on 
output 1 (FPGA CLK), normal levels

Modified: gnuradio/branches/developers/eb/u2f/firmware/oldbootstrap.c
===================================================================
--- gnuradio/branches/developers/eb/u2f/firmware/oldbootstrap.c 2007-05-23 
04:25:31 UTC (rev 5521)
+++ gnuradio/branches/developers/eb/u2f/firmware/oldbootstrap.c 2007-05-23 
04:57:49 UTC (rev 5522)
@@ -1,20 +1,21 @@
 
 #include "memory_map.h"
+#include "spi.h"
 #include "sim_io.h"
-#include "spi.h"
 
 int main() {
 
-  sim_puthex(0);
-  sim_putc('X');
-  sim_puthex(1);
+  sim_puthex_nl(0);
+  sim_putc_nl('X');
+  sim_puthex_nl(1);
 
   // Set up AD9510
   spi_init();
 
-  sim_puthex(2);
-  sim_puts("This is a test");
+  sim_puthex_nl(2);
+  sim_puts("This is a test\n");
   sim_puthex(3);
+  sim_newline();
 
   spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00004500, 24, 0); // CLK2 drives 
distribution
   spi_transact(SPI_TXONLY, SPI_SS_AD9510, 0x00003D80, 24, 0); // Turn on 
output 1 (FPGA CLK), normal levels

Modified: gnuradio/branches/developers/eb/u2f/firmware/sim_io.c
===================================================================
--- gnuradio/branches/developers/eb/u2f/firmware/sim_io.c       2007-05-23 
04:25:31 UTC (rev 5521)
+++ gnuradio/branches/developers/eb/u2f/firmware/sim_io.c       2007-05-23 
04:57:49 UTC (rev 5522)
@@ -21,20 +21,17 @@
 
 #include "sim_io.h"
 
-void sim_puthex(unsigned long x)
+void sim_puts(const char *s)
 {
-  volatile unsigned long *p = (unsigned long *) 0xE000;
-  *p = x;
+  while (*s)
+    sim_putc(*s++);
 }
 
-void sim_putc(unsigned char s)
+void sim_puts_nl(const char *s)
 {
-  volatile unsigned long *p = (unsigned long *) 0xE004;
-  *p = s;
-}
+  while (*s)
+    sim_putc(*s++);
 
-void sim_puts(char *s)
-{
-  volatile unsigned long *p = (unsigned long *) 0xE008;
-  *p = (unsigned long) s;
+  sim_newline();
 }
+

Modified: gnuradio/branches/developers/eb/u2f/firmware/sim_io.h
===================================================================
--- gnuradio/branches/developers/eb/u2f/firmware/sim_io.h       2007-05-23 
04:25:31 UTC (rev 5521)
+++ gnuradio/branches/developers/eb/u2f/firmware/sim_io.h       2007-05-23 
04:57:49 UTC (rev 5522)
@@ -19,8 +19,46 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-void sim_puthex(unsigned long x);
-void sim_putc(unsigned char s);
-void sim_puts(char *s);
+void sim_puts(const char *s);
+void sim_puts_nl(const char *s);       // add \n
 
+// %08x
+static inline void 
+sim_puthex(unsigned long x)
+{
+  volatile unsigned long *p = (unsigned long *) 0xE000;
+  *p = x;
+}
 
+// %08x\n
+static inline void 
+sim_puthex_nl(unsigned long x)
+{
+  volatile unsigned long *p = (unsigned long *) 0xE100;
+  *p = x;
+}
+
+// %c
+static inline void 
+sim_putc(unsigned char s)
+{
+  volatile unsigned long *p = (unsigned long *) 0xE004;
+  *p = s;
+}
+
+// %c\n
+static inline void 
+sim_putc_nl(unsigned char s)
+{
+  volatile unsigned long *p = (unsigned long *) 0xE104;
+  *p = s;
+}
+
+// \n
+static inline void 
+sim_newline(void)
+{
+  volatile unsigned long *p = (unsigned long *) 0xE008;
+  *p = 0;
+}
+

Modified: gnuradio/branches/developers/eb/u2f/top/u2_sim/Makefile
===================================================================
--- gnuradio/branches/developers/eb/u2f/top/u2_sim/Makefile     2007-05-23 
04:25:31 UTC (rev 5521)
+++ gnuradio/branches/developers/eb/u2f/top/u2_sim/Makefile     2007-05-23 
04:57:49 UTC (rev 5522)
@@ -3,4 +3,5 @@
 u2_sim:        
        iverilog -c cmdfile u2_sim_top.v -o u2_sim
 
-
+clean:
+       rm -f u2_sim *.vcd

Modified: gnuradio/branches/developers/eb/u2f/top/u2_sim/u2_sim_top.v
===================================================================
--- gnuradio/branches/developers/eb/u2f/top/u2_sim/u2_sim_top.v 2007-05-23 
04:25:31 UTC (rev 5521)
+++ gnuradio/branches/developers/eb/u2f/top/u2_sim/u2_sim_top.v 2007-05-23 
04:57:49 UTC (rev 5522)
@@ -236,11 +236,15 @@
    always @(posedge wb_clk)
      begin
        if((u2_basic.m0_we == 1'd1)&&(u2_basic.m0_adr == 16'hE000))
-         $display("Hello0 %x",u2_basic.m0_dat_i);
+         $write("%x",u2_basic.m0_dat_i);
+       if((u2_basic.m0_we == 1'd1)&&(u2_basic.m0_adr == 16'hE100))
+         $display("%x",u2_basic.m0_dat_i);
        if((u2_basic.m0_we == 1'd1)&&(u2_basic.m0_adr == 16'hE004))
-         $display("Hello4 %c",u2_basic.m0_dat_i);
+         $write("%c",u2_basic.m0_dat_i);
+       if((u2_basic.m0_we == 1'd1)&&(u2_basic.m0_adr == 16'hE104))
+         $display("%c",u2_basic.m0_dat_i);
        if((u2_basic.m0_we == 1'd1)&&(u2_basic.m0_adr == 16'hE008))
-         $display("Hello8 %s",u2_basic.m0_dat_i);
+         $display("");
      end
        
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]