Line 41... |
Line 41... |
module xgate_top #(parameter ARST_LVL = 1'b0, // asynchronous reset level
|
module xgate_top #(parameter ARST_LVL = 1'b0, // asynchronous reset level
|
parameter SINGLE_CYCLE = 1'b0, //
|
parameter SINGLE_CYCLE = 1'b0, //
|
parameter MAX_CHANNEL = 127, // Max XGATE Interrupt Channel Number
|
parameter MAX_CHANNEL = 127, // Max XGATE Interrupt Channel Number
|
parameter DWIDTH = 16) // Data bus width
|
parameter DWIDTH = 16) // Data bus width
|
(
|
(
|
// Wishbone Signals
|
// Wishbone Slave Signals
|
output [DWIDTH-1:0] wbs_dat_o, // databus output
|
output [DWIDTH-1:0] wbs_dat_o, // databus output
|
output wbs_ack_o, // bus cycle acknowledge output
|
output wbs_ack_o, // bus cycle acknowledge output
|
input wbs_clk_i, // master clock input
|
input wbs_clk_i, // master clock input
|
input wbs_rst_i, // synchronous active high reset
|
input wbs_rst_i, // synchronous active high reset
|
input arst_i, // asynchronous reset
|
input arst_i, // asynchronous reset
|
Line 53... |
Line 53... |
input [DWIDTH-1:0] wbs_dat_i, // databus input
|
input [DWIDTH-1:0] wbs_dat_i, // databus input
|
input wbs_we_i, // write enable input
|
input wbs_we_i, // write enable input
|
input wbs_stb_i, // stobe/core select signal
|
input wbs_stb_i, // stobe/core select signal
|
input wbs_cyc_i, // valid bus cycle input
|
input wbs_cyc_i, // valid bus cycle input
|
input [1:0] wbs_sel_i, // Select byte in word bus transaction
|
input [1:0] wbs_sel_i, // Select byte in word bus transaction
|
|
// Wishbone Master Signals
|
|
output [DWIDTH-1:0] wbm_dat_o, // databus output
|
|
output wbm_we_o, // write enable output
|
|
output wbm_stb_o, // stobe/core select signal
|
|
output wbm_cyc_o, // valid bus cycle output
|
|
output [ 1:0] wbm_sel_o, // Select byte in word bus transaction
|
|
output [15:0] wbm_adr_o, // Address bits
|
|
input [DWIDTH-1:0] wbm_dat_i, // databus input
|
|
input wbm_ack_i, // bus cycle acknowledge input
|
// XGATE IO Signals
|
// XGATE IO Signals
|
output [ 7:0] xgswt, // XGATE Software Trigger Register
|
output [ 7:0] xgswt, // XGATE Software Trigger Register
|
output [15:0] xgate_address,
|
|
output write_mem_strb_l, // Strobe for writing low data byte
|
output write_mem_strb_l, // Strobe for writing low data byte
|
output write_mem_strb_h, // Strobe for writing high data bye
|
output write_mem_strb_h, // Strobe for writing high data bye
|
output [15:0] write_mem_data,
|
|
output [MAX_CHANNEL:0] xgif, // XGATE Interrupt Flag
|
output [MAX_CHANNEL:0] xgif, // XGATE Interrupt Flag
|
input [15:0] read_mem_data,
|
|
input [MAX_CHANNEL:0] chan_req_i, // XGATE Interrupt request
|
input [MAX_CHANNEL:0] chan_req_i, // XGATE Interrupt request
|
input risc_clk, // Clock for RISC core
|
input risc_clk, // Clock for RISC core
|
input scantestmode // Chip in in scan test mode
|
input scantestmode // Chip in in scan test mode
|
);
|
);
|
|
|
|
|
wire zero_flag;
|
wire zero_flag;
|
wire negative_flag;
|
wire negative_flag;
|
wire carry_flag;
|
wire carry_flag;
|
wire overflow_flag;
|
wire overflow_flag;
|
wire [15:0] xgr1; // XGATE Register #1
|
wire [15:0] xgr1; // XGATE Register #1
|
Line 126... |
Line 131... |
wire xgie; // XGATE Interrupt Enable
|
wire xgie; // XGATE Interrupt Enable
|
wire [ 6:0] int_req; // Encoded interrupt request
|
wire [ 6:0] int_req; // Encoded interrupt request
|
wire [ 6:0] xgchid; // Channel actively being processed
|
wire [ 6:0] xgchid; // Channel actively being processed
|
wire [15:1] xgvbr; // XGATE vector Base Address Register
|
wire [15:1] xgvbr; // XGATE vector Base Address Register
|
|
|
wire [ 2:0] semaph_risc; // Semaphore register select from RISC
|
wire [15:0] xgate_address; //
|
|
wire [15:0] write_mem_data; //
|
|
wire [15:0] read_mem_data; //
|
|
wire mem_req_ack; //
|
|
|
wire [ 7:0] host_semap; // Semaphore status for host
|
wire [ 7:0] host_semap; // Semaphore status for host
|
// wire [15:0] write_mem_data;
|
// wire [15:0] write_mem_data;
|
// wire [15:0] read_mem_data;
|
// wire [15:0] read_mem_data;
|
// wire [15:0] perif_data;
|
// wire [15:0] perif_data;
|
|
|
Line 283... |
Line 292... |
// inputs
|
// inputs
|
.risc_clk( risc_clk ),
|
.risc_clk( risc_clk ),
|
.perif_data( wbs_dat_i ),
|
.perif_data( wbs_dat_i ),
|
.async_rst_b( async_rst_b ),
|
.async_rst_b( async_rst_b ),
|
.read_mem_data( read_mem_data ),
|
.read_mem_data( read_mem_data ),
|
|
.mem_req_ack( mem_req_ack ),
|
.xge( xge ),
|
.xge( xge ),
|
.xgfrz( xgfrz ),
|
.xgfrz( xgfrz ),
|
.xgdbg( xgdbg ),
|
.xgdbg( xgdbg ),
|
.xgss( xgss ),
|
.xgss( xgss ),
|
.xgvbr( xgvbr ),
|
.xgvbr( xgvbr ),
|
Line 318... |
Line 328... |
.int_req( int_req ),
|
.int_req( int_req ),
|
// inputs
|
// inputs
|
.chan_req_i( chan_req_i )
|
.chan_req_i( chan_req_i )
|
);
|
);
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Wishbone Master Bus interface
|
|
xgate_wbm_bus #(.ARST_LVL(ARST_LVL))
|
|
wishbone_m(
|
|
// Wishbone Master Signals
|
|
.wbm_dat_o( wbm_dat_o ),
|
|
.wbm_we_o( wbm_we_o ),
|
|
.wbm_stb_o( wbm_stb_o ),
|
|
.wbm_cyc_o( wbm_cyc_o ),
|
|
.wbm_sel_o( wbm_sel_o ),
|
|
.wbm_adr_o( wbm_adr_o ),
|
|
.wbm_dat_i( wbm_dat_i ),
|
|
.wbm_ack_i( wbm_ack_i ),
|
|
.wbs_clk_i( wbs_clk_i ),
|
|
.wbs_rst_i( wbs_rst_i ),
|
|
.arst_i( arst_i ),
|
|
// XGATE Control Signals
|
|
.read_mem_data( read_mem_data ),
|
|
.xgate_address( xgate_address ),
|
|
.mem_req_ack( mem_req_ack ),
|
|
.write_mem_strb_l( write_mem_strb_l ),
|
|
.write_mem_strb_h( write_mem_strb_h ),
|
|
.write_mem_data( write_mem_data )
|
|
);
|
|
|
|
|
endmodule // xgate_top
|
endmodule // xgate_top
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|