ai.v
3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/************************************************************************\
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
\************************************************************************/
// $Id: ai.v,v 1.1 2002/03/28 00:26:12 berndt Exp $
module ai(clock, reset_l,
cbus_read_enable, cbus_write_enable, cbus_select, cbus_command,
dma_start, dma_grant, read_grant, dbus_data, vbus_clock,
dma_request, read_request, abus_data, abus_word, abus_clock, ai_full,
cbus_data);
`include "ai.vh"
input clock; // system clock
input reset_l; // system reset
input cbus_read_enable; // enable cbus read mux
input cbus_write_enable; // enable cbus tristate drivers
input [CBUS_SELECT_SIZE-1:0] cbus_select; // cbus data select
input [CBUS_COMMAND_SIZE-1:0] cbus_command; // cbus data type
input dma_start; // first dbus word flag
input dma_grant; // DMA request granted
input read_grant; // read request granted
input [DBUS_DATA_SIZE-1:0] dbus_data; // DMA bus
input vbus_clock; // video transimt clock
output dma_request; // request a DMA cycle
output read_request; // request a read response cycle
output abus_data; // audio data
output abus_word; // audio high word flag
output abus_clock; // audio transmit clock
output ai_full; // ai double buffer full
inout [CBUS_DATA_SIZE-1:0] cbus_data; // IO bus
wire [DRAM_ADDRESS_SIZE-1:0] dma_address;
wire [CBUS_DATA_SIZE-1:0] reg_read_data;
wire [CBUS_DATA_SIZE-1:0] reg_write_data;
wire [AI_REG_ADDRESS_SIZE-1:0] reg_address;
wire reg_write_enable;
wire [BIT_RATE_SIZE-1:0] bit_rate_reg;
wire [DAC_RATE_SIZE-1:0] dac_rate_reg;
wire [15:0] dac_test_data;
wire [SAMPLE_WORD_SIZE-1:0] current_sample;
//
ai_dma ai_dma_0(.clock(clock), .reset_l(reset_l),
.cbus_read_enable(cbus_read_enable),
.cbus_write_enable(cbus_write_enable), .cbus_select(cbus_select),
.cbus_command(cbus_command), .dma_grant(dma_grant),
.read_grant(read_grant), .dma_address(dma_address),
.reg_read_data(reg_read_data), .read_request(read_request),
.reg_write_data(reg_write_data), .reg_address(reg_address),
.reg_write_enable(reg_write_enable), .cbus_data(cbus_data));
// instantiate DMA and register R/W controller
ai_controller ai_controller_0(.clk(clock), .reset_l(reset_l),
.dma_grant(dma_grant), .dma_start(dma_start),
.reg_write_data(reg_write_data), .reg_address(reg_address),
.reg_write_enable(reg_write_enable), .abus_word(abus_word),
.test_data(dac_test_data),
.dbus_data(dbus_data), .dma_request(dma_request),
.dma_address(dma_address), .reg_read_data(reg_read_data),
.bit_rate_reg(bit_rate_reg), .dac_rate_reg(dac_rate_reg),
.current_sample(current_sample), .interrupt_flag(ai_full));
// instantiate audio serial clock and data controller
ai_abus ai_abus_0 (.clk(vbus_clock), .reset_l(reset_l),
.bit_rate(bit_rate_reg), .dac_rate(dac_rate_reg),
.data_word(current_sample), .dac_cntr_out(dac_test_data),
.abus_data(abus_data), .abus_clk(abus_clock), .abus_wsel(abus_word));
endmodule
// eof