OpenCores
URL https://opencores.org/ocsvn/pci/pci/trunk

Subversion Repositories pci

[/] [pci/] [tags/] [rel_7/] [bench/] [verilog/] [pci_testbench_defines.v] - Blame information for rev 15

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 mihad
//===================================================================================
2
//  Changeable testbench defines (constants) - tested together with 
3
//    pci_user_constants.v file, and not when regression testing!
4
//===================================================================================
5
 
6
// define whether or not testbench should stop executing after error is detected
7
`define STOP_ON_FAILURE
8
 
9
`ifdef REGRESSION
10
`else // Following DEFINES are used only without regression testing (together with pci_user_constants) !!!
11
    // wishbone frequncy in GHz
12
    `define WB_FREQ 0.025
13
 
14
    // values of image registers of PCI bridge device - valid are only upper 20 bits, others must be ZERO !
15
    `define TAR0_BASE_ADDR_0    32'h1000_0000
16
    `define TAR0_BASE_ADDR_1    32'h2000_0000
17
    `define TAR0_BASE_ADDR_2    32'h3000_0000
18
    `define TAR0_BASE_ADDR_3    32'h4000_0000
19
    `define TAR0_BASE_ADDR_4    32'h5000_0000
20
    `define TAR0_BASE_ADDR_5    32'h6000_0000
21
 
22
    `define TAR0_ADDR_MASK_0    32'hFFFF_F000 // when BA0 is used to access configuration space, this is NOT important!
23
    `define TAR0_ADDR_MASK_1    32'hFFFF_F000
24
    `define TAR0_ADDR_MASK_2    32'hFFFF_F000
25
    `define TAR0_ADDR_MASK_3    32'hFFFF_F000
26
    `define TAR0_ADDR_MASK_4    32'hFFFF_F000
27
    `define TAR0_ADDR_MASK_5    32'hFFFF_F000
28
 
29
    `define TAR0_TRAN_ADDR_0    32'h5000_0000 // when BA0 is used to access configuration space, this is NOT important!
30
    `define TAR0_TRAN_ADDR_1    32'h4000_0000
31
    `define TAR0_TRAN_ADDR_2    32'h3000_0000
32
    `define TAR0_TRAN_ADDR_3    32'h2000_0000
33
    `define TAR0_TRAN_ADDR_4    32'h1000_0000
34
    `define TAR0_TRAN_ADDR_5    32'h0000_0000
35
 
36
    // values of image registers of PCI behavioral target devices !
37
    `define BEH_TAR1_MEM_START 32'h7000_0000
38
    `define BEH_TAR1_MEM_END   32'h7000_0FFF
39
    `define BEH_TAR1_IO_START  32'h8000_0001
40
    `define BEH_TAR1_IO_END    32'h8000_0FFF
41
 
42
    `define BEH_TAR2_MEM_START 32'h9000_0000
43
    `define BEH_TAR2_MEM_END   32'h9000_0FFF
44
    `define BEH_TAR2_IO_START  32'hA000_0001
45
    `define BEH_TAR2_IO_END    32'hA000_0FFF
46
`endif
47
 
48
//===================================================================================
49
//  User-unchangeable testbench defines (constants)
50
//===================================================================================
51
 
52
// setup and hold time definitions for WISHBONE - used in BFMs for signal generation
53
`define Tsetup 2
54
`define Thold  2
55
 
56
// how many clock cycles should model wait for design's response - integer 32 bit value
57
`define WAIT_FOR_RESPONSE 6
58
 
59
// maximum number of transactions allowed in single call to block or cab transfer routines
60
`define MAX_BLK_SIZE  1024
61
 
62
// maximum retry terminations allows for WISHBONE master to repeat an access
63
`define WB_TB_MAX_RTY 1000
64
 
65
 
