From 0264f96d1b4a6929802afbaec97b24a298f902c9 Mon Sep 17 00:00:00 2001 From: Stefan Rebernig Date: Thu, 13 Jan 2011 19:26:30 +0100 Subject: [PATCH] soft reset small bugfix, interrupt test file added --- cpu/src/fetch_stage_b.vhd | 10 +++++----- progs/uart_int.s | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 progs/uart_int.s diff --git a/cpu/src/fetch_stage_b.vhd b/cpu/src/fetch_stage_b.vhd index c975af2..f86ad83 100644 --- a/cpu/src/fetch_stage_b.vhd +++ b/cpu/src/fetch_stage_b.vhd @@ -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 index 0000000..6e28a4b --- /dev/null +++ b/progs/uart_int.s @@ -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 -- 2.25.1