/******************************************************************************/
/* */
/* Copyright (c) 1999 Sun Microsystems, Inc. All rights reserved. */
/* */
/* The contents of this file are subject to the current version of the Sun */
/* Community Source License, microSPARCII ("the License"). You may not use */
/* this file except in compliance with the License. You may obtain a copy */
/* of the License by searching for "Sun Community Source License" on the */
/* World Wide Web at http://www.sun.com. See the License for the rights, */
/* obligations, and limitations governing use of the contents of this file. */
/* */
/* Sun Microsystems, Inc. has intellectual property rights relating to the */
/* technology embodied in these files. In particular, and without limitation, */
/* these intellectual property rights may include one or more U.S. patents, */
/* foreign patents, or pending applications. */
/* */
/* Sun, Sun Microsystems, the Sun logo, all Sun-based trademarks and logos, */
/* Solaris, Java and all Java-based trademarks and logos are trademarks or */
/* registered trademarks of Sun Microsystems, Inc. in the United States and */
/* other countries. microSPARC is a trademark or registered trademark of */
/* SPARC International, Inc. All SPARC trademarks are used under license and */
/* are trademarks or registered trademarks of SPARC International, Inc. in */
/* the United States and other countries. Products bearing SPARC trademarks */
/* are based upon an architecture developed by Sun Microsystems, Inc. */
/* */
/******************************************************************************/
/***************************************************************************
****************************************************************************
***
*** Program File: @(#)cmd_map.v
***
*** Description:
*** Implements the afx address space to pci command mapping.
***
****************************************************************************
****************************************************************************/
module cmd_map
(
afx_write, // afx write command
io_space_en, // io space decode
mem_space_en, // mem space decode
config_add_en, // configuration address decode
config_data_en, // configuration data decode
falcon_reg_en, // falcon registers decode
special_cycle_en, // special cycle decode
// except for decode of address reg
special_cycle_decode, // config add set for special cycle
interrupt_ack_en, // interrupt ack decode
// decode if config data
boot_mode, // processor boot mode
bm_sel, // boot mode select
cmd_out // encoded command
);
input afx_write
;
input io_space_en
;
input mem_space_en
;
input config_add_en
;
input config_data_en
;
input falcon_reg_en
;
input special_cycle_en
;
input interrupt_ack_en
;
input special_cycle_decode
;
input boot_mode
;
input [1:0] bm_sel
;
output [3:0] cmd_out
;
// Commands are encoded as follows
// (These match PCI spec except for 4,5,8,9 are pci reserved, used internally
// only. PCI core won't be started for these commands!)
// Special cycle address access as a read will be converted to a falcon read
// SPECIAL CYCLE 1
// IO READ 2
// IO WRITE 3
// CONFIG_DATA_RD 4 (via falcon)
// CONFIG_DATA_WRITE 5 (via falcon)
// MEM READ 6
// MEM WRITE 7
// CONFIG_ADD_READ 8
// CONFIG_ADD_WRITE 9
// CONFIG_DATA_READ A (via PCI)
// CONFIG_DATA_WRITE B (via PCI)
//During processor boot mode, if the pci is selected as the boot device then
//the command must be changed from IO read to a Memory read. The address
//supplied by the processor is 3000.xxxx . We will generate the command
//normally and then select memory read if pci is the selected boot device.
wire pci_boot
= boot_mode & bm_sel[1] ;
wire [3:0] cmd_dec
;
wire [3:0] cmd_out = pci_boot ? 4'h6 : cmd_dec;
// interrupt ack can only be a read
assign cmd_dec[0] = afx_write & ~interrupt_ack_en
| special_cycle_en & afx_write
| special_cycle_decode & config_data_en;
assign cmd_dec[1] = mem_space_en | io_space_en | config_data_en &
~special_cycle_decode;
assign cmd_dec[2] = mem_space_en | falcon_reg_en | special_cycle_en &
~afx_write;
assign cmd_dec[3] = config_add_en | config_data_en & ~special_cycle_decode;
endmodule
| This page: |
Created: | Thu Aug 19 12:00:30 1999 |
| From: |
../../../sparc_v8/ssparc/pcic/afx_slave/rtl/cmd_map.v
|