OpenCores
URL https://opencores.org/ocsvn/avalon-wishbone-bridge/avalon-wishbone-bridge/trunk

Subversion Repositories avalon-wishbone-bridge

[/] [avalon-wishbone-bridge/] [trunk/] [UVM/] [wb_slave_agent/] [wb_if.sv] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sumanta.ch
//interface apb_if(input PCLK,
2
//                 input PRESETn);
3
//
4
//  logic[31:0] PADDR;
5
//  logic[31:0] PRDATA;
6
//  logic[31:0] PWDATA;
7
//  logic[15:0] PSEL;
8
//  logic PENABLE;
9
//  logic PWRITE;
10
//  logic PREADY;
11
//  logic PSLVERR;
12
//endinterface: apb_if
13
`ifndef WISHBONE_B4_IF__SV
14
`define WISHBONE_B4_IF__SV
15
interface wb_if #(ADR_W  = 32,DAT_W  = 64, TAG_W  = 1) (input bit clk,rst_n);
16
    //parameter DAT_W  = 64;       // data port width
17
    //parameter ADR_W  = 32;       // address port width
18
    //parameter TAG_W  = 1;        // default tag widths are 1 bit
19
 
20
    localparam SEL_W = (DAT_W/8); // 1 select bit per data byte, divide by 8
21
 
22
    /// common signals ///
23
    logic [DAT_W-1:0] dat_i;  // data in bus
24
    logic [DAT_W-1:0] dat_o;  // data out bus
25
    logic             rst_i;  // core reset
26
    logic [TAG_W-1:0] tgd_i;  // tag for data in. Contains information associated to dat_i (such as parity).
27
    logic [TAG_W-1:0] tgd_o;  // tag for data out. Contains information associated to dat_o
28
 
29
    /// signals direction is dependent on agent ///
30
    logic             ack;  // acknowledge, signals normal termination of the bus cycle
31
    logic [ADR_W-1:0] adr;  // address bus
32
    logic             cyc;  // cycle, when asserted, indicates that a valid bus cycle is in progress
33
    logic             err;  // error, indicates an abnormal cycle termination
34
    logic             lock; // lock, when asserted, indicates that the current bus cycle is uninterruptible
35
    logic             rty;  // retry, cycle should be retried
36
    logic [SEL_W-1:0] sel;  // select array, indicates where a dat_o/dat_i (write/read) byte is valid, each bit represents one data byte
37
    logic             stb;  // strobe, indicates a valid data transfer cycle
38
    logic [TAG_W-1:0] tga;  // tag for address, contains information associated to the adr signal
39
    logic [TAG_W-1:0] tgc;  // tag for cycle, contains information associated with cyc
40
    logic             we;   // write enable
41
    logic             stall; //signal added in wishbone B4, equivalet to AXI ready.
42
 
43
    // master driver
44
    clocking m_drv_cb @(posedge clk);
45
      default input #1step output #1;
46
 
47
      //common signals
48
      input  dat_i;
49
      output dat_o;
50
      input  rst_i;
51
      input  tgd_i;
52
      output tgd_o;
53
 
54
      // direction for master agent
55
      input  ack;
56
      output adr;
57
      output cyc;
58
      input  err;
59
      output lock;
60
      input  rty;
61
      output sel;
62
      output stb;
63
      output tga;
64
      output tgc;
65
      output we;
66
      input  stall;
67
 
68
    endclocking: m_drv_cb
69
 
70
    // slave driver
71
    clocking s_drv_cb @(posedge clk);
72
      default input #1step output #1;
73
 
74
      //common signals
75
      input  dat_i;
76
      output dat_o;
77
      input  rst_i;
78
      input  tgd_i;
79
      output tgd_o;
80
 
81
      // direction for slave agent
82
      output ack;
83
      input  adr;
84
      input  cyc;
85
      output err;
86
      input  lock;
87
      output rty;
88
      input  sel;
89
      input  stb;
90
      input  tga;
91
      input  tgc;
92
      input  we;
93
      output stall;
94
 
95
    endclocking: s_drv_cb
96
 
97
    clocking mon_cb @(posedge clk);
98
      default input #1step output #1;
99
 
100
      //common signals
101
      input  dat_i;
102
      input  dat_o;
103
      input  rst_i;
104
      input  tgd_i;
105
      input  tgd_o;
106
 
107
      // all monitor signals are inputs
108
      input  ack;
109
      input  adr;
110
      input  cyc;
111
      input  err;
112
      input  lock;
113
      input  rty;
114
      input  sel;
115
      input  stb;
116
      input  tga;
117
      input  tgc;
118
      input  we;
119
      input  stall;
120
 
121
    endclocking: mon_cb
122
 
123
modport master (clocking m_drv_cb);
124
modport slave (clocking s_drv_cb);
125
modport monitor (clocking mon_cb);
126
 
127
endinterface: wb_if
128
 
129
`endif //WISHBONE_B3_IF__SV

powered by: WebSVN 2.1.0

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