]> Joshua Wise's Git repositories - fpgaboy.git/commitdiff
Diag rom now runs from bootloader!
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Thu, 8 May 2008 06:07:15 +0000 (02:07 -0400)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Thu, 8 May 2008 06:07:15 +0000 (02:07 -0400)
Makefile
System.v
binwire.c
diag.asm

index fe10ee8dc601cccb873e37dc795d70f8663cd30b..5e50da8d38970a028e4550bff7ec993061392d95 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ VLOGS_ALL = $(VLOGS) insn_call-callcc.v insn_incdec16.v insn_jr-jrcc.v \
        insn_ldm8_a.v insn_ldm16_a.v insn_ldbcde_a.v insn_alu_ext.v \
        insn_bit.v insn_two_byte.v insn_incdec_reg8.v
 
-all: CoreTop.svf CoreTop.twr
+all: CoreTop.svf
 
 sim: CoreTop_isim.exe
 
index 8f9ef085234387d1c80f51c9fc1f4ae6f76d4659..55dda1c1d1140fd1996169715efa066c50c04383 100644 (file)
--- a/System.v
+++ b/System.v
@@ -107,9 +107,9 @@ module CellularRAM(
        assign cr_nWE = decode ? ~wrlatch : 1;
        
        assign cr_DQ = (~cr_nOE) ? 16'bzzzzzzzzzzzzzzzz : {8'b0, datalatch};
-       assign cr_A = (addrlatch[15:14] == 2'b00) ? /* extrom */ {9'b0,addrlatch[13:0]} :
-                       (addrlatch[15:13] == 3'b101) ? {1'b1, 9'b0, addrlatch[12:0]} :
-                       (addrlatch == ADDR_PROGDATA) ? progaddr :
+       assign cr_A = (address[15:14] == 2'b00) ? /* extrom */ {9'b0,address[13:0]} :
+                       (address[15:13] == 3'b101) ? {1'b1, 9'b0, address[12:0]} :
+                       (address == ADDR_PROGDATA) ? progaddr :
                        23'b0;
        
        reg [7:0] regbuf;
@@ -120,8 +120,8 @@ module CellularRAM(
                ADDR_PROGADDRM: if (wr) progaddrm <= data;
                ADDR_PROGADDRL: if (wr) progaddrl <= data;
                ADDR_PROGDATA:  if (rd || wr) begin
-                                       progaddr <= {progaddrh[6:0], progaddrm[7:0], progaddr[7:0]};
-                                       {progaddrh[6:0], progaddrm[7:0], progaddr[7:0]} <= {progaddrh[6:0], progaddrm[7:0], progaddr[7:0]} + 23'b1;
+                                       progaddr <= {progaddrh[6:0], progaddrm[7:0], progaddrl[7:0]};
+                                       {progaddrh[6:0], progaddrm[7:0], progaddrl[7:0]} <= {progaddrh[6:0], progaddrm[7:0], progaddrl[7:0]} + 23'b1;
                                end
                endcase
                rdlatch <= rd;
index ed6b98c90a7aac056b2e4807a679e022cbf4c286..a878a5d39dbd799aa398739ff5edd2696c6c7c4e 100644 (file)
--- a/binwire.c
+++ b/binwire.c
@@ -45,7 +45,7 @@ void expect_no_chars()
 {
   int cs = 0;
   
-  while (waitchar(10) == 1)
+  while (waitchar(100) == 1)
   {
     char c;
     if (read(0, &c, 1) == 0)
@@ -77,10 +77,11 @@ void main(int argc, char **argv)
     exit(1);
   }
   
-  dowrite("\x1B" "A\x00\x00\x00...", 8);
+  dowrite("\x1B" "A\x00\x00\x00", 5);
   fprintf(stderr, "Address sent\n");
-  expect("A...", 4);
-  while ((sz = read(rfd, buf+3, 128)) > 0)
+  expect("A", 1);
+  expect_no_chars();
+  while ((sz = read(rfd, buf+3, 255)) > 0)
   {
     buf[0] = 0x1B;
     buf[1] = 'D';
index 780f5c2b452df06e5da55f2c4d1d9cb932058dfb..b30faf390b33003ed6a880cd19ed6756ee875391 100644 (file)
--- a/diag.asm
+++ b/diag.asm
@@ -475,14 +475,14 @@ insntest:
 
 ; Serial port manipulation functions.
 putc:
-       ld c, $50
+       ld c, $53
        push af
 .waitport:
        ld a,[c]
-       cp $00
+       and $01
        jr nz,.waitport
        pop af
-       ld [c],a
+       ld [$FF52],a
        ret
 
 puts:
This page took 0.03255 seconds and 4 git commands to generate.