soft reset small bugfix, interrupt test file added
authorStefan Rebernig <stefan.rebernig@gmail.com>
Thu, 13 Jan 2011 18:26:30 +0000 (19:26 +0100)
committerStefan Rebernig <stefan.rebernig@gmail.com>
Thu, 13 Jan 2011 18:27:24 +0000 (19:27 +0100)
cpu/src/fetch_stage_b.vhd
progs/uart_int.s [new file with mode: 0644]

index c975af29702992b673c6c8fce467f19ba2ceeb20..f86ad833a154e049e2d32fa3d79c5b5ef8c69f87 100644 (file)
@@ -68,11 +68,6 @@ variable instr_pc  : instruction_addr_t;
 begin
        rom_ram_nxt <= rom_ram;
        
---     if (s_reset = RESET_VALUE) then
---             rom_ram_nxt <= RAM_USE;
---             instr_r_addr_nxt <= (others => '0');
---     end if;
-       
        case rom_ram is
                when ROM_USE =>
                        instruction <= instr_rd_data_rom;
@@ -115,6 +110,11 @@ begin
                when others => null;
        end case;
 
+       if (s_reset = RESET_VALUE) then
+               rom_ram_nxt <= RAM_USE;
+               instr_r_addr_nxt <= (others => '0');
+       end if; 
+
 end process;
 
 out_logic : process (instr_r_addr, alu_jump_bit, int_req, jump_result)
diff --git a/progs/uart_int.s b/progs/uart_int.s
new file mode 100644 (file)
index 0000000..6e28a4b
--- /dev/null
@@ -0,0 +1,38 @@
+#include "dt_inc.s"
+
+.data
+.org 0x00
+
+str:
+       .ascii "sent byte: "
+
+.text
+.org 0x00
+start:
+       br+ main
+       call+ intr
+       ret
+
+
+main:
+       ldi r0, INT_BASE
+       ldi r1, INT_GLOBAL_BIT
+       orx r1, INT_UART_REC_BIT
+       stw r1, INT_CONF(r0)
+
+       br+ loop
+
+loop:
+       br+ loop
+
+intr:
+       ldi r1, str
+       ldi r2, 11
+       call u_send_string
+
+       ldi r0, UART_BASE
+       ldw r1, UART_RECV(r0)
+       call sseg_displ
+       call u_send_uint
+       call u_send_newline
+       ret