66
// some common types and defines
67
`define WB_ADDR_WIDTH 32
68
`define WB_DATA_WIDTH 32
69
`define WB_SEL_WIDTH `WB_DATA_WIDTH/8
70
`define WB_TAG_WIDTH 4
71
`define WB_ADDR_TYPE [(`WB_ADDR_WIDTH - 1):0]
72
`define WB_DATA_TYPE [(`WB_DATA_WIDTH - 1):0]
73
`define WB_SEL_TYPE  [(`WB_SEL_WIDTH  - 1):0]
74
`define WB_TAG_TYPE  [(`WB_TAG_WIDTH  - 1):0]
75
 
76
// definitions file only for testbench usage
77
// wishbone master behavioral defines
78
// flags type for wishbone cycle initialization
79
`define CYC_FLAG_TYPE [0:0]
80
// cab flag field in cycle initialization data
81
`define CYC_CAB_FLAG [0]
82
// read cycle stimulus - consists of:
83
//    - address field - which address read will be performed from
84
//    - sel field     - what byte select value should be
85
//    - tag field     - what tag values should be put on the bus
86
`define READ_STIM_TYPE [(`WB_ADDR_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH - 1):0]
87
`define READ_STIM_LENGTH (`WB_ADDR_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH)
88
`define READ_ADDRESS  [(`WB_ADDR_WIDTH - 1):0]
89
`define READ_SEL      [(`WB_ADDR_WIDTH + `WB_SEL_WIDTH - 1):`WB_ADDR_WIDTH]
90
`define READ_TAG_STIM [(`WB_ADDR_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH - 1):(`WB_ADDR_WIDTH + `WB_SEL_WIDTH)]
91
 
92
// read cycle return type consists of:
93
//    - read data field
94
//    - tag field received from WISHBONE
95
//    - wishbone slave response fields - ACK, ERR and RTY
96
//    - test bench error indicator (when testcase has not used wb master model properly)
97
//    - how much data was actually transfered
98
`define READ_RETURN_TYPE [(32 + 4 + `WB_DATA_WIDTH + `WB_TAG_WIDTH - 1):0]
99
`define READ_DATA        [(32 + `WB_DATA_WIDTH + 4 - 1):32 + 4]
100
`define READ_TAG_RET     [(32 + 4 + `WB_DATA_WIDTH + `WB_TAG_WIDTH - 1):(`WB_DATA_WIDTH + 32 + 4)]
101
`define READ_RETURN_LENGTH (32 + 4 + `WB_DATA_WIDTH + `WB_TAG_WIDTH - 1)
102
 
103
// write cycle stimulus type consists of
104
//    - address field
105
//    - data field
106
//    - sel field
107
//    - tag field
108
`define WRITE_STIM_TYPE [(`WB_ADDR_WIDTH + `WB_DATA_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH - 1):0]
109
`define WRITE_ADDRESS       [(`WB_ADDR_WIDTH - 1):0]
110
`define WRITE_DATA          [(`WB_ADDR_WIDTH + `WB_DATA_WIDTH - 1):`WB_ADDR_WIDTH]
111
`define WRITE_SEL           [(`WB_ADDR_WIDTH + `WB_DATA_WIDTH + `WB_SEL_WIDTH - 1):(`WB_ADDR_WIDTH + `WB_DATA_WIDTH)]
112
`define WRITE_TAG_STIM      [(`WB_ADDR_WIDTH + `WB_DATA_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH - 1):(`WB_ADDR_WIDTH + `WB_DATA_WIDTH + `WB_SEL_WIDTH)]
113
 
114
// length of WRITE_STIMULUS
115
`define WRITE_STIM_LENGTH (`WB_ADDR_WIDTH + `WB_DATA_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH)
116
 
117
// write cycle return type consists of:
118
//    - test bench error indicator (when testcase has not used wb master model properly)
119
//    - wishbone slave response fields - ACK, ERR and RTY
120
//    - tag field received from WISHBONE
121
//    - how much data was actually transfered
122
`define WRITE_RETURN_TYPE [(32 + 4 + `WB_TAG_WIDTH - 1):0]
123
`define WRITE_TAG_RET     [(32 + 4 + `WB_TAG_WIDTH - 1):32 + 4]
124
 
125
// this four fields are common to both read and write routines return values
126
`define TB_ERROR_BIT [0]
127
`define CYC_ACK [1]
128
`define CYC_RTY [2]
129
`define CYC_ERR [3]
130
`define CYC_RESPONSE [3:1]
131
`define CYC_ACTUAL_TRANSFER [35:4]
132
 
133
// block transfer flags
134
`define WB_TRANSFER_FLAGS [41:0]
135
// consists of:
136
// - number of transfer cycles to perform
137
// - flag that enables retry termination handling - if disabled, block transfer routines will return on any termination other than acknowledge
138
// - flag indicating CAB transfer is to be performed - ignored by all single transfer routines
139
// - number of initial wait states to insert
140
// - number of subsequent wait states to insert
141
`define WB_TRANSFER_SIZE     [41:10]
142
`define WB_TRANSFER_AUTO_RTY [8]
143
`define WB_TRANSFER_CAB      [9]
144
`define INIT_WAITS           [3:0]
145
`define SUBSEQ_WAITS         [7:4]
146
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.