diff --git a/doc/uart.md b/doc/uart.md index 6a6d191..b349eb4 100644 --- a/doc/uart.md +++ b/doc/uart.md @@ -37,7 +37,7 @@ It uses a fixed serial configuration of 115200 bps, 8 data bits, 1 stop bit, no ## Notes -A 64 byte FIFO is used when receiving data. +A 16 byte FIFO is used when receiving data. When reading data, each byte needs to be acknowledged by writing the _C_ flag to the UART register. diff --git a/tridoracpu/tridoracpu.srcs/irqctrl.v b/tridoracpu/tridoracpu.srcs/irqctrl.v index 5608440..b71df60 100644 --- a/tridoracpu/tridoracpu.srcs/irqctrl.v +++ b/tridoracpu/tridoracpu.srcs/irqctrl.v @@ -1,6 +1,6 @@ `timescale 1ns / 1ps -module irqctrl #(IRQ_LINES = 3, IRQ_DELAY_WIDTH = 8) ( +module irqctrl #(IRQ_LINES = 3, IRQ_DELAY_WIDTH = 4) ( input wire clk, input wire [IRQ_LINES-1:0] irq_in, input wire cs, diff --git a/tridoracpu/tridoracpu.srcs/stackcpu.v b/tridoracpu/tridoracpu.srcs/stackcpu.v index b8ef78c..1d929f7 100644 --- a/tridoracpu/tridoracpu.srcs/stackcpu.v +++ b/tridoracpu/tridoracpu.srcs/stackcpu.v @@ -399,10 +399,7 @@ module stackcpu #(parameter ADDR_WIDTH = 32, WIDTH = 32, // process irq always @(posedge clk) begin - // in MEM state, clear irq_pending, when nPC has been set to IV - // RET instruction is a special case because we need to use - // the new PC that is in mem_data - if(seq_state == MEM && irq_pending && !(ins_xfer && xfer_r2p)) + if(seq_state == MEM && irq_pending && !(ins_xfer & xfer_r2p)) // in FETCH state, clear irq_pending. irq_pending <= 0; else irq_pending <= irq_pending || irq; // else set irq_pending when irq is high diff --git a/tridoracpu/tridoracpu.srcs/tdraudio.v b/tridoracpu/tridoracpu.srcs/tdraudio.v index 4ad978d..1629e31 100644 --- a/tridoracpu/tridoracpu.srcs/tdraudio.v +++ b/tridoracpu/tridoracpu.srcs/tdraudio.v @@ -233,7 +233,7 @@ module tdraudio #(DATA_WIDTH=32) ( chan2_rd_data, amp_wr_data, chan2_rd_en, chan2_wr_en, chan2_amp, - chan2_running, chan2_irq); + chan2_irq, chan2_running); wavegen chan3(clk, reset, reg_sel, chan3_rd_data, amp_wr_data, diff --git a/tridoracpu/tridoracpu.srcs/top.v b/tridoracpu/tridoracpu.srcs/top.v index 0dc3346..a4533d2 100644 --- a/tridoracpu/tridoracpu.srcs/top.v +++ b/tridoracpu/tridoracpu.srcs/top.v @@ -278,9 +278,6 @@ module top( (io_slot == 4) ? tdraudio_rd_data: `endif -1; - irqctrl irqctrl0(`clock, irq_in, irqc_cs, mem_write_enable, - irqc_seten, irqc_rd_data0, - irq); // CPU ----------------------------------------------------------------- stackcpu cpu0(.clk(`clock), .rst(rst), .irq(irq), @@ -291,6 +288,10 @@ module top( .mem_wait(mem_wait), .debug1(led1), .debug2(led2), .debug3(led3)); + // Interrupt Controller + irqctrl irqctrl0(`clock, irq_in, irqc_cs, mem_write_enable, + irqc_seten, irqc_rd_data0, + irq); // count clock ticks // generate interrupt every 20nth of a second diff --git a/tridoracpu/tridoracpu.xpr b/tridoracpu/tridoracpu.xpr index a3dd3f6..a9dc20f 100644 --- a/tridoracpu/tridoracpu.xpr +++ b/tridoracpu/tridoracpu.xpr @@ -358,7 +358,9 @@ - + + Vivado Synthesis Defaults + @@ -378,7 +380,9 @@ - + + Default settings for Implementation. + @@ -387,7 +391,9 @@ - + + +