Line 40... |
Line 40... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.4 2003/01/21 16:06:56 mihad
|
|
// Bug fixes, testcases added.
|
|
//
|
// Revision 1.3 2002/02/01 15:25:12 mihad
|
// Revision 1.3 2002/02/01 15:25:12 mihad
|
// Repaired a few bugs, updated specification, added test bench files and design document
|
// Repaired a few bugs, updated specification, added test bench files and design document
|
//
|
//
|
// Revision 1.2 2001/10/05 08:14:29 mihad
|
// Revision 1.2 2001/10/05 08:14:29 mihad
|
// Updated all files with inclusion of timescale file for simulation purposes.
|
// Updated all files with inclusion of timescale file for simulation purposes.
|
Line 58... |
Line 61... |
// synopsys translate_off
|
// synopsys translate_off
|
`include "timescale.v"
|
`include "timescale.v"
|
// synopsys translate_on
|
// synopsys translate_on
|
`include "pci_constants.v"
|
`include "pci_constants.v"
|
|
|
module PCI_MASTER32_SM
|
module pci_master32_sm
|
(
|
(
|
// system inputs
|
// system inputs
|
clk_in,
|
clk_in,
|
reset_in,
|
reset_in,
|
// arbitration
|
// arbitration
|
Line 343... |
Line 346... |
wire force_frame = ~sm_idle ;
|
wire force_frame = ~sm_idle ;
|
// slow signal for frame calculated from various registers in the core
|
// slow signal for frame calculated from various registers in the core
|
wire slow_frame = last_in || (latency_time_out && pci_gnt_in) || (next_last_in && sm_data_phases) || mabort1 ;
|
wire slow_frame = last_in || (latency_time_out && pci_gnt_in) || (next_last_in && sm_data_phases) || mabort1 ;
|
// critical timing frame logic in separate module - some combinations of target signals force frame to inactive state immediately after sampled asserted
|
// critical timing frame logic in separate module - some combinations of target signals force frame to inactive state immediately after sampled asserted
|
// (STOP)
|
// (STOP)
|
FRAME_CRIT frame_iob_feed
|
pci_frame_crit frame_iob_feed
|
(
|
(
|
.pci_frame_out (pci_frame_out),
|
.pci_frame_out (pci_frame_out),
|
.force_frame_in (force_frame),
|
.force_frame_in (force_frame),
|
.slow_frame_in (slow_frame),
|
.slow_frame_in (slow_frame),
|
.pci_stop_in (pci_stop_in)
|
.pci_stop_in (pci_stop_in)
|
Line 356... |
Line 359... |
// frame IOB flip flop's clock enable signal
|
// frame IOB flip flop's clock enable signal
|
// slow clock enable - calculated from internal - non critical paths
|
// slow clock enable - calculated from internal - non critical paths
|
wire frame_load_slow = sm_idle || sm_address || mabort1 ;
|
wire frame_load_slow = sm_idle || sm_address || mabort1 ;
|
|
|
// critical clock enable for frame IOB in separate module - target response signals actually allow frame value change - critical timing
|
// critical clock enable for frame IOB in separate module - target response signals actually allow frame value change - critical timing
|
FRAME_LOAD_CRIT frame_iob_ce
|
pci_frame_load_crit frame_iob_ce
|
(
|
(
|
.pci_frame_load_out (pci_frame_load_out),
|
.pci_frame_load_out (pci_frame_load_out),
|
.sm_data_phases_in (sm_data_phases),
|
.sm_data_phases_in (sm_data_phases),
|
.frame_load_slow_in (frame_load_slow),
|
.frame_load_slow_in (frame_load_slow),
|
.pci_trdy_in (pci_trdy_in),
|
.pci_trdy_in (pci_trdy_in),
|
Line 370... |
Line 373... |
// IRDY driving
|
// IRDY driving
|
// non critical path for IRDY calculation
|
// non critical path for IRDY calculation
|
wire irdy_slow = pci_frame_out_in && mabort1 || mabort2 ;
|
wire irdy_slow = pci_frame_out_in && mabort1 || mabort2 ;
|
|
|
// critical path in separate module
|
// critical path in separate module
|
IRDY_OUT_CRIT irdy_iob_feed
|
pci_irdy_out_crit irdy_iob_feed
|
(
|
(
|
.pci_irdy_out (pci_irdy_out),
|
.pci_irdy_out (pci_irdy_out),
|
.irdy_slow_in (irdy_slow),
|
.irdy_slow_in (irdy_slow),
|
.pci_frame_out_in (pci_frame_out_in),
|
.pci_frame_out_in (pci_frame_out_in),
|
.pci_trdy_in (pci_trdy_in),
|
.pci_trdy_in (pci_trdy_in),
|
Line 413... |
Line 416... |
// new data is loaded to AD outputs whenever state machine is idle, bus was granted and bus is in idle state or
|
// new data is loaded to AD outputs whenever state machine is idle, bus was granted and bus is in idle state or
|
// when address phase is about to be finished
|
// when address phase is about to be finished
|
wire ad_load_slow = sm_address ;
|
wire ad_load_slow = sm_address ;
|
wire ad_load_on_grant = sm_idle && pci_frame_in && pci_irdy_in ;
|
wire ad_load_on_grant = sm_idle && pci_frame_in && pci_irdy_in ;
|
|
|
MAS_AD_LOAD_CRIT mas_ad_load_feed
|
pci_mas_ad_load_crit mas_ad_load_feed
|
(
|
(
|
.ad_load_out (ad_load_out),
|
.ad_load_out (ad_load_out),
|
.ad_load_in (ad_load_slow),
|
.ad_load_in (ad_load_slow),
|
.ad_load_on_grant_in (ad_load_on_grant),
|
.ad_load_on_grant_in (ad_load_on_grant),
|
.pci_gnt_in (pci_gnt_in)
|
.pci_gnt_in (pci_gnt_in)
|
Line 440... |
Line 443... |
|
|
// a bit more critical change state enable is calculated with GNT signal
|
// a bit more critical change state enable is calculated with GNT signal
|
wire ch_state_med = ch_state_slow || sm_idle && u_have_pci_bus && req_in && rdy_in ;
|
wire ch_state_med = ch_state_slow || sm_idle && u_have_pci_bus && req_in && rdy_in ;
|
|
|
// most critical change state enable - calculated from target response signals
|
// most critical change state enable - calculated from target response signals
|
MAS_CH_STATE_CRIT state_machine_ce
|
pci_mas_ch_state_crit state_machine_ce
|
(
|
(
|
.change_state_out (change_state),
|
.change_state_out (change_state),
|
.ch_state_med_in (ch_state_med),
|
.ch_state_med_in (ch_state_med),
|
.sm_data_phases_in (sm_data_phases),
|
.sm_data_phases_in (sm_data_phases),
|
.pci_trdy_in (pci_trdy_in),
|
.pci_trdy_in (pci_trdy_in),
|
Line 460... |
Line 463... |
|
|
wire ad_en_slow = do_write && ( sm_address || ( sm_data_phases && !( ( pci_frame_out_in && mabort1 ) || mabort2 ) ) ) ;
|
wire ad_en_slow = do_write && ( sm_address || ( sm_data_phases && !( ( pci_frame_out_in && mabort1 ) || mabort2 ) ) ) ;
|
wire ad_en_on_grant = ( sm_idle && pci_frame_in && pci_irdy_in ) || sm_turn_arround ;
|
wire ad_en_on_grant = ( sm_idle && pci_frame_in && pci_irdy_in ) || sm_turn_arround ;
|
|
|
// critical timing ad enable - calculated from grant input
|
// critical timing ad enable - calculated from grant input
|
MAS_AD_EN_CRIT ad_iob_oe_feed
|
pci_mas_ad_en_crit ad_iob_oe_feed
|
(
|
(
|
.pci_ad_en_out (pci_ad_en_out),
|
.pci_ad_en_out (pci_ad_en_out),
|
.ad_en_slow_in (ad_en_slow),
|
.ad_en_slow_in (ad_en_slow),
|
.ad_en_on_grant_in (ad_en_on_grant),
|
.ad_en_on_grant_in (ad_en_on_grant),
|
.pci_gnt_in (pci_gnt_in)
|
.pci_gnt_in (pci_gnt_in)
|
Line 474... |
Line 477... |
wire cbe_en_on_grant = sm_idle && pci_frame_in && pci_irdy_in || sm_turn_arround ;
|
wire cbe_en_on_grant = sm_idle && pci_frame_in && pci_irdy_in || sm_turn_arround ;
|
wire cbe_en_slow = cbe_en_on_grant && ~pci_gnt_in || sm_address || sm_data_phases && ~pci_frame_out_in ;
|
wire cbe_en_slow = cbe_en_on_grant && ~pci_gnt_in || sm_address || sm_data_phases && ~pci_frame_out_in ;
|
wire cbe_en_keep = sm_data_phases && pci_frame_out_in && ~mabort1 && ~mabort2 ;
|
wire cbe_en_keep = sm_data_phases && pci_frame_out_in && ~mabort1 && ~mabort2 ;
|
|
|
// most critical cbe enable in separate module - calculated with most critical target inputs
|
// most critical cbe enable in separate module - calculated with most critical target inputs
|
CBE_EN_CRIT cbe_iob_feed
|
pci_cbe_en_crit cbe_iob_feed
|
(
|
(
|
.pci_cbe_en_out (pci_cbe_en_out),
|
.pci_cbe_en_out (pci_cbe_en_out),
|
.cbe_en_slow_in (cbe_en_slow),
|
.cbe_en_slow_in (cbe_en_slow),
|
.cbe_en_keep_in (cbe_en_keep),
|
.cbe_en_keep_in (cbe_en_keep),
|
.pci_stop_in (pci_stop_in),
|
.pci_stop_in (pci_stop_in),
|
Line 492... |
Line 495... |
// frame enable driving - sometimes it's calculated from non critical paths
|
// frame enable driving - sometimes it's calculated from non critical paths
|
wire frame_en_slow = (sm_idle && u_have_pci_bus && req_in && rdy_in) || sm_address || (sm_data_phases && ~pci_frame_out_in) ;
|
wire frame_en_slow = (sm_idle && u_have_pci_bus && req_in && rdy_in) || sm_address || (sm_data_phases && ~pci_frame_out_in) ;
|
wire frame_en_keep = sm_data_phases && pci_frame_out_in && ~mabort1 && ~mabort2 ;
|
wire frame_en_keep = sm_data_phases && pci_frame_out_in && ~mabort1 && ~mabort2 ;
|
|
|
// most critical frame enable - calculated from heavily constrained target inputs in separate module
|
// most critical frame enable - calculated from heavily constrained target inputs in separate module
|
FRAME_EN_CRIT frame_iob_en_feed
|
pci_frame_en_crit frame_iob_en_feed
|
(
|
(
|
.pci_frame_en_out (pci_frame_en_out),
|
.pci_frame_en_out (pci_frame_en_out),
|
.frame_en_slow_in (frame_en_slow),
|
.frame_en_slow_in (frame_en_slow),
|
.frame_en_keep_in (frame_en_keep),
|
.frame_en_keep_in (frame_en_keep),
|
.pci_stop_in (pci_stop_in),
|
.pci_stop_in (pci_stop_in),
|