tridoracpu: cleaned up top a bit, removed some warnings
This commit is contained in:
parent
0016d4ea25
commit
d2f3b09e72
5 changed files with 47 additions and 58 deletions
|
|
@ -7,7 +7,7 @@ module wavegen #(DATA_WIDTH=32, CLOCK_DIV_WIDTH=22,
|
|||
input wire reset,
|
||||
input wire [1:0] reg_sel,
|
||||
output wire [DATA_WIDTH-1:0] rd_data,
|
||||
input wire [DATA_WIDTH-1:0] wr_data,
|
||||
input wire [AMP_WIDTH-1:0] wr_data,
|
||||
input wire rd_en,
|
||||
input wire wr_en,
|
||||
|
||||
|
|
@ -20,6 +20,9 @@ module wavegen #(DATA_WIDTH=32, CLOCK_DIV_WIDTH=22,
|
|||
localparam TDRAU_REG_CLK = 1; /* clock divider register */
|
||||
localparam TDRAU_REG_AMP = 2; /* amplitude (volume) register */
|
||||
|
||||
/* avoid warning about unconnected port */
|
||||
(* keep="soft" *) wire _unused = rd_en;
|
||||
|
||||
reg channel_enable;
|
||||
reg [CLOCK_DIV_WIDTH-1:0] clock_div;
|
||||
reg [CLOCK_DIV_WIDTH-1:0] div_count;
|
||||
|
|
@ -29,12 +32,12 @@ module wavegen #(DATA_WIDTH=32, CLOCK_DIV_WIDTH=22,
|
|||
|
||||
wire fifo_wr_en;
|
||||
wire fifo_rd_en, fifo_full, fifo_empty;
|
||||
wire [DATA_WIDTH-1:0] fifo_rd_data;
|
||||
wire [AMP_WIDTH-1:0] fifo_rd_data;
|
||||
|
||||
fifo #(.ADDR_WIDTH(4), .DATA_WIDTH(16)) sample_buf(
|
||||
clk, reset,
|
||||
fifo_wr_en, fifo_rd_en,
|
||||
wr_data, fifo_rd_data,
|
||||
wr_data[AMP_WIDTH-1:0], fifo_rd_data,
|
||||
fifo_full,
|
||||
fifo_empty
|
||||
);
|
||||
|
|
@ -166,9 +169,14 @@ module tdraudio #(DATA_WIDTH=32) (
|
|||
localparam AMP_BIAS = 32768;
|
||||
localparam DAC_WIDTH = 18;
|
||||
|
||||
/* avoid warning about unconnected port */
|
||||
(* keep="soft" *) wire [DATA_WIDTH-1:AMP_WIDTH] _unused = wr_data[DATA_WIDTH-1:AMP_WIDTH];
|
||||
|
||||
wire [4:0] chan_sel = io_addr[6:2];
|
||||
wire [1:0] reg_sel = io_addr[1:0];
|
||||
|
||||
wire [AMP_WIDTH-1:0] amp_wr_data = wr_data[AMP_WIDTH-1:0];
|
||||
|
||||
wire [AMP_WIDTH-1:0] chan0_amp;
|
||||
wire [DATA_WIDTH-1:0] chan0_rd_data;
|
||||
wire chan0_running;
|
||||
|
|
@ -210,25 +218,25 @@ module tdraudio #(DATA_WIDTH=32) (
|
|||
{DATA_WIDTH{1'b1}};
|
||||
|
||||
wavegen chan0(clk, reset, reg_sel,
|
||||
chan0_rd_data, wr_data,
|
||||
chan0_rd_data, amp_wr_data,
|
||||
chan0_rd_en, chan0_wr_en,
|
||||
chan0_amp,
|
||||
chan0_running, chan0_irq);
|
||||
|
||||
wavegen chan1(clk, reset, reg_sel,
|
||||
chan1_rd_data, wr_data,
|
||||
chan1_rd_data, amp_wr_data,
|
||||
chan1_rd_en, chan1_wr_en,
|
||||
chan1_amp,
|
||||
chan1_running, chan1_irq);
|
||||
|
||||
wavegen chan2(clk, reset, reg_sel,
|
||||
chan2_rd_data, wr_data,
|
||||
chan2_rd_data, amp_wr_data,
|
||||
chan2_rd_en, chan2_wr_en,
|
||||
chan2_amp,
|
||||
chan2_irq, chan2_running);
|
||||
|
||||
wavegen chan3(clk, reset, reg_sel,
|
||||
chan3_rd_data, wr_data,
|
||||
chan3_rd_data, amp_wr_data,
|
||||
chan3_rd_en, chan3_wr_en,
|
||||
chan3_amp,
|
||||
chan3_running, chan3_irq);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue