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

Subversion Repositories dbg_interface

[/] [dbg_interface/] [tags/] [rel_21/] [bench/] [verilog/] [wb_model_defines.v] - Blame information for rev 158

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 80 mohor
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  dbg_tb_defines.v                                            ////
4
////                                                              ////
5
////                                                              ////
6
////  This file is part of the SoC/OpenRISC Development Interface ////
7
////  http://www.opencores.org/projects/DebugInterface/           ////
8
////                                                              ////
9
////  Author(s):                                                  ////
10
////      - Miha Dolenc (mihad@opencores.org)                     ////
11
////                                                              ////
12
////                                                              ////
13
////  All additional information is avaliable in the README.txt   ////
14
////  file.                                                       ////
15
////                                                              ////
16
//////////////////////////////////////////////////////////////////////
17
////                                                              ////
18
//// Copyright (C) 2000 - 2003 Authors                            ////
19
////                                                              ////
20
//// This source file may be used and distributed without         ////
21
//// restriction provided that this copyright statement is not    ////
22
//// removed from the file and that any derivative work contains  ////
23
//// the original copyright notice and the associated disclaimer. ////
24
////                                                              ////
25
//// This source file is free software; you can redistribute it   ////
26
//// and/or modify it under the terms of the GNU Lesser General   ////
27
//// Public License as published by the Free Software Foundation; ////
28
//// either version 2.1 of the License, or (at your option) any   ////
29
//// later version.                                               ////
30
////                                                              ////
31
//// This source is distributed in the hope that it will be       ////
32
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
33
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
34
//// PURPOSE.  See the GNU Lesser General Public License for more ////
35
//// details.                                                     ////
36
////                                                              ////
37
//// You should have received a copy of the GNU Lesser General    ////
38
//// Public License along with this source; if not, download it   ////
39
//// from http://www.opencores.org/lgpl.shtml                     ////
40
////                                                              ////
41
//////////////////////////////////////////////////////////////////////
42
//
43
// CVS Revision History
44
//
45
// $Log: not supported by cvs2svn $
46
//
47
//
48
 
49
// WISHBONE frequency in GHz
50
`define WB_FREQ 0.100
51
 
52
// memory frequency in GHz
53
`define MEM_FREQ 0.100
54
 
55
// setup and hold time definitions for WISHBONE - used in BFMs for signal generation
56
`define Tsetup 4
57
`define Thold  1
58
 
59
// how many clock cycles should model wait for design's response - integer 32 bit value
60
`define WAIT_FOR_RESPONSE 1023
61
 
62
// maximum number of transactions allowed in single call to block or cab transfer routines
63
`define MAX_BLK_SIZE  1024
64
 
65
// maximum retry terminations allowed for WISHBONE master to repeat an access
66
`define WB_TB_MAX_RTY 0
67
 
68
 
69
// some common types and defines
70
`define WB_ADDR_WIDTH 32
71
`define WB_DATA_WIDTH 32
72
`define WB_SEL_WIDTH `WB_DATA_WIDTH/8
73
`define WB_TAG_WIDTH 5
74
`define WB_ADDR_TYPE [(`WB_ADDR_WIDTH - 1):0]
75
`define WB_DATA_TYPE [(`WB_DATA_WIDTH - 1):0]
76
`define WB_SEL_TYPE  [(`WB_SEL_WIDTH  - 1):0]
77
`define WB_TAG_TYPE  [(`WB_TAG_WIDTH  - 1):0]
78
 
79
// read cycle stimulus - consists of:
80
//    - address field - which address read will be performed from
81
//    - sel field     - what byte select value should be
82
//    - tag field     - what tag values should be put on the bus
83
`define READ_STIM_TYPE [(`WB_ADDR_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH - 1):0]
84
`define READ_STIM_LENGTH (`WB_ADDR_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH)
85
`define READ_ADDRESS  [(`WB_ADDR_WIDTH - 1):0]
86
`define READ_SEL      [(`WB_ADDR_WIDTH + `WB_SEL_WIDTH - 1):`WB_ADDR_WIDTH]
87
`define READ_TAG_STIM [(`WB_ADDR_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH - 1):(`WB_ADDR_WIDTH + `WB_SEL_WIDTH)]
88
 
89
// read cycle return type consists of:
90
//    - read data field
91
//    - tag field received from WISHBONE
92
//    - wishbone slave response fields - ACK, ERR and RTY
93
//    - test bench error indicator (when testcase has not used wb master model properly)
94
//    - how much data was actually transfered
95
`define READ_RETURN_TYPE [(32 + 4 + `WB_DATA_WIDTH + `WB_TAG_WIDTH - 1):0]
96
`define READ_DATA        [(32 + `WB_DATA_WIDTH + 4 - 1):32 + 4]
97
`define READ_TAG_RET     [(32 + 4 + `WB_DATA_WIDTH + `WB_TAG_WIDTH - 1):(`WB_DATA_WIDTH + 32 + 4)]
98
`define READ_RETURN_LENGTH (32 + 4 + `WB_DATA_WIDTH + `WB_TAG_WIDTH - 1)
99
 
100
// write cycle stimulus type consists of
101
//    - address field
102
//    - data field
103
//    - sel field
104
//    - tag field
105
`define WRITE_STIM_TYPE [(`WB_ADDR_WIDTH + `WB_DATA_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH - 1):0]
106
`define WRITE_ADDRESS       [(`WB_ADDR_WIDTH - 1):0]
107
`define WRITE_DATA          [(`WB_ADDR_WIDTH + `WB_DATA_WIDTH - 1):`WB_ADDR_WIDTH]
108
`define WRITE_SEL           [(`WB_ADDR_WIDTH + `WB_DATA_WIDTH + `WB_SEL_WIDTH - 1):(`WB_ADDR_WIDTH + `WB_DATA_WIDTH)]
109
`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)]
110
 
111
// length of WRITE_STIMULUS
112
`define WRITE_STIM_LENGTH (`WB_ADDR_WIDTH + `WB_DATA_WIDTH + `WB_SEL_WIDTH + `WB_TAG_WIDTH)
113
 
114
// write cycle return type consists of:
115
//    - test bench error indicator (when testcase has not used wb master model properly)
116
//    - wishbone slave response fields - ACK, ERR and RTY
117
//    - tag field received from WISHBONE
118
//    - how much data was actually transfered
119
`define WRITE_RETURN_TYPE [(32 + 4 + `WB_TAG_WIDTH - 1):0]
120
`define WRITE_TAG_RET     [(32 + 4 + `WB_TAG_WIDTH - 1):32 + 4]
121
 
122
// this four fields are common to both read and write routines return values
123
`define TB_ERROR_BIT [0]
124
`define CYC_ACK [1]
125
`define CYC_RTY [2]
126
`define CYC_ERR [3]
127
`define CYC_RESPONSE [3:1]
128
`define CYC_ACTUAL_TRANSFER [35:4]
129
 
130
// block transfer flags
131
`define WB_TRANSFER_FLAGS [41:0]
132
// consists of:
133
// - number of transfer cycles to perform
134
// - flag that enables retry termination handling - if disabled, block transfer routines will return on any termination other than acknowledge
135
// - flag indicating CAB transfer is to be performed - ignored by all single transfer routines
136
// - number of initial wait states to insert
137
// - number of subsequent wait states to insert
138
`define WB_TRANSFER_SIZE     [41:10]
139
`define WB_TRANSFER_AUTO_RTY [8]
140
`define WB_TRANSFER_CAB      [9]
141
`define INIT_WAITS           [3:0]
142
`define SUBSEQ_WAITS         [7:4]
143
 
144
// wb slave response
145
`define ACK_RESPONSE  3'b100
146
`define ERR_RESPONSE  3'b010
147
`define RTY_RESPONSE  3'b001
148
`define NO_RESPONSE   3'b000

powered by: WebSVN 2.1.0

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